Commit graph

650 commits

Author SHA1 Message Date
Folkert
76a118db14
fix needles cloning of ident_ids 2022-03-08 23:53:57 +01:00
Folkert
831a90e310
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-03-08 22:36:06 +01:00
Jan Van Bruggen
a2f2434d71 Rename hello-world to hello-c 2022-03-07 19:59:30 -07:00
Jan Van Bruggen
99c825aa99 Simplify example platform names 2022-03-07 19:59:29 -07:00
Folkert
836967b919
some other clippy things in tests 2022-03-06 19:07:38 +01:00
Folkert
de498a37ce
manually define min/max integer functions 2022-03-05 21:02:35 +01:00
Folkert
adf4ad22a5
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-03-05 20:55:15 +01:00
Folkert
a53a5b718e
clippy 2022-03-03 10:36:18 +01:00
Folkert
da89152fef
fix static assert 2022-03-03 08:32:32 +01:00
Folkert
38d3d3169a
drop final suffixes 2022-03-02 21:30:38 +01:00
Folkert
0eb98a4c59
move over constraint 2022-03-02 21:19:58 +01:00
Folkert
54c6292b4b
clippy 2022-03-02 20:59:51 +01:00
Folkert
289e1a7ae1
fix ordering bug 2022-03-02 20:57:55 +01:00
Folkert
c52029c2d1
the debugging begins 2022-03-02 20:30:42 +01:00
Folkert
19d7f7ce09
make vars-by-symbol a vector 2022-03-01 21:51:25 +01:00
Folkert
8b457a56c5
reduce cloning of Env 2022-03-01 00:08:56 +01:00
Folkert
9d82f795b7
make it abstract 2022-02-28 23:43:58 +01:00
Folkert
751ae125a5
remove aliases from solve Env 2022-02-28 23:41:07 +01:00
Folkert
c18befeccf
short-circuit aliases 2022-02-28 23:37:33 +01:00
Folkert
ba70909519
fix more tests 2022-02-28 22:23:11 +01:00
Folkert
db6b5bfd38
get Num to fully work again 2022-02-28 19:40:18 +01:00
Folkert
bd31503855
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-02-28 18:55:20 +01:00
Folkert
db1669154e
WIP 2022-02-27 21:53:56 +01:00
ayazhafiz
720b7b49d2 Improve error pattern and fix tests 2022-02-27 12:01:12 -05:00
Folkert
5c31234b24
stack overflow in Num type inference 2022-02-27 13:07:45 +01:00
Folkert
0107d78ea0
most of Num 2022-02-27 13:03:47 +01:00
ayazhafiz
34900c1f55 Address @rtfeldman review 2022-02-27 00:11:11 -05:00
Folkert
65b1b3fcce
just before Num 2022-02-26 23:11:40 +01:00
Folkert
c0d3543d5a
make Str + Result work 2022-02-26 17:52:24 +01:00
Brendan Hansknecht
6968647cc5 update versions to lockfile 2022-02-25 11:41:05 -08:00
Folkert
d1d7cfef44
reimplement Result 2022-02-23 17:52:13 +01:00
Folkert
410426f059
refactor 2022-02-23 13:00:06 +01:00
hafiz
ca9ecbea52
Merge pull request #2533 from rtfeldman/abilities!
[WIP] Spike for abilities and friends
2022-02-21 23:18:40 -05:00
ayazhafiz
90de82e295 Validation of opaques during canonicalization 2022-02-21 18:25:19 -05: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
ayazhafiz
fa24e51593 Parse opaque types 2022-02-19 18:38:31 -05:00
ayazhafiz
8ce81e4607 AliasHeader -> TypeHeader 2022-02-19 17:51:56 -05:00
Folkert
ae998e2504 Revert "DEBUG HACKS, DO NOT MERGE"
This reverts commit e95d32e821.
2022-02-16 15:08:10 +01:00
Folkert
95bfc3b342 cleanup 2022-02-16 15:01:43 +01:00
Folkert
ff26069295 use single-threaded stepper in multithreaded file.rs 2022-02-16 14:49:00 +01:00
Folkert
400598a013 cleanup 2022-02-16 14:35:07 +01:00
Folkert
599a0e5dc7 move things out of thread scope 2022-02-16 14:18:28 +01:00
Folkert
45217b8074 pick the single-threaded load when target-family=wasm 2022-02-16 14:18:14 +01:00
Brian Carroll
e95d32e821 DEBUG HACKS, DO NOT MERGE 2022-02-14 22:24:51 +00:00
Brian Carroll
3e511acbcc Fix Wasm compile errors 2022-02-14 21:10:45 +00:00
Folkert
e56a5695ba initial PoC 2022-02-14 21:50:09 +01:00
Folkert
04adbe75ca fix test compilation 2022-02-14 21:09:51 +01:00
Folkert
957140df64 remove builtin lookup function being passed around 2022-02-14 20:32:31 +01:00
Folkert
154d55985b move depencency tracking out of file.rs 2022-02-14 18:16:35 +01:00
Anton-4
d6681f4e0a
Merge pull request #2160 from rtfeldman/editor-comments
support tld comments in docs and editor(reading only)
2022-02-10 11:49:10 +01:00