An implementation of the translation from JuvixCore to JuvixAsm. After
merging this PR, the only remaining step to complete the basic
compilation pipeline (#1556) is the compilation of complex pattern
matching (#1531).
* Fixes several bugs in lambda-lifting.
* Fixes several bugs in the RemoveTypeArgs transformation.
* Fixes several bugs in the TopEtaExpand transformation.
* Adds the ConvertBuiltinTypes transformation which converts the builtin
bool inductive type to Core primitive bool.
* Adds the `juvix dev core strip` command.
* Adds the `juvix dev core asm` command.
* Adds the `juvix dev core compile` command.
* Adds two groups of tests:
- JuvixCore to JuvixAsm translation: translate JuvixCore tests to
JuvixAsm and run the results with the JuvixAsm interpreter,
- JuvixCore compilation: compile JuvixCore tests to native code and WASM
and execute the results.
* Closes#1520
* Closes#1549
* Fixes#1678.
* Adds the `clean-juvix-build` Makefile target, which removes all
`.juvix-build` directories in the project (necessary to do after
changing the standard library).
* Depends on PR #1688. The tests go through without merging this PR, but
it's a bug. The present PR requires the possibility to use the
`terminating` keyword with the `div` built-in, which possibility is
provided by PR #1688.
This PR implements `printString` and `printBool` builtins for the legacy
C backend. Previously IO for strings was done using compile blocks with
included C code.
Fixes https://github.com/anoma/juvix/issues/1696
* Support inductive type and universe expressions
* Support function type expressions
* Add type information to Core function and constructor nodes
* Remove unused do
* Add shelltests for `juvix repl`
* repl: Compute entrypoint root when loading a file
Previously the REPL would use app root (which could be the current
directory or the project root of the initially loaded file). Thus files
in a different project could not be loaded.
The entrypoint root must be computed each time a new file is `:load`ed.
Adds shell-tests for REPL commands
* Move preludePath to Juvix.Extra.Paths
```
builtin boolean-if
if : {A : Type} → Bool → A → A → A;
if true x _ := x;
if false _ x := x;
```
This allows a backend to translate if directly, so that only one branch
is evalutated.
An example compilation of if is given for the legacy backend for testing.
builtin boolean
inductive MyBool {
myTrue : Bool;
myFalse : Bool;
};
The first constructor is mapped to primitive true and the second
constructor is mapped to primitive false.
This also adds compilation of builtin boolean in the legacy backend as
this was trivial to implement.
* remove ≔ from the language and replace it by :=
* revert accidental changes in juvix input mode
* update stdlib submodule
* rename ℕ by Nat in the tests and examples
* fix shell tests