Commit graph

2714 commits

Author SHA1 Message Date
Ayaz Hafiz
c327189ab7
Remove unneeded whitespace 2022-12-14 17:14:44 -06:00
Ayaz Hafiz
70c27943fa
Toss out unneeded test 2022-12-14 17:14:20 -06:00
Ayaz Hafiz
4315a36e90
Refine imported ZAT/function compilation 2022-12-14 17:13:59 -06:00
Ayaz Hafiz
02eec1f60c
Simplify the model of handling imported/unloaded symbol specializations 2022-12-14 17:13:58 -06:00
Ayaz Hafiz
f08d9c9173
Add gen test for other #4733 reproducer 2022-12-14 17:13:58 -06:00
Ayaz Hafiz
0a071e2a98
Rename mono test 2022-12-14 17:13:58 -06:00
Ayaz Hafiz
1727a9a123
Add gen test for #4733 2022-12-14 17:13:44 -06:00
Ayaz Hafiz
b8aa8df100
Make sure to resolve lambda sets for imported top-levels correctly
Part of #4733
2022-12-14 17:13:43 -06:00
Ayaz Hafiz
ed4e047ee8
Reproduce #4733 2022-12-14 17:12:03 -06:00
Folkert de Vries
6f2e14cf18
Merge pull request #4765 from roc-lang/expects-store-layout-in-lookaside
Remove layouts from the mono AST for expects, and add regtest for #4749
2022-12-14 23:22:03 +01:00
Ayaz
9b4e30a903
Merge pull request #4745 from roc-lang/i4712
Ensure that disjoint nested lambda sets force parents to be disjoint
2022-12-14 14:55:25 -06:00
Ayaz Hafiz
cec6da19de
Check in mono test 2022-12-14 14:20:10 -06:00
Ayaz Hafiz
1233317907
Add test that #4749 compiles
Now that mono does not store expect lookup layouts, the layout cache
should be primed only when specializing the condition of an expect, and
so #4749 is resolved.

Closes #4749
2022-12-14 14:16:59 -06:00
Ayaz Hafiz
a5ecded934
Don't collect layouts in mono of expects anymore 2022-12-14 14:12:57 -06:00
Ayaz Hafiz
1962f2045e
Remove layouts from the mono AST for expects
This actually isn't needed, because the backends must lookup the layout
from the environment anyway. So it's enough to lookup the symbol and
find its layout, there is no need to additionally store it.
2022-12-14 14:10:02 -06:00
Ayaz Hafiz
f2ffda6d05
Revert "Add a LayoutBuffer to store layouts aside and thread it through"
This reverts commit 3d73e33b49.
2022-12-14 14:05:56 -06:00
Ayaz Hafiz
897b69b072
Revert "Store layouts in a layout-buffer for expects"
This reverts commit bba6e36a18.
2022-12-14 14:05:46 -06:00
Ayaz Hafiz
bba6e36a18
Store layouts in a layout-buffer for expects 2022-12-14 14:05:28 -06:00
Ayaz Hafiz
3d73e33b49
Add a LayoutBuffer to store layouts aside and thread it through 2022-12-14 13:48:58 -06:00
Ayaz Hafiz
63b0eb49d8
Explicit is_inside_lambda_set not needed 2022-12-13 09:00:46 -06:00
Richard Feldman
3d1cdf1fd4
Merge pull request #4737 from roc-lang/to
Use app module's `to` to determine platform
2022-12-13 06:04:25 -05:00
Ayaz Hafiz
79ee266f66
Snapshot/restore pool if lambda sets are disjoint 2022-12-12 18:06:50 -06:00
Richard Feldman
4de0c831bd
Merge pull request #4716 from roc-lang/fuzzing-take-1
Give parser fuzzing some TLC
2022-12-12 18:56:11 -05:00
Ayaz Hafiz
0ef0638862
Remove more dead code 2022-12-12 15:48:30 -06:00
Ayaz Hafiz
22c8719eed
Dead code 2022-12-12 15:47:58 -06:00
Ayaz Hafiz
23932137ef
Avoid exponential unification paths
🤦 when we check whether lambdas can be unified or must be
treated as disjoint we previously had a code path that is actually
exponential in its runtime, regardless of whether it succeeds or fails.
Now, it is linear, though degraded (with a clone) if it fails.
2022-12-12 15:46:05 -06:00
Ayaz Hafiz
1e120653ff
Update derive tests 2022-12-12 15:06:32 -06:00
Ayaz Hafiz
6de816a9fc
Fix test_derive script 2022-12-12 15:04:54 -06:00
Ayaz Hafiz
1262198f7a
Add gen test for #4712 2022-12-12 14:58:41 -06:00
Ayaz Hafiz
cd2b936a59
Ensure that disjoint nested lambda sets force parents to be disjoint
We must be careful to ensure that if unifying nested lambda sets
results in disjoint lambdas, that the parent lambda sets are
ultimately treated disjointly as well.
Consider

