Commit graph

59 commits

Author SHA1 Message Date
Ayaz Hafiz
bde107da49
Remove TagName in favor of explicit TagName or Closure
Note that we still need a `TagOrClosure` enum for phases past mono, but
at least we get rid of the branches in the front end.
2022-06-02 09:44:34 -05:00
Richard Feldman
971ffa2b38
Update repl to use new formatting 2022-05-22 22:12:50 -04:00
Richard Feldman
dd460fb818
Use single-threaded builds in tests 2022-05-05 14:42:36 -04:00
Richard Feldman
4fad750e52
clip clop clip clop clip clop 2022-05-03 14:57:47 -04:00
Richard Feldman
2e6047fa9a
Use into_inner over as_inner 2022-05-03 14:26:03 -04:00
Richard Feldman
b14c9071f0
Drop an unnecessary hash map 2022-05-03 14:22:22 -04:00
Richard Feldman
b3d09c9346
Avoid some allocations in repl_eval 2022-05-03 14:22:22 -04:00
Ayaz Hafiz
89757dc31f Remove MonoProblem 2022-04-28 20:34:04 -04:00
Richard Feldman
85e7969c2d
Replace references to "global tag" with "tag" 2022-04-25 17:04:34 -04:00
Ayaz Hafiz
cf8409dfaa
Remove private tag variants 2022-04-25 11:38:54 -04:00
Ayaz Hafiz
1ed9cf551a
Remove private tags from Ast 2022-04-25 11:20:37 -04:00
Ayaz Hafiz
b6383f81ee
Numbers are opaques 2022-04-25 10:59:42 -04:00
Ayaz Hafiz
5dfe44c72d
Render nullable wrapped tag unions that pass through aliases 2022-04-22 17:57:01 -04:00
Jared Cone
1ee2f85f9e
Exclude filename from repl reports. 2022-04-21 22:44:07 -07:00
Ayaz Hafiz
ce7c61eb09
Propogate render target forward 2022-04-12 16:18:07 -04:00
Folkert
311e464b70
add load_internal 2022-03-23 15:18:22 +01:00
Folkert
d8fa2b8d92
stop passing stdlib (use lazy_static) 2022-03-22 19:53:02 +01:00
Brian Carroll
68222dfd50 repl: apply the relevant style codes in each REPL (web and terminal) 2022-03-17 09:46:52 +00:00
ayazhafiz
4c06b9d1a4 Redundant reference 2022-03-13 19:06:37 -05:00
ayazhafiz
ec4bb9ad83 Support boxes in repl
Closes #2712
2022-03-13 18:44:38 -05:00
ayazhafiz
fe1cbc2261 Print i8s correctly in repl
Closes #2710
2022-03-13 18:44:38 -05:00
Folkert
e3e9215578
Merge remote-tracking branch 'origin/trunk' into type-checking-storage-subs 2022-03-12 14:10:43 +01:00
Folkert
c79ecec56e
make SubsByModule opaque 2022-03-11 20:16:55 +01:00
Folkert
6543c9bbc6
Merge remote-tracking branch 'origin/trunk' into box-all-the-things 2022-03-09 00:00:15 +01:00
Folkert
92f2927046
initial implementation 2022-03-08 19:09:42 +01:00
Derek Gustafson
ba6b225761
Hide RocDec implemntation details. 2022-03-07 15:34:02 -05:00
Folkert
f708811250
move variable definition before macro that captures it 2022-03-06 00:50:41 +01:00
Derek Gustafson
f2de6baa36
Add functionality to turn RocDecs into strings. 2022-03-05 17:28:12 -05:00
Derek Gustafson
a021c09752
Implement RocDec to [u8] algorithm. 2022-03-04 22:52:13 -05:00
Derek Gustafson
dc92de7781
Add plumbing for displaying RocDec in the repl. 2022-03-04 17:32:09 -05:00
Brian Carroll
dcf3c052af
Merge pull request #2594 from rtfeldman/wasm-repl-fixes
Wasm REPL bug fixes
2022-02-27 18:40:47 +00:00
ayazhafiz
75cef24ee0 Fix repl compile after rebase 2022-02-27 00:14:05 -05:00
ayazhafiz
059c324268 Error reporting for type mismatches involving opaques 2022-02-27 00:10:12 -05:00
Brian Carroll
c6a9b900ca Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-repl-fixes 2022-02-26 22:14:13 +00:00
ayazhafiz
6e555e428d Use correct layouts when rendering records
Closes #2588
2022-02-26 15:53:16 -05:00
ayazhafiz
4742847ba9 Wrap content that is unwrapped and passes through a type alias correctly
Closes #2592
2022-02-26 15:08:27 -05:00
Brian Carroll
3537f90e6d repl: get Str working properly in CLI and Wasm REPLs 2022-02-26 13:12:52 +00:00
Brendan Hansknecht
6968647cc5 update versions to lockfile 2022-02-25 11:41:05 -08:00
ayazhafiz
e52d427ac8 Hash record field name order in generated layouts
Closes #2535

