Commit graph

248 commits

Author SHA1 Message Date
Ayaz Hafiz
c13abb03be
Check in mono test that works now
Closes #4561
2023-03-25 15:58:39 -05:00
Ayaz Hafiz
5069d926bb
Update mono tests 2023-03-23 10:18:04 -05:00
Ayaz
6b3f3ba1a1
Merge pull request #5167 from roc-lang/fix-closure-captures-recursive
Ensure that closures inside recursive closures capture correctly
2023-03-21 13:53:33 -04:00
Richard Feldman
2276c78d9f
Merge pull request #5093 from roc-lang/glue-getters-rtfeldman
Glue for functions and closures
2023-03-21 08:12:19 -04:00
Ayaz Hafiz
700d2d1b31
Check in mono golden 2023-03-21 07:18:12 -04:00
Ayaz Hafiz
e8a29d2df4
Ensure that closures inside recursive closures capture correctly
With a code like

```
thenDo = \x, callback ->
    callback x

f = \{} ->
    code = 10u16

    bf = \{} ->
        thenDo code \_ -> bf {}

    bf {}
```

The lambda `\_ -> bf {}` must capture `bf`. Previously, this would not
happen correctly, because we assumed that mutually recursive functions
(including singleton recursive functions, like `bf` here) cannot capture
themselves.

Of course, that premise does not hold in general. Instead, we should have
mutually recursive functions capture the closure (haha, get it) of
values captured by all functions constituting the mutual recursion.
Then, any nested closures can capture outer recursive closures' values
appropriately.
2023-03-20 17:44:59 -04:00
Seth Workman
29e0673308
update dict.txt 2023-03-17 11:33:39 -05:00
Anton-4
f1b1aa6a7b
Merge branch 'main' of github.com:roc-lang/roc into glue-getters-rtfeldman 2023-03-17 11:34:29 +01:00
Brendan Hansknecht
00a3d7b259
update mono tests 2023-03-15 16:44:02 -07:00
Luke Boswell
90dd31aaca
update mono 2023-03-15 18:24:16 +11:00
Brendan Hansknecht
9e2a36f1d4
update mono 2023-03-13 18:03:05 -07:00
Folkert
fdf1489df6
Merge remote-tracking branch 'origin/main' into glue-getters-rtfeldman 2023-03-14 01:01:26 +01:00
Folkert
3de3937553
disable a test that glue cannot handle 2023-03-13 21:30:12 +01:00
Brendan Hansknecht
85306953e9
update mono 2023-03-12 08:42:37 -07:00
Richard Feldman
512b9361bf
Merge pull request #5077 from lukewilliamboswell/builtin-json
JSON decoder improvements
2023-03-11 15:28:07 -05:00
Folkert
e9fc9dd3f9
update mono tests 2023-03-08 23:03:32 +01:00
Folkert
fe15a2e79c
Merge remote-tracking branch 'origin/main' into glue-getters-rtfeldman 2023-03-08 19:46:00 +01:00
Luke Boswell
5d321e354b
update mono 2023-03-07 17:28:04 +11:00
Brendan Hansknecht
f42f61e271
run a toml formatter and then clean it up a bit 2023-03-06 19:47:57 -08:00
Brendan Hansknecht
4a89bee0a5
centralize package versions except for vendor and excluded 2023-03-06 19:29:09 -08:00
Brendan Hansknecht
5485c8a5b0
update to using workspace package spec 2023-03-06 16:36:18 -08:00
Ayaz Hafiz
739bdfe64e
Fix a bug in chasing assigned/hole on switch 2023-03-05 22:19:16 -06:00
Ayaz Hafiz
7914b07a2f
Eliminate unneeded joinpoints in union lambda dispatches 2023-03-05 22:10:42 -06:00
Ayaz Hafiz
8e4de80aa9
Add test for enum lambda set elimination 2023-03-05 22:01:50 -06:00
Ayaz Hafiz
a2389c7652
Eliminate joinpoints in trivial lambda set switches 2023-03-05 21:59:01 -06:00
Ayaz Hafiz
7867ffb62b
Rename test 2023-03-05 21:47:06 -06:00
Ayaz Hafiz
fb5ac9fc6e
Check in failing reproduction for #5086 2023-03-05 21:40:10 -06:00
Folkert
d224992bc1
Merge remote-tracking branch 'origin/main' into glue-getters-rtfeldman 2023-03-05 17:24:05 +01:00
Luke Boswell
ac95c9a71a
update mono tests 2023-03-05 19:05:24 +11:00
Brendan Hansknecht
a86c8d7994
update mono tests 2023-02-27 16:36:08 -08:00
Folkert
454f3c603e
give the new exposed symbols to the surgical linker 2023-02-25 19:35:46 +01:00
Anton-4
4d91fe01ca
update mono tests 2023-02-24 14:35:05 +01:00
Folkert de Vries
34340de60c
Merge pull request #5020 from roc-lang/dev-unbox-u32
dev backend: reading and writing 32, 16 and 8-bit values
2023-02-21 17:33:21 +01:00
Ayaz Hafiz
fbc75016e1
Check in mono goldens 2023-02-20 19:31:22 -06:00
Ayaz Hafiz
d7a069675b
Lambda set compaction must preserve unique specializations of concrete types
There are times that multiple concrete types may appear in
unspecialized lambda sets that are being unified. The primary case is
during monomorphization, when unspecialized lambda sets join at the same
time that concrete types get instantiated. Since lambda set
specialization and compaction happens only after unifications are
complete, unifications that monomorphize can induce the above-described
situation.