```
  v1: {} -[ foo ({} -[ bar Str ]-> {}) ]-> {}
~ v2: {} -[ foo ({} -[ bar U64 ]-> {}) ]-> {}
```

When considering unification of the nested sets

```
  [ bar Str ]
~ [ bar U64 ]
```

we should not unify these sets, even disjointly, because that would
ultimately lead us to unifying

```
v1 ~ v2
=> {} -[ foo ({} -[ bar Str, bar U64 ]-> {}) ] -> {}
```

which is quite wrong - we do not have a lambda `foo` that captures
either `bar captures: Str` or `bar captures: U64`, we have two
different lambdas `foo` that capture different `bars`. The target
unification is

```
v1 ~ v2
=> {} -[ foo ({} -[ bar Str ]-> {}),
         foo ({} -[ bar U64 ]-> {}) ] -> {}
```

Closes #4712
2022-12-12 14:51:18 -06:00
Ayaz Hafiz
f178a86f99
Support pretty-printing can decls in solve tests 2022-12-12 14:50:14 -06:00
Ayaz Hafiz
27dfe974df
Only print lambda ident names in types if they are ambiguous 2022-12-12 14:48:09 -06:00
Ayaz Hafiz
50992d35aa
Support printing lambda names in print decls 2022-12-12 14:13:32 -06:00
Ayaz Hafiz
00ff6dcad7
Print similar-layout procs when borrow fails to find one 2022-12-12 14:13:07 -06:00
Ayaz Hafiz
4cdb8c0cd7
Remove unused unification mismatches 2022-12-12 13:17:43 -06:00
Brendan Hansknecht
662eb5895e
Merge pull request #4741 from roc-lang/ignore-dlclose-errors
remove explicit closing of dylib when testing
2022-12-12 19:14:41 +00:00
Folkert de Vries
c5df39daf4
Merge pull request #4735 from nfreesto/fmt-fix
Fix for #4585
2022-12-12 19:34:21 +01:00
Brendan Hansknecht
dbca7e0f2b
remove explicit closing of dylib when testing 2022-12-12 08:44:56 -08:00
Ayaz Hafiz
04e1e0cd6e
Support better printing of symbols 2022-12-12 10:38:53 -06:00
Ayaz Hafiz
3a2cd2f7c8
Pretty-print canonicalized declarations 2022-12-12 10:28:23 -06:00
Ayaz Hafiz
7135df6d2f
Move can AST pretty-printing into roc_can::debug 2022-12-12 10:09:32 -06:00
Richard Feldman
8a9e152a5b
Rename PackageName to PackagePath 2022-12-12 00:41:55 -05:00
Richard Feldman
16ce22d455
Use app module's to to determine platform 2022-12-12 00:17:43 -05:00
Nathan Freestone
04c9454c20
changed expected output for tests to reflect new behavior 2022-12-11 18:39:14 -07:00
Nathan Freestone
83f4cdfaeb
fix for format behavior for multi-line strings 2022-12-11 18:38:47 -07:00
Joshua Warner
e83cd8f191
Re-improve perf of skipping spaces and comments
On my M1 mac this shows as ~25% faster at parsing Num.roc than the old implementation, probably because nobody wrote any NEON code.

Even on my x86_64 linux box (Ryzen 2700x), this shows as 10% faster than the current SSE implementation (running with RUSTFLAGS="-C target-cpu=native").
2022-12-11 08:43:22 -08:00
Joshua Warner
5f29402297
Give parser fuzzing some TLC
* The header + expr fuzzers can both be run again (header fuzzer had regressed).
* I ran the expr fuzzer for ~60 seconds with no additional panics uncovered
* "tab_crash" hit supposedly unreachable code in blankspace.rs - and I went to the liberty of dramatically simplifying all that code, rather than just trying to fix the bug
* Other failures were straight-forward error cases that should have been handled (and passed up the chain) instead of panicking
2022-12-11 08:39:52 -08:00
Richard Feldman
1cd0097c23
Fix test_gen test 2022-12-11 06:16:29 -05:00
Richard Feldman
f6f8c2876f
Merge remote-tracking branch 'origin/main' into refactor-platform-info 2022-12-11 03:37:48 -05:00
Richard Feldman
141010e6c7
Actually set symbols_from_requires 2022-12-11 03:29:06 -05:00