See the referenced issue for longer discussion - here's the synopsis.
Consider this program

```
app "test" provides [ nums ] to "./platform"

alpha = { a: 1, b: 2 }

nums : List U8
nums =
    [
        alpha.a,
        alpha.b,
    ]
```

Here's its IR:

```
procedure : `#UserApp.alpha` {I64, U8}
procedure = `#UserApp.alpha` ():
    let `#UserApp.5` : Builtin(Int(I64)) = 1i64;
    let `#UserApp.6` : Builtin(Int(U8)) = 2i64;
    let `#UserApp.4` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = Struct {`#UserApp.5`, `#UserApp.6`};
    ret `#UserApp.4`;

procedure : `#UserApp.nums` List U8
procedure = `#UserApp.nums` ():
    let `#UserApp.7` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = CallByName `#UserApp.alpha`;
    let `#UserApp.1` : Builtin(Int(U8)) = StructAtIndex 1 `#UserApp.7`;
    let `#UserApp.3` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = CallByName `#UserApp.alpha`;
    let `#UserApp.2` : Builtin(Int(U8)) = StructAtIndex 1 `#UserApp.3`;
    let `#UserApp.0` : Builtin(List(Builtin(Int(U8)))) = Array [`#UserApp.1`, `#UserApp.2`];
    ret `#UserApp.0`;
```

What's happening is that we need to specialize `alpha` twice - once for the
type of a narrowed to a U8, another time for the type of b narrowed to a U8.

We do the specialization for alpha.b first - record fields are sorted by
layout, so we generate a record of type {i64, u8}. But then we go to
specialize alpha.a, but this has the same layout - {i64, u8} - so we reuse
the existing one! So (at least for records), we need to include record field
order associated with the sorted layout fields, so that we don't reuse
monomorphizations like this incorrectly!
2022-02-21 14:10:45 -05:00
Folkert
957140df64 remove builtin lookup function being passed around 2022-02-14 20:32:31 +01:00
Brian Carroll
3c6cb5bc19 repl: Separate traits for the app and its memory 2022-02-08 11:03:48 +00:00
Brian Carroll
1528651a5a repl: explicit lifetimes for app 2022-02-08 11:03:48 +00:00
Brian Carroll
fdf8363b7e repl: Separate app from env 2022-02-08 11:03:48 +00:00
ayazhafiz
364d2585df Fix repl tests 2022-02-06 15:04:12 -05:00
Brian Carroll
8df69d856c repl: update a comment 2022-02-03 12:08:32 +00:00
Brian Carroll
5904bb05ad repl: remove unused dependencies from roc_repl_eval 2022-02-03 09:30:04 +00:00
Brian Carroll
eb1a16d429 repl: fix tests 2022-02-03 00:27:33 +00:00
Brian Carroll
b317e05187 repl: formatting and Clippy 2022-02-03 00:02:12 +00:00
Brian Carroll
9ace2fd9a3 repl: delete app_memory and put "external memory" logic into repl_wasm 2022-02-02 23:08:12 +00:00
Brian Carroll
fdea13ac55 repl: thread the ReplApp through the evaluator 2022-02-02 22:54:18 +00:00