Commit graph

205 commits

Author SHA1 Message Date
Bryce Miller
0132df9b5a
merge main 2023-06-10 15:04:25 -04:00
Luke Boswell
15b7b62c4f
merge remote/main, fix merge conflicts, update mono 2023-06-08 19:41:53 +10:00
Bryce Miller
e463ccf4a6
merge main 2023-06-07 20:36:54 -04:00
Ayaz
c7f5007cd8
Merge pull request #5400 from roc-lang/semantic-layouts-for-newtypes
Implement semantic layouts for newtypes
2023-06-07 05:39:20 -05:00
Ayaz Hafiz
43259b9ad6
Compile dbgs that appear in expects
Closes #5480
2023-06-06 18:07:34 -05:00
Ayaz Hafiz
4e690103b0
Use larger stacks for some mono tests 2023-06-06 16:05:12 -05:00
Bryce Miller
cb08225bf0
| -> where 2023-06-05 20:19:00 -04:00
Luke Boswell
c1ff49be6c
change just Json module name 2023-06-04 17:37:01 +10:00
Bryce Miller
7e8a151604
Merge branch 'main' into abilities-syntax 2023-06-01 12:57:16 -04:00
J.Teeuwissen
93ea086115
Merge branch 'main' into record-update-index-top 2023-05-30 10:47:19 +02:00
Bryce Miller
ffa622e065
Merge branch 'main' into abilities-syntax
Signed-off-by: Bryce Miller <sandprickle@users.noreply.github.com>
2023-05-29 13:42:36 +02:00
J.Teeuwissen
8f022d4310
fixed specialisation box 2023-05-28 21:18:28 +02:00
J.Teeuwissen
d988ab5378
newlines 2023-05-28 20:09:43 +02:00
J.Teeuwissen
6e6e1ce833
Merge remote-tracking branch 'origin/main' into save-construction-children 2023-05-28 20:08:22 +02:00
J.Teeuwissen
378a298b45
move record index to start of update 2023-05-27 14:42:37 +02:00
J.Teeuwissen
b0705a00ad
saved info and added test 2023-05-26 15:56:18 +02:00
Bryce Miller
91e37293a2
abilities syntax has -> implements 2023-05-24 21:29:38 -04:00
J.Teeuwissen
d7304f86e5
allow lowlevel and match 2023-05-24 16:13:24 +02:00
David Smith
7f1a242a7c
Disable some tests in debug failing with stack overflow 2023-05-17 16:33:59 -04:00
Richard Feldman
a6bda6eccf
Merge pull request #5163 from lukewilliamboswell/builtin-json
More tests and updates for Json builtin
2023-05-15 19:08:54 -04:00
Luke Boswell
4d4cfcf981
merge remote/main and update mono tests 2023-05-15 16:51:56 +10:00
J.Teeuwissen
ec731443c4
moved drop specialization up 2023-05-15 00:53:07 +02:00
J.Teeuwissen
d82f3ee09d
Start reuse similar layouts 2023-05-15 00:51:33 +02:00
Ayaz Hafiz
155375062a
Fmt 2023-05-02 10:52:49 -05:00
Ayaz
19c04c69c0
Merge branch 'main' into i5318
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2023-05-01 18:47:56 -05:00
Ayaz Hafiz
a9975b1f7f
Crash at runtime rather than panicking when if condition is erroneous
Closes #5318
2023-05-01 15:48:05 -05:00
Ayaz Hafiz
1916a6dba5
Add mono test for #4770
Closes #4770
2023-05-01 13:14:59 -05:00
Folkert
a332d77756
reinstate test 2023-04-28 22:03:08 +02:00
Luke Boswell
4f22b0747f
mono and update Json.fromUtf8 and Json.toUtf8 to Json.json 2023-04-21 10:57:48 +10:00
Ayaz Hafiz
247913dc20
Record all nested recursive structures an entry in the layout cache contains
If an entry in the layout cache contains recursive structures, the entry
is not reusable if the recursive structure is currently in the "seen"
set. The example elucidated in the source code is as follows:

Suppose we are constructing the layout of

```
[A, B (List r)] as r
```

and we have already constructed and cached the layout of `List r`, which would
be

```
List (Recursive [Unit, List RecursivePointer])
```

If we use the cached entry of `List r`, we would end up with the layout

```
Recursive [Unit, (List (Recursive [Unit, List RecursivePointer]))]
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cached layout for `List r`
```

but this is not correct; the canonical layout of `[A, B (List r)] as r` is

```
Recursive [Unit, (List RecursivePointer)]
```

However, the current implementation only preserves this behavior for
structures that contain one recursive structure under them. In practice,
there can be structures that contain multiple recursive structures under
them, and we must be sure to record all those structures in the
layout-cache.
2023-03-30 18:15:35 -05:00
Ayaz Hafiz
2a9e0583bc
Remove inaccurate debug assertion in IR gen
There might be more symbols than field layouts when restructuring a
record if the record is a newtype.

Closes #4759
2023-03-28 15:06:44 -05:00
Ayaz Hafiz
3f532df981
Generate code for recursive nullable wrapped lambda sets 2023-03-27 10:11:49 -05:00
Ayaz Hafiz
b8a0ff8e7c
Add a mono test for recursive lambda sets with late specialization 2023-03-27 10:11:26 -05:00
Richard Feldman
72530916e5
Merge pull request #5204 from roc-lang/i4561
Check in mono test that works now
2023-03-25 21:58:16 -04:00
Ayaz Hafiz
aef21741ec
Update mono tests 2023-03-25 16:14:30 -05:00
Ayaz Hafiz
c13abb03be
Check in mono test that works now
Closes #4561
2023-03-25 15:58:39 -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
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
Folkert
3de3937553
disable a test that glue cannot handle 2023-03-13 21:30:12 +01:00
Folkert
fe15a2e79c
Merge remote-tracking branch 'origin/main' into glue-getters-rtfeldman 2023-03-08 19:46:00 +01: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
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
454f3c603e
give the new exposed symbols to the surgical linker 2023-02-25 19:35:46 +01: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
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