1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-30 19:14:46 +03:00
juvix/app/Commands/Dev/Core
janmasrovira 90a7a5e7e0
Fix REPL state to include enough information to rerun the pipeline (#1911)
Previously we were:
* discarding the types table 
* discarding the name ids state
after processing an expression in the REPL.

For example evaluating:
```
let even : _; odd : _; odd zero := false; odd (suc n) := not (even n); even zero := true; even (suc n) := not (odd n) in even 10
```
would loop in the REPL.

We noticed that the `n` in `suc n` was being given type `Type` instead
of `Nat`. This was because the name id given to n was incorrect, the
REPL started using name ids from 0 again.

We fixed this issue by storing information, including the types table
and name ids state in the Artifacts data structure that is returned when
we run the pipeline for the first time. This information is then used
when we call functions to compile / type check REPL expressions.

---------

Co-authored-by: Paul Cadman <git@paulcadman.dev>
2023-03-30 13:39:27 +02:00
..
Asm JuvixCore to JuvixAsm translation (#1665) 2023-01-09 18:21:30 +01:00
Compile Pattern matching compilation (#1874) 2023-03-27 10:42:27 +02:00
Eval Option --show-args-num (#1946) 2023-03-30 12:23:40 +01:00
FromConcrete Option --show-args-num (#1946) 2023-03-30 12:23:40 +01:00
Read Option --show-args-num (#1946) 2023-03-30 12:23:40 +01:00
Repl Option --show-args-num (#1946) 2023-03-30 12:23:40 +01:00
Strip JuvixCore to JuvixAsm translation (#1665) 2023-01-09 18:21:30 +01:00
Asm.hs Pattern matching compilation (#1874) 2023-03-27 10:42:27 +02:00
Compile.hs New compilation pipeline (#1832) 2023-03-14 16:24:07 +01:00
Eval.hs Parse JuvixCore with absolute paths (#1770) 2023-01-26 11:55:06 +00:00
FromConcrete.hs Pattern matching compilation (#1874) 2023-03-27 10:42:27 +02:00
Options.hs New compilation pipeline (#1832) 2023-03-14 16:24:07 +01:00
Read.hs Pattern matching compilation (#1874) 2023-03-27 10:42:27 +02:00
Repl.hs Fix REPL state to include enough information to rerun the pipeline (#1911) 2023-03-30 13:39:27 +02:00
Strip.hs Pattern matching compilation (#1874) 2023-03-27 10:42:27 +02:00