Commit graph

302 commits

Author SHA1 Message Date
Folkert
4a1ade65fe
update mono tests: procs generated by glue are now no longer generated 2023-04-21 20:59:35 +02:00
Luke Boswell
4f22b0747f
mono and update Json.fromUtf8 and Json.toUtf8 to Json.json 2023-04-21 10:57:48 +10:00
Folkert de Vries
8c32900e19
Merge pull request #5275 from wontem/abs_diff
Implement Num.absDiff
2023-04-20 14:02:02 +02:00
Luke Boswell
ab4ac1c494
merge remote/main and update mono 2023-04-20 07:55:18 +10:00
J.Teeuwissen
36e83fca1c
updated tests 2023-04-16 16:34:41 +02:00
J.Teeuwissen
5f7f9b766b
inline lowlevel in rc 2023-04-13 12:26:05 +02:00
Kiryl Dziamura
7752d8dab5
Update mono IR snapshots 2023-04-12 16:15:50 +02:00
Luke Boswell
c7b8bc09f4
mono 2023-04-12 17:38:48 +10:00
Luke Boswell
9e0bc60056
mono 2023-04-11 20:12:44 +10:00
J.Teeuwissen
705ad1c796
symbol_to_doc 2023-04-09 09:43:52 +02:00
J.Teeuwissen
5a6ac082f0
Updated test 2023-04-06 18:14:04 +02:00
J.Teeuwissen
a8bd20da5c
Updated tests 2023-04-05 21:09:42 +02:00
Luke Boswell
dc43290647
Merge branch 'main' into builtin-json 2023-04-04 17:21:08 +10:00
Richard Feldman
7af55bafe6
Merge pull request #5224 from roc-lang/str-docs
Expand some `Str` docs
2023-04-02 09:49:16 -04: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
Richard Feldman
f6f201f1d3
Update mono tests 2023-03-29 21:23:14 -04:00
Luke Boswell
addc4debef
merge main, update fail test descriptions 2023-03-29 10:01:38 +11: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
Luke Boswell
e7e6978b0b
Merge remote-tracking branch 'remote/main' into builtin-json 2023-03-28 17:23:50 +11: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
Luke Boswell
3fbfdc3e4a
remove expect assertion to satisfy mono, update mono 2023-03-26 20:46:23 +11:00
Luke Boswell
e73720605a
mono 2023-03-26 20:39:20 +11: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
18ee5d497c
Fix mono tests 2023-03-25 16:15:09 -05:00
Ayaz Hafiz
aef21741ec
Update mono tests 2023-03-25 16:14:30 -05:00
Ayaz Hafiz
dd55be6142
Handle guards that appear multiple times in a compiled decision tree
Suppose we have a when expression

```
15 if foo -> <b1>
b  if bar -> <b2>
_         -> <b3>
```

that may have a decision tree like

```
15?
  \true => foo?
              \true  => <b1>
              \false => bar?
                           \true  => <b2>
                           \false => <b3>
  \false => bar?
               \true  => <b2>
               \false => <b3>
```

In this case, the guard "bar?" appears twice in the compiled decision
tree. We need to materialize the guard expression in both locations in
the compiled tree, which means we cannot as-is stamp a compiled `bar?`
twice in each location. The reason is that

- the compiled joinpoint for each `bar?` guard needs to have a unique ID
- the guard expression might have call which needs unique call spec IDs,
  or other joins that need unique joinpoint IDs.

So, save the expression as we build up the decision tree and materialize
the guard each time we need it. In practice the guards should be quite
small, so duplicating should be fine. We could avoid duplication, but
it's not clear to me how to do that exactly since the branches after the
guard might end up being different.
2023-03-25 16:14:21 -05:00
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
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
Brendan Hansknecht
85306953e9
update mono 2023-03-12 08:42:37 -07:00
Folkert
e9fc9dd3f9
update mono tests 2023-03-08 23:03:32 +01:00
Luke Boswell
5d321e354b
update mono 2023-03-07 17:28:04 +11: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
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
Anton-4
4d91fe01ca
update mono tests 2023-02-24 14:35:05 +01:00