Commit Graph

4076 Commits

Author SHA1 Message Date
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
a0af21becc
Merge pull request #4748 from roc-lang/i4713
Make sure byte-sized tag unions are printed as unions in the repl
2022-12-14 07:43:46 -06:00
Brian Carroll
de9349477f
wasm_module: remove commented-out code 2022-12-14 12:10:55 +00:00
Brian Carroll
1a14dbba19
wasm_interp: remove leftover code from profiling 2022-12-14 12:10:21 +00:00
Brian Carroll
f55fbaad12
builtins: use roc_wasm_interp for Zig wasm tests 2022-12-14 12:09:31 +00:00
Brian Carroll
01d0c5fabc
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_test_gen 2022-12-14 11:15:42 +00:00
Brian Carroll
c7fe787284
test_gen: ignore eq_linked_list_long as it's quite slow 2022-12-14 08:42:14 +00:00
Brian Carroll
8052c2bb19
wasm_interp: create a branch cache to improve perf in some programs 2022-12-14 08:42:01 +00:00
Brian Carroll
6d0e7426dc
wasm_interp: handle if without else 2022-12-14 08:42:01 +00:00
Brian Carroll
b80278fe48
test_gen: create a debug flag to print wasm interpreter log 2022-12-14 08:42:01 +00:00
Brian Carroll
6cc270241e
test_gen: fix type annotation on character_literal tests 2022-12-14 08:42:01 +00:00
Brian Carroll
c85fd96ef6
test_gen: refcount tests working with wasm_interp 2022-12-14 08:42:01 +00:00
Brian Carroll
0acf55137f
wasm_interp: remove unnecessary &mut from read_i32/read_u32 2022-12-14 08:42:01 +00:00
Brian Carroll
adc213b364
test_gen: reorder import names in wasm_linking test 2022-12-14 08:42:01 +00:00
Brian Carroll
3d5edf57fc
wasm_interp: If called function is not found in exports, look in name section too 2022-12-14 08:42:01 +00:00
Brian Carroll
473dd371b0
wasm_module: when parsing, and a linking section is not found, reset the cursor 2022-12-14 08:42:01 +00:00
Brian Carroll
9fef0c319f
test_gen: pass Wasm linking test without DCE 2022-12-14 08:42:01 +00:00
Brian Carroll
b585bd5fde
wasm_interp: debug print displays the called export 2022-12-14 08:42:01 +00:00
Brian Carroll
eaf2782bbd
test_gen: refactor wasm_linking execute_wasm_bytes->execute_wasm_module 2022-12-14 08:42:01 +00:00
Brian Carroll
c8b0e91f3c
test_gen: refactor wasm_linking tests to share more code 2022-12-14 08:42:01 +00:00
Brian Carroll
b4c0ac14c8
gen_wasm: comment about debug env var 2022-12-14 08:42:01 +00:00
Brian Carroll
06c675703a
wasm_interp: bring back debug output 2022-12-14 08:42:01 +00:00
Brian Carroll
74bb8cc843
gen_wasm: fix type error in i64 shift operators 2022-12-14 08:42:01 +00:00
Ayaz Hafiz
f809bf310b
Do not unwrap number aliases all the way 2022-12-13 09:32:20 -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
Ayaz Hafiz
8bd61d9408
Make sure byte-sized tag unions are printed as unions in the repl
Closes #4713
2022-12-12 18:01:22 -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
Richard Feldman
cbc095aa1e
Drop inaccurate comment (copy/paste error) 2022-12-11 03:12:45 -05:00
Richard Feldman
e47898dfff
Rename some more header_for to header_type 2022-12-11 03:02:20 -05:00
Joshua Warner
521afce1f4
Merge pull request #4730 from joshuawarner32/fix-parse-benchmark
Fix parse benchmark and add a benchmark for parsing Num.roc
2022-12-10 16:37:00 -08:00
Joshua Warner
d52b35c1ff
Fix parse benchmark and add a benchmark for parsing Num.roc, the largest builtin file 2022-12-10 11:14:17 -08:00
Richard Feldman
68e6bfcd2a
clippy 2022-12-10 01:49:18 -05:00
Richard Feldman
66f393e30a
Fix a mistake from merge of main 2022-12-10 01:48:38 -05:00
Richard Feldman
75891f6755
fixup! Merge remote-tracking branch 'origin/main' into refactor-platform-info 2022-12-10 01:45:31 -05:00
Richard Feldman
222e0193a3
Don't give packages names 2022-12-10 01:43:53 -05:00
Richard Feldman
e3687935a3
Merge remote-tracking branch 'origin/main' into refactor-platform-info 2022-12-09 22:21:25 -05:00
Richard Feldman
63e9f5da8c
Go back to old opt_main_for_host 2022-12-09 22:18:52 -05:00
Richard Feldman
f34a558c41
Merge pull request #4659 from roc-lang/expect-print-values
Expect print values
2022-12-09 21:24:28 -05:00
Brian Carroll
deab384d02
test_gen: u64 is not always the same size as a pointer, guys, jeez 2022-12-10 00:52:23 +00:00
Brian Carroll
ed18bf7709
wasm_interp: rename ValueStack::len -> depth 2022-12-10 00:52:23 +00:00
Brian Carroll
76341c7611
wasm_interp: truncate ValueStack on leaving a block 2022-12-10 00:52:23 +00:00
Brian Carroll
612c258e35
wasm_interp: simplify CallStack for easier debugging 2022-12-10 00:52:23 +00:00
Brian Carroll
18e9051760
wasm_interp: fix a bug in implicit return 2022-12-10 00:52:23 +00:00
Brian Carroll
90449f45f3
test_gen: get some tests working with roc_wasm_interp 2022-12-10 00:52:23 +00:00
Brian Carroll
8c7d9dbff8
wasm_interp: Make ValueStack a dumb Vec<Value> => Zig test 146.3->124.6ms 2022-12-09 23:20:50 +00:00
Brian Carroll
1f90286d64
wasm_module: unsafe From<u8> for Opcode takes 6% off Zig test time 2022-12-09 23:20:50 +00:00
Brian Carroll
d43129d578
wasm_interp: code comment about empty implementation of WASI clock functions 2022-12-09 23:20:50 +00:00
Richard Feldman
bff3204727
Include platform provides in exposed 2022-12-09 16:56:00 -05:00
Richard Feldman
ccb6a98f8a
Address unused arg warning 2022-12-09 14:19:26 -05:00
Richard Feldman
29182d8292
Move platform_main_type into provides 2022-12-09 14:19:07 -05:00
Folkert
1ef27b4bec
fix gen-dev compilation 2022-12-09 18:28:14 +01:00
Folkert
0260182fb4
clippy 2022-12-09 16:03:12 +01:00
Folkert
30ce1ad4bb
cleanup 2022-12-09 15:57:50 +01:00
Folkert
19aa3ade45
fix morphic spec for expect runs in --optimize mode 2022-12-09 15:53:53 +01:00
Folkert
a72556b927
refactor entry point 2022-12-09 15:10:25 +01:00
Richard Feldman
4583985f33
Use a better List.range example for step 2022-12-09 09:08:38 -05:00
Richard Feldman
7d8b9b2323
Fix List.range type annotation bug 2022-12-09 06:53:10 -05:00
Folkert de Vries
234f9f54cd
Merge pull request #4714 from roc-lang/expect-dbg-atomics
use atomics for expect/dbg
2022-12-09 09:21:13 +01:00
Folkert
9c72eb5b93
test expects for variables and expressions 2022-12-09 00:04:43 +01:00
Folkert
4b9e64fd7d
Merge branch 'expect-dbg-atomics' into expect-print-values 2022-12-08 23:43:11 +01:00
Folkert
13d0b75bc1
Merge remote-tracking branch 'origin/main' into expect-print-values 2022-12-08 23:42:03 +01:00
Folkert
95fe9cbccd
pass the pointer to shared memory around, instead of using a global 2022-12-08 23:22:26 +01:00
Richard Feldman
97332e4af1
Move ModuleNameEnum into HeaderType 2022-12-08 15:31:43 -05:00
Richard Feldman
e2137cc310
Use a pattern match over an inline let 2022-12-08 15:31:42 -05:00
Richard Feldman
e857a91b1b
Drop obsolete constant 2022-12-08 15:31:42 -05:00
Richard Feldman
8b463686bc
Propagate multiple entrypoints to alias analysis 2022-12-08 15:31:42 -05:00
Richard Feldman
236cebacc1
Refactor out PlatformHeaderInfo 2022-12-08 15:31:42 -05:00