1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-22 06:11:36 +03:00
juvix/app/Commands/Dev/Options.hs
Łukasz Czajka 2d798ec31c
New compilation pipeline (#1832)
* Depends on PR #1824 
* Closes #1556 
* Closes #1825 
* Closes #1843
* Closes #1729 
* Closes #1596 
* Closes #1343 
* Closes #1382 
* Closes #1867 
* Closes #1876 
* Changes the `juvix compile` command to use the new pipeline.
* Removes the `juvix dev minic` command and the `BackendC` tests.
* Adds the `juvix eval` command.
* Fixes bugs in the Nat-to-integer conversion.
* Fixes bugs in the Internal-to-Core and Core-to-Core.Stripped
translations.
* Fixes bugs in the RemoveTypeArgs transformation.
* Fixes bugs in lambda-lifting (incorrect de Bruijn indices in the types
of added binders).
* Fixes several other bugs in the compilation pipeline.
* Adds a separate EtaExpandApps transformation to avoid quadratic
runtime in the Internal-to-Core translation due to repeated calls to
etaExpandApps.
* Changes Internal-to-Core to avoid generating matches on values which
don't have an inductive type.

---------

Co-authored-by: Paul Cadman <git@paulcadman.dev>
Co-authored-by: janmasrovira <janmasrovira@gmail.com>
2023-03-14 16:24:07 +01:00

126 lines
3.2 KiB
Haskell

module Commands.Dev.Options
( module Commands.Dev.Options,
module Commands.Dev.Asm.Options,
module Commands.Dev.Core.Options,
module Commands.Dev.Geb.Options,
module Commands.Dev.Internal.Options,
module Commands.Dev.Parse.Options,
module Commands.Dev.Highlight.Options,
module Commands.Dev.Scope.Options,
module Commands.Dev.Termination.Options,
module Commands.Dev.DisplayRoot.Options,
)
where
import Commands.Dev.Asm.Options hiding (Compile)
import Commands.Dev.Core.Options
import Commands.Dev.DisplayRoot.Options
import Commands.Dev.Geb.Options
import Commands.Dev.Highlight.Options
import Commands.Dev.Internal.Options
import Commands.Dev.Parse.Options
import Commands.Dev.Runtime.Options
import Commands.Dev.Scope.Options
import Commands.Dev.Termination.Options
import CommonOptions
data DevCommand
= DisplayRoot RootOptions
| Highlight HighlightOptions
| Internal InternalCommand
| Core CoreCommand
| Geb GebCommand
| Asm AsmCommand
| Runtime RuntimeCommand
| Parse ParseOptions
| Scope ScopeOptions
| Termination TerminationCommand
deriving stock (Data)
parseDevCommand :: Parser DevCommand
parseDevCommand =
hsubparser
( mconcat
[ commandHighlight,
commandInternal,
commandCore,
commandGeb,
commandAsm,
commandRuntime,
commandParse,
commandScope,
commandShowRoot,
commandTermination
]
)
commandHighlight :: Mod CommandFields DevCommand
commandHighlight =
command "highlight" $
info
(Highlight <$> parseHighlight)
(progDesc "Highlight a Juvix file")
commandInternal :: Mod CommandFields DevCommand
commandInternal =
command "internal" $
info
(Internal <$> parseInternalCommand)
(progDesc "Subcommands related to Internal")
commandGeb :: Mod CommandFields DevCommand
commandGeb =
command "geb" $
info
(Geb <$> parseGebCommand)
(progDesc "Subcommands related to JuvixGeb")
commandCore :: Mod CommandFields DevCommand
commandCore =
command "core" $
info
(Core <$> parseCoreCommand)
(progDesc "Subcommands related to JuvixCore")
commandAsm :: Mod CommandFields DevCommand
commandAsm =
command "asm" $
info
(Asm <$> parseAsmCommand)
(progDesc "Subcommands related to JuvixAsm")
commandRuntime :: Mod CommandFields DevCommand
commandRuntime =
command "runtime" $
info
(Runtime <$> parseRuntimeCommand)
(progDesc "Subcommands related to the Juvix runtime")
commandParse :: Mod CommandFields DevCommand
commandParse =
command "parse" $
info
(Parse <$> parseParse)
(progDesc "Parse a Juvix file")
commandScope :: Mod CommandFields DevCommand
commandScope =
command "scope" $
info
(Scope <$> parseScope)
(progDesc "Parse and scope a Juvix file")
commandShowRoot :: Mod CommandFields DevCommand
commandShowRoot =
command "root" $
info
(DisplayRoot <$> parseRoot)
(progDesc "Show the root path for a Juvix project")
commandTermination :: Mod CommandFields DevCommand
commandTermination =
command "termination" $
info
(Termination <$> parseTerminationCommand)
(progDesc "Subcommands related to termination checking")