Commit graph

33 commits

Author SHA1 Message Date
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
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
92f2927046
initial implementation 2022-03-08 19:09:42 +01:00
Folkert
f708811250
move variable definition before macro that captures it 2022-03-06 00:50:41 +01: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
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
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
b317e05187 repl: formatting and Clippy 2022-02-03 00:02:12 +00:00
Brian Carroll
fdea13ac55 repl: thread the ReplApp through the evaluator 2022-02-02 22:54:18 +00:00
Brian Carroll
881e43336c repl: rename jit function for dynamic size and change its doc comment 2022-02-02 21:36:28 +00:00
Brian Carroll
87886e2e6b repl: implement string evaluation for 32-bit platforms 2022-02-02 15:23:47 +00:00
Brian Carroll
4994b0ef1b repl: replace LLVM jit macros with functions 2022-02-02 15:06:04 +00:00
Brian Carroll
ad4318f1ff Merge branch 'trunk' of github.com:rtfeldman/roc into repl-packages 2022-02-01 11:16:37 +00:00
Brian Carroll
bbe82fcf25 repl: refactor LLVM-specific code under an optional Cargo feature 2022-02-01 11:15:37 +00:00
Brian Carroll
f098c6cb99 repl: initial working version with new crate structure 2022-01-30 09:12:29 +00:00
Renamed from repl-eval/src/eval.rs (Browse further)