In these cases,

- unspecialized lambda sets that are due to equivalent type variables
  can be compacted, since they are in fact the same specialization.
- unspecialized lambda sets that are due to different type variables
  cannot be compacted, even if their types unify, since they may point
  to different specializations. For example, consider the unspecialized
  lambda set `[[] + [A]:toEncoder:1 + [B]:toEncoder:1]` - this set wants
  two encoders, one for `[A]` and one for `[B]`, which is materially
  different from the set `[[] + [A, B]:toEncoder:1]`.
2023-02-20 18:50:07 -06:00
Folkert
aac8c76c5f
fix mono tests 2023-02-18 16:43:51 +01:00
Ayaz Hafiz
a3de22c88a
Do not fixup recursion pointers in non-recursive lambda sets
If a lambda set is non-recursive, but contains naked recursion pointers,
we should not fill those naked pointers in with the slot of the lambda
set during interning. Such naked pointers must belong to an encompassing
lambda set that is in fact recursive, and will be filled in later.

For example, `LambdaSet([Foo, LambdaSet(Bar, [<rec>])] as <rec>)` should
not have the inner lambda set's capture be filled in with itself.

Also, during reification of recursion pointers, we do not need to
traverse re-inserted lambda sets again, since they were just fixed-up.

Closes #5026
2023-02-13 17:14:04 -06:00
Joshua Warner
5a6be05ead
implement mono / lowering for tuples 2023-02-07 18:54:50 -08:00
Ayaz Hafiz
478d4a2d44
Support lambda sets with recursive pointers and their equivalence-checking 2023-01-25 17:57:49 -06:00
Ayaz Hafiz
0cd448eab4
Start ir-checking quicksort_help again
Closes #4694
2023-01-25 16:28:53 -06:00
Ayaz Hafiz
7754cc553c
Turn the ir-checker back on 2023-01-25 16:18:47 -06:00
Ayaz Hafiz
01ef3ffd02
Disable ir-check for now 2023-01-25 15:16:37 -06:00
Folkert de Vries
8e5efe67b4
Merge pull request #4912 from roc-lang/remove-polymorphic-expression-compilation
Rip out polymorphic expression compilation
2023-01-24 21:35:08 +01:00
Brian Carroll
a249e14ee5
builtins: restore nicer hash code for Dict 2023-01-23 22:39:24 +00:00
Ayaz Hafiz
d4e8fe81cb
Update mono tests 2023-01-21 12:37:10 -06:00
Ayaz Hafiz
f0ab9f77ca
Don't mark accessors as thunks 2023-01-21 12:37:09 -06:00
Ayaz Hafiz
36f8ed6478
Rip out polymorphic expression compilation
We no longer need this except for number literals, which are simple to
handle.
2023-01-21 12:37:09 -06:00
Ayaz Hafiz
52063b2df2
Add test to regression-test over-specialization as in #4717 2023-01-18 18:11:59 -06:00
Ayaz Hafiz
9a4e4f25c2
Add regression tests for #4772
Closes #4772
2023-01-18 18:11:57 -06:00
Ayaz Hafiz
e6ab8dcf60
Fix mono test 2023-01-18 10:06:14 -06:00