1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-11 08:25:46 +03:00
Commit Graph

708 Commits

Author SHA1 Message Date
Łukasz Czajka
57a6a7ebec
Fix 'not a primitive type' error message (#1648) 2022-11-30 15:26:44 +00:00
Paul Cadman
3fbf9a3020
Use the same stack version in all CI jobs and remove stack setup step (#1651)
* Remove `stack setup` step as this was only required for macOS

* Use haskell setup action so same version of stack is used in tests and build
2022-11-30 14:58:01 +00:00
janmasrovira
ebfe412d6f
Auto complete argument of 'dev core read -t' (#1616)
autocomplete transformation list in 'dev core read -t'
2022-11-14 16:29:48 +00:00
janmasrovira
169155690b
Eta expansion at the top of each core function definition (#1481) (#1571) 2022-11-14 16:03:28 +01:00
Paul Cadman
d1ec8926c4
Add an emacs function to restart the REPL (#1618) 2022-11-14 09:38:07 +00:00
Paul Cadman
b541972d03
Add types to Core functions and constructors when translating from Internal (#1617)
* Support inductive type and universe expressions

* Support function type expressions

* Add type information to Core function and constructor nodes

* Remove unused do
2022-11-11 12:38:48 +00:00
Paul Cadman
df4036d600
Compute new entrypoint root when loading a file in the REPL (#1615)
* 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
2022-11-10 11:26:38 +00:00
Paul Cadman
3c9f27dbbf
Add docs for installing the linux binary (#1599) 2022-11-09 20:11:23 +01:00
Łukasz Czajka
d1937ddfa5
Compute maximum runtime stack height in JuvixReg (#1613)
compute max stack height
2022-11-09 18:49:24 +00:00
Paul Cadman
6d66d0ab13
Add juvix-repl-mode for emacs (#1612)
* Adds a major mode for juvix-repl

* juvix-mode: C-c C-l loads file into REPL, if the REPL is running

* Detect ANSI support in Emacs REPL / shell by using hSupportsANSIColor API

* Disable comint echo handling. Juvix REPL does not echo

* repl: whitespace strip input to compile/eval/infer commands
2022-11-09 16:36:40 +01:00
janmasrovira
aa00d34c8c
Make lambda lifting correct when free variables occur in the types of binders (#1609) 2022-11-09 13:25:00 +01:00
Łukasz Czajka
9d4f843262
Precompute maximum heap allocation (#1608) 2022-11-08 13:42:40 +01:00
Łukasz Czajka
0081715747
Use StackInfo and recurseS in the JuvixAsm to JuvixReg translation. (#1610) 2022-11-08 10:45:08 +01:00
Paul Cadman
42081205d3
Remove shelltest threading (#1611)
`juvix` CLI invocations now read/write/delete the standard library in
the project's `.juvix-build/stdlib` directory.

When shelltest runs in threaded mode, two tests may run conflicting IO
operations on the same `.juvix-build/stdlib` directory.
2022-11-08 09:28:17 +01:00
Paul Cadman
5d0123beba
Improvements to Juvix REPL (#1607)
* REPL support reloading

* Reformat :help and add :version command

* repl: Display the currently loaded module in the banner

* repl: Load the Prelude at launch unless --no-prelude or --no-stdlib are set
2022-11-07 17:43:30 +00:00
Łukasz Czajka
0d90a61a98
Compute JuvixAsm stack usage info (#1604) 2022-11-07 15:15:43 +01:00
Paul Cadman
a3b2aa6940
Add translation from Internal to Core (#1567) 2022-11-07 14:47:56 +01:00
Łukasz Czajka
6adf5ed20a
Fix discrepancy between Juvix and WASM pages (#1605) 2022-11-04 13:32:29 +01:00
Murray
5cea26ac7f
Improve As-Pattern parsing (#1603)
* Allow naming nullary constructors without using parentheses
* Negative test cases
2022-11-03 10:02:22 +01:00
Łukasz Czajka
74bfe592f5
Juvix C runtime (#1580) 2022-11-03 09:38:09 +01:00
janmasrovira
23c2b9e713
Juvix core recursors should descend into nodes stored in infos (#1600) 2022-11-02 14:06:40 +01:00
janmasrovira
59e6712452
Binder refactor (#1598) 2022-10-28 15:40:09 +02:00
Murray
13a1dad107
As-patterns (#1576) 2022-10-27 12:17:03 +02:00
Jonathan Cubides
17e3a37203 Update Changelog v0.2.6 🎉 2022-10-26 00:01:23 +02:00
Paul Cadman
509e9e54fd
Update language reference to match current state of Juvix (#1594)
* docs: ℕ to Nat

* docs: Add emacs goto definition

* Document juvix-format-buffer and add emacs keybinding

* docs: replace ghc with c in compile block examples

* Update CLI documentation

* doc: replace ↦ and → with ->
2022-10-24 10:44:05 +02:00
janmasrovira
b02f2f8e82
Letrec lifting (#1579) 2022-10-21 19:13:06 +02:00
Paul Cadman
9e7a8a98d4
Support go to definition for the standard library (#1592)
* Remove ParserParams

ParserParams is only used to record the root of the project, which is
used to prefix source file paths. However source file paths are always
absolute so this is not required.

* Add GetAbsPath to Files effect

The Files effect is not responsible for resolving a relative module
path into an absolute path on disk. This will allow us to resolve
relative module paths to alternative paths, for example to point to the
standard library on disk.

* Files effect getAbsPath returns paths within the registered standard
library

This means that the standard library can exist on disk at a different
location to the Juvix project.

A command line flag --stdlib-path can be specified to point to a
standard library, otherwise the embedded standard library is written to
disk at $PROJ_DIR/.juvix-build/stdlib and this is used instead.

* Recreate stdlib dir only when juvix version changes

* Add UpdateStdlib to the Files effect

* Add comment for stdlibOrFile

* Remove spurious import
2022-10-19 15:55:16 +01:00
janmasrovira
1e44226328
Fix letrec printing (#1591) 2022-10-18 20:02:31 +02:00
Łukasz Czajka
8f759635ca
JuvixReg (#1551) 2022-10-18 19:36:39 +02:00
janmasrovira
2062d3d8e5
Properly newline expressions in the pretty printer (#1581) 2022-10-18 17:38:31 +02:00
Paul Cadman
b549855986
Update stdlib submodule with builtin changes (#1589) 2022-10-17 09:35:27 +02:00
Paul Cadman
504b5ec799
Rename builtin natural to nat and boolean to bool (#1588) 2022-10-14 18:42:03 +02:00
Łukasz Czajka
93d5bdcd25
Improve the test for eta-expansion of constructors and builtins (#1583) 2022-10-14 13:25:49 +02:00
Paul Cadman
be9872ea06
Add builtin if (#1585)
```
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.
2022-10-14 10:06:05 +01:00
Łukasz Czajka
80783cfa3c
Parse optional type info in JVC files (#1575) 2022-10-13 16:54:51 +02:00
Paul Cadman
be5e2b9f2a
Add builtin boolean (#1582)
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.
2022-10-13 14:03:49 +01:00
janmasrovira
d7e208aac1
1569 rewrite the test for lambda lifting to use evaluation (#1572) 2022-10-12 10:19:02 +02:00
janmasrovira
fc75660774
Add softlines between applications and hang definitions (#1578)
add softlines between applications and hang definitions
2022-10-06 11:56:33 +11:00
Łukasz Czajka
f4ca940c7a
Fix symbol numbering bug (#1574) 2022-10-04 17:06:51 +02:00
janmasrovira
57446c67fe
Keywords refactor (#1566)
* refactor keywords wip

* add backslash to reserved symbols

* remove comment

* remove dead code

* add keywordHasReserved field

* format
2022-10-04 11:06:52 +11:00
Łukasz Czajka
a39ebf92f6
Remove lambda from reservedSymbols (#1568) 2022-09-30 12:32:17 +02:00
janmasrovira
803d2008d9
remove ≔ from the language and replace it by := (#1563)
* 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
2022-09-30 10:55:32 +10:00
Łukasz Czajka
f0ade4be7c
JuvixAsm (#1432) 2022-09-29 17:44:55 +02:00
janmasrovira
9f80d17fd2
Mutual inference (#1543) 2022-09-26 19:14:17 +02:00
janmasrovira
6a35db7475
Properly handle top lambdas in the termination checker (#1544) 2022-09-26 16:03:36 +02:00
Murray
84aabe81c1
Remove duplicate function in concrete analysis (#1550) 2022-09-26 14:58:22 +02:00
janmasrovira
13b038b5a1
Fix arity checker bug (#1546) 2022-09-26 14:39:37 +02:00
janmasrovira
41ef5f6219
Add lambda expressions to internal and add typechecking support (#1538) 2022-09-23 15:43:18 +02:00
janmasrovira
9aa045f3aa
Evaluator minor style refactor (#1547) 2022-09-23 14:39:21 +02:00
janmasrovira
5797133011
Add some labels to the parser (#1535) 2022-09-16 11:02:33 +02:00