Commit Graph

4079 Commits

Author SHA1 Message Date
Brian Carroll
736630b53f
wasm_interp: don't require -- before app arguments 2022-12-05 22:16:27 +00:00
Brian Carroll
0970595238
wasm_module: fix bug in DataSection::load_into (for roc_wasm_interp) 2022-12-05 22:16:27 +00:00
Brian Carroll
735085b8df
wasm_interp: add a description to Cargo.toml 2022-12-05 22:16:27 +00:00
Ayaz Hafiz
aab509c5c1
Make sure to escape formatting of char literals
Closes #4682
2022-12-05 14:09:28 -06:00
Ayaz Hafiz
759127660d
Spread list tests can never touch exact-sized bounds tests
When compiling a pattern match like

```
[] -> ..
[_] -> ..
[_, ..] -> ..
```

to a decision tree, we must make sure that the last test (len >= 1)
does not touch the branch reached by the second test (len == 1). It is
enough to ban (len >=) tests from ever touching exact-sized list
patterns, because a spread test (len >=) can never reach an exact-sized
test.

On the other hand, an exact-sized test can reach a spread pattern,
because in

```
[_, _] -> ..
[..] -> ..
```

the last branch generates tests for patterns `[]` and `[_]`, and we would
like those patterns to be covered by the spread test (len >= 0)!

Closes #4685
2022-12-05 13:45:35 -06:00
Ayaz Hafiz
b6a96ebb85
Reproduce miscompilation in #4685 2022-12-05 13:14:32 -06:00
Ayaz Hafiz
1cd7f8baf1
Fix test_derive 2022-12-05 13:10:29 -06:00
Ayaz Hafiz
836240f158
Clippy 2022-12-05 13:07:53 -06:00
Ayaz Hafiz
fe1cfe01b9
Allow too many arguments 2022-12-05 13:06:35 -06:00
Ayaz Hafiz
8ca9e6b443
Be more explicit about imported flex and rigid vars 2022-12-05 13:04:15 -06:00
Ayaz Hafiz
0bb31558e6
Disable gen and set tests on debug for now
Due to #3898
2022-12-05 12:50:24 -06:00
Ayaz Hafiz
8317c4d038
Add gen test for #4671 2022-12-05 12:08:55 -06:00
Ayaz Hafiz
09353733fa
Make sure to register imported variables when importing specializations
Closes #4671
2022-12-05 11:44:28 -06:00
Folkert
98560c63e6
fix bad merge 2022-12-05 12:54:57 +01:00
Brendan Hansknecht
415cac5179
update mono tests 2022-12-04 21:49:28 -08:00
Brendan Hansknecht
d81be27be0
update call to List.range in reporting test 2022-12-04 20:19:02 -08:00
Brendan Hansknecht
2ff8dad1c9
remove old List.range tests in favor of expect 2022-12-04 20:18:39 -08:00
Brendan Hansknecht
a5cb441d73
fix builtin formatting 2022-12-04 16:13:38 -08:00
Brendan Hansknecht
a5efc1f179
switch to more expressive list.range 2022-12-04 16:04:17 -08:00
Folkert
ae8b0b4a1b
use some custom types in cli_run to clarify code 2022-12-04 23:22:36 +01:00
Folkert de Vries
c1d3580b0f
Merge pull request #4674 from roc-lang/ircheck
Type-check mono IR
2022-12-04 20:56:54 +01:00
Ayaz Hafiz
d660016b53
Clippy 2022-12-03 23:43:47 -06:00
Ayaz Hafiz
e296d35bcd
Skip testing two mono tests for now 2022-12-03 22:43:19 -06:00
Ayaz Hafiz
01dea13b49
Pretty print symbols 2022-12-03 22:33:45 -06:00
Ayaz Hafiz
b0300e4e90
Fix bug in resolving layout 2022-12-03 22:18:15 -06:00
Ayaz Hafiz
7b21936d4f
Add mono checker to tests 2022-12-03 22:10:37 -06:00
Ayaz Hafiz
6e72307736
Format problems reported by the IR checker 2022-12-03 21:35:01 -06:00
Ayaz Hafiz
a84aebf2d3
Implement a type checker for the mono IR 2022-12-03 18:24:03 -06:00
Brendan Hansknecht
8e710cb80e
disable wasm tests that are broken 2022-12-03 13:17:36 -08:00
Brendan Hansknecht
1dd0738eba
update mono test for dict again 2022-12-03 13:17:36 -08:00
Brendan Hansknecht
04bd5d6ab0
disable wasm dictionary small string test 2022-12-03 13:17:36 -08:00
Brendan Hansknecht
ab6c652360
manually do 128 bit multiplication to avoid bitshift and fix wasm tests 2022-12-03 13:17:36 -08:00
Brendan Hansknecht
436bfc41ed
disable glue test and update mono test 2022-12-03 13:17:36 -08:00
Brendan Hansknecht
ae58623f70
use crash to clearify unreachable state 2022-12-03 13:17:36 -08:00
Brendan Hansknecht
b4b18cda5a
fix formatting 2022-12-03 13:17:35 -08:00
Brendan Hansknecht
ac2380f6c8
swap based on dataIndex not raw hash map index 2022-12-03 13:17:35 -08:00
Brendan Hansknecht
8a30615a20
fix swap remove ordering 2022-12-03 13:17:35 -08:00
Ayaz Hafiz
24a136095c
Add Set.toList from empty test 2022-12-03 13:17:35 -08:00
Ayaz Hafiz
6adcaa2cbd
Extend ability symbol slice when merging in subs 2022-12-03 13:17:35 -08:00
Brendan Hansknecht
4befccc6b4
expand Set test cases 2022-12-03 13:17:35 -08:00
Brendan Hansknecht
cad7d8b4e9
add walkUntil and use it to implement set equality 2022-12-03 13:17:35 -08:00
Ayaz Hafiz
4159b83214
Fix imports 2022-12-03 13:17:35 -08:00
Ayaz Hafiz
2e56405c1e
Fix obligation checking for rigid able vars 2022-12-03 13:17:34 -08:00
Brendan Hansknecht
a321e36a36
update mono test for dict 2022-12-03 13:17:34 -08:00
Brendan Hansknecht
28835d5bf3
some bug fixes 2022-12-03 13:17:34 -08:00
Brendan Hansknecht
4fc0dd9dd9
add a some tests and bug fixes 2022-12-03 13:17:34 -08:00
Brendan Hansknecht
02824e92fe
add Set implementation 2022-12-03 13:17:34 -08:00
Brendan Hansknecht
cb08dca6f1
Add an indexmap like dict to roc 2022-12-03 13:17:34 -08:00
Ayaz
c61c42bff7
Merge pull request #4661 from roc-lang/roc-test-dev
`test` has `dev` behavior, and `dev` does not exit if there are warnings
2022-12-03 12:26:00 -06:00
Folkert de Vries
24e4048cb5
Merge pull request #4660 from roc-lang/linux-stub-lib
Linux stub lib
2022-12-03 10:50:12 +01:00
Ayaz
012810d7e8
Merge pull request #4664 from roc-lang/i2551
Ensure that llvm gen_ wrappers account different recursive pointers
2022-12-02 17:39:26 -06:00
Ayaz Hafiz
7562525e96
Bugfix match 2022-12-02 16:31:47 -06:00
Ayaz Hafiz
304b88cdb2
Fix bug in expect test 2022-12-02 16:20:56 -06:00
Folkert
23274fbb8d
fix incorrect path used 2022-12-02 21:39:08 +01:00
Ayaz Hafiz
705ce10085
New problem dropped 2022-12-02 14:14:18 -06:00
Ayaz Hafiz
66419e8f29
The yeah yeah yeahs 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
8e2c2e1809
It's an error to expose values that aren't defined 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
845a2f8c75
Report warnings in roc test 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
37c689841a
dev/test don't exit early for warnings 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
c351be3230
Import in test reporting 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
7e512077e7
Fix imports for repl 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
39f89e3d65
Get severity from type problem variants 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
5414b4b60f
Fix imports 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
e438fbf37c
Enumerate severity on problem variants 2022-12-02 14:11:57 -06:00
Ayaz Hafiz
0a4ec1958b
roc test stops if there are type errors 2022-12-02 14:11:57 -06:00
Ayaz
b5a195eaf0
Merge pull request #4650 from roc-lang/detect-reachable-by-recursion-only
Provide warning for defs that are used only in (mutual) recursion
2022-12-02 13:39:52 -06:00
Ayaz Hafiz
3685ad2ed2
Ensure that llvm gen_ wrappers account different recursive pointers
Closes #2551
2022-12-02 13:38:32 -06:00
Folkert
7c6cc97cd4
Merge remote-tracking branch 'origin/main' into expect-print-values 2022-12-02 20:28:04 +01:00
Ayaz Hafiz
5cfbc49ebf
Remove needless hole translation 2022-12-02 12:21:44 -06:00
Ayaz Hafiz
52c858dc53
Remove aliases in partial procs
This is no longer needed
2022-12-02 12:19:13 -06:00
Folkert
bc4473132d
ignore some cache files 2022-12-02 18:52:22 +01:00
Ayaz Hafiz
0f6f34983f
Remove stale comment 2022-12-02 11:50:12 -06:00
Ayaz Hafiz
947808bbb3
Checking if a connected component has a bridge needs to look at all edges
With a graph

A -> B

if we visit the order B, A to collect SCCs, we won't see that B has
pre-order edges until we look at A.
2022-12-02 11:50:12 -06:00
Ayaz Hafiz
0a807dc43e
Provide warning for defs that are used only in (mutual) recursion
This patch provides errors for defs that are used only in
possibly-mutual recursion, and are not reachable outside of their
recursive closures. For example:

```
test_report!(
    mutual_recursion_not_reached_nested,
    indoc!(
        r#"
        app "test" provides [main] to "./platform"

        main =
            f = \{} -> if Bool.true then "" else g {}
            g = \{} -> if Bool.true then "" else f {}
            ""
        "#
    ),
@r###"
── DEFINITIONs ONLY USED IN RECURSION ──────────────────── /code/proj/Main.roc ─

These 2 definitions are only used in mutual recursion with themselves:

4│>      f = \{} -> if Bool.true then "" else g {}
5│>      g = \{} -> if Bool.true then "" else f {}

If you don't intend to use or export any of them, they should all be
removed!
"###
);
```
2022-12-02 11:50:12 -06:00
Ayaz Hafiz
34328ddf0c
Unused import 2022-12-02 08:50:04 -06:00
Ayaz Hafiz
078f0147ee
Do not bind accessors in toplevel thunks to their thunks' names
In #3352 an optimization to transform `ra = .field` into

```
ra = \#rcd -[ra]-> #rcd.field
```

rather than

```
__ra1 = \#rcd -[__ra1] -> #rcd.field

ra = LambdaSet { __ra1 }
```

was introduced. However, this optimization is not correct when `ra =
.field` is defined as a toplevel thunk, for in such situations we
indeed want the thunk `ra` to return the lambda set it resolves to,
rather than repointing at itself.

Besides reverting this change, another option would be to convert
accessors into closures before translation of Can to IR. However, this
complicates the translation algorithm more than it already is, and I'd
like to avoid additional special-cases.

Closes #4606
2022-12-02 08:50:03 -06:00
Ayaz Hafiz
22a84c8b21
Add comment for is_function 2022-12-02 08:49:14 -06:00
Folkert
f55ca53088
move the test files to prevent race condition on platform 2022-12-02 15:43:49 +01:00
Folkert
fdd72c8ce3
add test for roc dev and roc test 2022-12-02 15:43:49 +01:00
Folkert
dba23c5889
be explicit about valgrind usage 2022-12-02 15:43:49 +01:00
Folkert
9bee0a6fa5
add test for inline expect 2022-12-02 15:43:48 +01:00
Folkert
1e41aac0f2
lookup symbols when coming from Defs 2022-12-02 15:43:48 +01:00
Folkert
db09d49cd7
implement two todo!'s 2022-12-02 15:43:48 +01:00
Folkert
ac1fce1a17
put in more section headers and make sure the .dynamic section is in the right segments 2022-12-02 15:19:15 +01:00
Folkert
2d8ba79034
turns out the symtab/strtab are important 2022-12-02 15:19:15 +01:00
Richard Feldman
0e74cc14cc
Merge pull request #4653 from roc-lang/fix-mv
Fallback to deep copy if `rename` fails when unpacking package tarball
2022-12-02 07:19:57 -05:00
Folkert de Vries
b67ffde678
Merge pull request #4657 from roc-lang/take_examples_fix
fix take examples
2022-12-02 12:46:26 +01:00
Folkert de Vries
0cb26bf50c
Merge pull request #4656 from roc-lang/wasm_interp_test_reorg
Wasm interp test reorg
2022-12-02 11:08:31 +01:00
Folkert de Vries
e1f7dfb3e6
Merge pull request #4649 from roc-lang/wasm_interp_imports
Wasm interp imports
2022-12-02 11:08:23 +01:00
Anton-4
2bf58a5bc3
fix take examples 2022-12-02 10:10:40 +01:00
Brian Carroll
c6e446da8d
wasm_interp: don't expose internal types 2022-12-02 08:02:27 +00:00
Brian Carroll
4714b4599a
wasm_interp: move test_utils into tests/mod.rs 2022-12-02 08:02:23 +00:00
Brian Carroll
ffd35f5884
wasm_interp: move tests inside the crate 2022-12-02 07:54:13 +00:00
Brian Carroll
42a15d07b3
wasm_interp: Just don't support non-function imports! I've never seen them anyway. 2022-12-02 07:47:49 +00:00
Brian Carroll
c38164ce8a
wasm_interp: cache import indices instead of signatures 2022-12-02 07:47:49 +00:00
Richard Feldman
2d8b8678d5
If renaming tmpdir for package fails, deep copy it 2022-12-01 22:39:40 -05:00
Richard Feldman
84eb82b815
Make fs_extra a workspace dependency 2022-12-01 22:33:04 -05:00
Ayaz
0d80e741c2
Merge pull request #4648 from roc-lang/i4636 2022-12-01 18:36:43 -06:00
Ayaz
9b4552608f
Merge pull request #4644 from roc-lang/i4594
Unify ranged numbers with flex able, modulo obligation checking
2022-12-01 16:52:32 -06:00
Ayaz Hafiz
42e8e409d4
Address lint 2022-12-01 15:59:01 -06:00
Brian Carroll
0cf2f4f9e4
clippy 2022-12-01 21:56:59 +00:00
Ayaz Hafiz
9181ed8092
Correctly compile rvalue closures defined in nested defines to lvalues
Previously, a program like

```
main =
  f =
    n = 1
    \{} -[#lam]-> n  # suppose lambda set = #lam
  f {}
```

would be transformed to

```
main =
  n = 1
  f = \{} -[#lam]-> n
  f {}
```

However, the IR lowering procedure is such that we would then associate
`f` as definining the procedure given the lambda set `#lam`. This is not
correct, as `f` is really a function pointer in this circumstance,
rather than the definer of `#lam`.

Instead, the transformation we want to perform is

```
main =
  n = 1
  #lam = \{} -[#lam]-> n
  f = #lam
  f {}
```

Which is what this patch does

Closes #2403
2022-12-01 15:47:18 -06:00
Brian Carroll
04d493c49e
Merge branch 'main' of github.com:rtfeldman/roc into wasm_interp_imports 2022-12-01 21:33:31 +00:00
Brian Carroll
c0f840542a
wasm_interp: test import calls 2022-12-01 21:31:46 +00:00
Ayaz Hafiz
68e364d897
Do not attempt to handle aliasing of procs in variable assignments
Please see the comment in the diff to explain the rationale of this
change.

Closes #4636
2022-12-01 15:20:58 -06:00
Ayaz Hafiz
2dfe0276e4
Make sure to assign and update program holes correctly when specializing symbols
Previously this was a bit hacky, we worked around having to update
symbol substitutions by special-casing the rest of the program. There's
not need to do that.
2022-12-01 14:57:01 -06:00
Brian Carroll
c866ce6b09
wasm_interp: Handle calls to imports 2022-12-01 20:41:38 +00:00
Ayaz Hafiz
f49b0cd207
Update repl expect test to work around Dec copy bug 2022-12-01 13:26:08 -06:00
Ayaz Hafiz
34236654af
Revert "Fix gen_compare::record test"
This reverts commit e8492f279e.
2022-12-01 11:42:27 -06:00
Ayaz Hafiz
3605008fce
Update tests to check eq unbound float is resolved to dec 2022-12-01 11:41:42 -06:00
Ayaz Hafiz
ed7d4f8f63
Obligation checking of floating point for Eq succeeds only with Dec 2022-12-01 11:31:41 -06:00
Ayaz Hafiz
e8492f279e
Fix gen_compare::record test
Unbound floating point numbers cannot be compared for Eq as of
obligation checking - this test is a correction to enforce that!
2022-12-01 11:12:50 -06:00
Ayaz Hafiz
590535a42b
Obligation checking Eq for floating point types may never succeed 2022-12-01 10:02:37 -06:00
Ayaz Hafiz
0bae0aafb6
Unify ranged numbers with flex able, modulo obligation checking
Closes #4594
2022-12-01 09:50:29 -06:00
Ayaz Hafiz
a42c7c00a6
Turn on roc dev test for env.roc again 2022-12-01 09:10:26 -06:00
Ayaz Hafiz
1ab41bf6b5
Do not mark whether a module has specialization deps incrementally
Whether a module has a dependency on another module for specialization
is already accounted for when the build graph was initially populated,
and should not be modified again.

Closes #4622
2022-12-01 09:08:53 -06:00
Richard Feldman
2a27d3c05f
Merge pull request #4642 from roc-lang/dbg-parsing-problem
stop parsing dbg as a value def
2022-12-01 06:55:23 -05:00
Brian Carroll
b10ac827f1
wasm_interp: simplified ImportDispatcher
We don't really need a trait for the 'import module' concept.
2022-12-01 08:47:32 +00:00
Brian Carroll
ec8950816a
wasm_interp: expose both call_export_from_cli and call_export (for library usage) 2022-11-30 23:20:58 +00:00
Richard Feldman
a0bc105ca8
Merge pull request #4616 from roc-lang/fix-pattern-equivalent
Fix missing cases in Pattern::equivalent
2022-11-30 12:10:09 -05:00
Richard Feldman
da158bca19
Merge pull request #4637 from roc-lang/check-link-exit-status
check the exit status of the link cmd
2022-11-30 12:09:14 -05:00
Folkert
b6622b71ec
stop parsing dbg as a value def 2022-11-30 14:18:48 +01:00
Brian Carroll
7ddff49691
wasm_interp: possible design for imports, using enum dispatch 2022-11-30 07:25:38 +00:00
Joshua Warner
1e47de3c65
Merge pull request #4630 from roc-lang/more-parser-refactoring
Introduce `record!` combinator
2022-11-29 17:50:11 -08:00
Brendan Hansknecht
3d4dbd916a
Merge pull request #4632 from roc-lang/fix-stub-lib-path
fix stub lib path
2022-11-29 23:11:44 +00:00
Brian Carroll
d0b2f9c6e1
Merge pull request #4631 from roc-lang/wasm_interp_final_ops
Wasm interp final ops
2022-11-29 18:18:46 +00:00
Brendan Hansknecht
4329b08fae
fix stub lib path
platform-path is relative to the execution folder, not the input path
2022-11-29 10:03:27 -08:00
Folkert de Vries
24ddb1bf0a
Merge pull request #4628 from roc-lang/platform-cargo-test
Platform cargo test with elf
2022-11-29 18:23:48 +01:00
Anton-4
0b98609a22
check the exit status of the link cmd 2022-11-29 16:53:04 +01:00
Brian Carroll
378cad7748
clippy 2022-11-29 11:28:30 +00:00
Brian Carroll
d29ea7fedf
wasm_interp: last few instructions! 2022-11-29 08:59:37 +00:00
Brian Carroll
17810d5134
wasm_interp: float rounding ops 2022-11-29 08:43:56 +00:00
Brian Carroll
714586fac1
wasm_interp: f32 convert instructions 2022-11-29 08:06:18 +00:00
Brian Carroll
029f0d00c1
wasm_interp: truncate instructions 2022-11-29 08:06:18 +00:00
Brian Carroll
6ac46a150f
wasm_interp: fix tests for promote and demote ops 2022-11-29 08:05:46 +00:00
Folkert
a9bd01be87
simplify to only the required changes 2022-11-29 09:03:42 +01:00
Folkert
5a62eaa662
commit test version with elfcopy object example 2022-11-29 09:03:42 +01:00
Joshua Warner
2b91af02df
Introduce record! combinator
... and refactor header parser to fully use combinators, in support of future combinator-based superpowers
2022-11-28 20:25:55 -08:00
Joshua Warner
8de153efb9
Fix missing cases in Pattern::equivalent 2022-11-28 19:47:53 -08:00
Brian Carroll
afa57a027b
wasm_interp: implement some number conversion ops 2022-11-28 23:28:08 +00:00
Brian Carroll
94ca352ed7
wasm_interp: 'reinterpret' instructions 2022-11-28 23:28:08 +00:00
Brian Carroll
46737b4a41
wasm_interp: rename test_opcodes -> test_basics, and split out test_convert 2022-11-28 23:28:08 +00:00
Brian Carroll
f798f47edd
wasm_interp: move load and store tests to test_mem 2022-11-28 23:28:08 +00:00
Brian Carroll
a97aba7cec
wasm_interp: delete older duplicate test 2022-11-28 23:28:08 +00:00
Brian Carroll
1e114d6eef
wasm_interp: implement float neg and abs 2022-11-28 23:28:08 +00:00
Brian Carroll
284eeb5537
wasm_interp: Implement float ops that have int equivalents 2022-11-28 23:28:08 +00:00
Brian Carroll
fc10c520b1
wasm_interp: fix return type for i64 comparison ops 2022-11-28 23:28:08 +00:00
Brian Carroll
c2bf7d68fc
wasm_interp: rename ExecutionState -> Instance to match standard Wasm terminology 2022-11-28 23:28:08 +00:00
Folkert
c2a28df6d8
fix merge conflict that made it to main 2022-11-28 23:27:41 +00:00
Folkert
c9ba57f15a
fix merge conflict that made it to main 2022-11-29 00:20:03 +01:00
Brian Carroll
2aaa73460a
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_i32ops 2022-11-28 22:26:52 +00:00
Anton-4
f91523baa9
update tutorial, cleanup 2022-11-28 20:13:39 +01:00
Anton-4
963eb9f2c1
Merge pull request #4620 from roc-lang/metadata_fix
change matadata filename based on target
2022-11-28 19:19:40 +01:00
Brian Carroll
9ea2176db8
wasm_module, wasm_interp: fix SLEB-128 encoding for i64 2022-11-28 17:39:13 +00:00
Brian Carroll
0dc3441301
wasm_interp: even more copy-and-pasting 2022-11-28 17:35:51 +00:00
Brian Carroll
ea9b53aff3
wasm_interp: more copy-and-pasting of i64 from i32 2022-11-28 17:17:25 +00:00
Brian Carroll
31a4ad62a7
wasm_interp: implement modulo for rotr and rotl 2022-11-28 17:15:56 +00:00
Brian Carroll
3881296fb4
wasm_interp: Implement lots of i64 ops by copy-pasting from i32 2022-11-28 17:10:28 +00:00
Brian Carroll
56ddd1f29b
wasm_interp: Add a comment and tests for modulo in shift ops 2022-11-28 17:04:45 +00:00
Richard Feldman
c1a75a57f1
Merge pull request #4592 from roc-lang/collections_refactor
Refactor collection_trailing_sep_e
2022-11-28 11:14:30 -05:00
Ayaz
113c8cd7d7
Merge pull request #4613 from roc-lang/migrate_reporting_tests
Allow migrating reporting tests to failing parse tests
2022-11-28 09:59:01 -06:00
Anton-4
91266a03c6
change matadata filename based on target 2022-11-28 15:18:15 +01:00
Brian Carroll
b707f6fdff
wasm_interp: tests for i32 bitwise rotate ops 2022-11-28 09:01:25 +00:00
Brian Carroll
77f5635d89
wasm_interp: tests for shift right ops 2022-11-28 08:58:45 +00:00
Brian Carroll
2e0dd18b82
wasm_interp: make test_op_example generate a valid wasm file and dump it 2022-11-28 08:58:09 +00:00
Brian Carroll
6e8904baa8
wasm_module: fix parsing of negative i32's! 2022-11-28 08:25:32 +00:00
Brian Carroll
d5cc4b19f8
wasm_module: add a deb_hex! macro 2022-11-28 08:24:34 +00:00
Brian Carroll
5fc874057c
wasm_interp: tests for i32 ops 2022-11-27 23:00:22 +00:00
Brian Carroll
eeca876421
wasm_interp: create a test_utils module 2022-11-27 22:10:12 +00:00
Brian Carroll
e3df393a22
wasm_interp: use wrapping arithmetic 2022-11-27 22:07:31 +00:00
Brian Carroll
8e15d49720
wasm_interp: use Value::from in more places 2022-11-27 21:00:52 +00:00
Brian Carroll
78fbc75249
wasm_interp: neater creation of Value from unsigned integers 2022-11-27 20:53:12 +00:00
Brian Carroll
f7dcd8f421
wasm_interp: implement remaining i32 ops 2022-11-27 20:47:21 +00:00
Brian Carroll
ae2e561945
wasm_interp: implement select instruction 2022-11-27 20:39:28 +00:00
Brian Carroll
9e7a92574d
wasm_interp: don't give Signature the Clone trait just for a test! 2022-11-27 20:34:03 +00:00
Brian Carroll
8ff843261a
clippy 2022-11-27 19:40:09 +00:00
Brian Carroll
c2fb626c17
wasm_interp: implement indirect_call 2022-11-27 18:56:09 +00:00
Joshua Warner
a3071a8aea
Allow migrating reporting tests to failing parse tests 2022-11-26 17:34:50 -08:00
Richard Feldman
d949a918e4
Use false interpreter in type mismatch test 2022-11-26 19:04:35 -05:00
Richard Feldman
bb89344eaa
Merge pull request #4562 from roc-lang/https-packages
URL-based packages
2022-11-26 15:50:09 -05:00
Joshua Warner
451b2c0ded
Refactor collections 2022-11-26 09:55:54 -08:00
Brian Carroll
acb871abeb
wasm_interp: fix implicit return for calls inside blocks 2022-11-26 16:23:48 +00:00
Brian Carroll
82aa126353
gen_wasm: improve a code comment 2022-11-26 15:38:48 +00:00
Richard Feldman
32d9c6d875
Fix a comment 2022-11-26 09:08:24 -05:00
Richard Feldman
2409399ff3
Don't even compile https stuff in wasm! 2022-11-26 08:53:31 -05:00
Richard Feldman
b9074f0cfa
Avoid unused import warning on wasm tests 2022-11-26 08:47:21 -05:00
Richard Feldman
10e043c748
Fix an unused warning on wasm tests 2022-11-26 08:36:45 -05:00
Brian Carroll
df972a4567
wasm_interp: remove unnecessary and confusing ELSE check 2022-11-26 12:01:37 +00:00
Brian Carroll
0009e65d93
clippy 2022-11-26 11:01:12 +00:00
Brian Carroll
c7de45a316
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_blocks 2022-11-26 10:59:48 +00:00
Brian Carroll
3346ef9c9c
wasm_interp: Don't need to store block depth in CallStack any more 2022-11-26 10:58:16 +00:00
Brian Carroll
0bd1bced68
wasm_interp: implement loop 2022-11-26 10:47:16 +00:00
Brian Carroll
c55cedd279
wasm_interp: implement i32.lt_s 2022-11-26 10:12:47 +00:00
Brian Carroll
82e8c89045
wasm_interp: test for if/else 2022-11-26 09:36:49 +00:00
Brian Carroll
a09fd95fd7
wasm_interp: pass arguments from CLI 2022-11-26 09:10:35 +00:00
Brian Carroll
fa1e0a8614
wasm_interp: implement if/else statements 2022-11-26 07:33:17 +00:00
Richard Feldman
ca06a200e6
Use PathBuf::from over PathBuf::new 2022-11-25 21:27:00 -05:00
Brian Carroll
131a9925d0
wasm_interp: test br_table 2022-11-26 00:56:51 +00:00
Richard Feldman
b2beeb770e
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-25 19:50:06 -05:00
Richard Feldman
0ecebe57b5
WASI doesn't have a home directory 2022-11-25 19:49:28 -05:00
Richard Feldman
791025d3ed
Merge pull request #4579 from roc-lang/underivable-rigid-better-error
Suggest binding type variables to an ability when they're unsatisfied
2022-11-25 19:46:11 -05:00
Brian Carroll
578b74ee77
wasm_interp: test for br_if 2022-11-26 00:43:49 +00:00
Brian Carroll
5035ad0a2b
wasm_interp: test br 2022-11-26 00:39:46 +00:00
Brian Carroll
d9fe907684
wasm_module: create const ValueType::VOID to use as block type 2022-11-26 00:38:41 +00:00
Ayaz Hafiz
8bb015bb0f
End the string 2022-11-25 16:43:09 -06:00
Ayaz
8c0ff4c839
Merge pull request #4558 from roc-lang/specialization-sets-for-impl-opaques
Support custom abilities for opaques with immaterial lambda sets
2022-11-25 16:42:32 -06:00
Ayaz
15e372373a
Merge branch 'main' into underivable-rigid-better-error
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2022-11-25 16:33:57 -06:00
Richard Feldman
58fad36f9d
Merge pull request #4460 from roc-lang/crash
Crash
2022-11-25 17:18:21 -05:00
Richard Feldman
4cf71020cf
Merge pull request #4604 from roc-lang/linker-print-path-on-error
print the path that the linker writes on error
2022-11-25 17:16:54 -05:00
Richard Feldman
e0030bac6c
Try to fix wasm URL-based downloads again 2022-11-25 16:54:10 -05:00
Richard Feldman
2eb9531817
Fix regression on printing "Rebuilding platform…" 2022-11-25 16:41:54 -05:00
Brian Carroll
b69be0e12d
wasm_interp: implement br_if and br_table 2022-11-25 21:41:35 +00:00
Richard Feldman
695bb7e353
Merge pull request #4603 from roc-lang/dbg-fixes
Dbg fixes
2022-11-25 15:10:22 -05:00
Brian Carroll
808dd85946
Merge pull request #4602 from roc-lang/wasm_interp_memory
Wasm interp memory
2022-11-25 20:04:04 +00:00
Brian Carroll
b96f1ffc33
wasm_interp: implement block and br 2022-11-25 19:42:10 +00:00
Brian Carroll
a593d19b2d
wasm_interp: use copy_from_slice instead of write_all 2022-11-25 19:41:19 +00:00
Folkert
f2ad4848db
print the path that the linker writes on error 2022-11-25 19:57:39 +01:00
Richard Feldman
84b8c69799
Merge pull request #4520 from roc-lang/str-docs
Str docs improvements
2022-11-25 13:06:11 -05:00
Folkert
bc3414e913
spelling 2022-11-25 18:30:04 +01:00
Brian Carroll
54305dd182
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_memory 2022-11-25 17:10:45 +00:00
Brian Carroll
5f5a535aaf
clippy 2022-11-25 16:56:25 +00:00
Folkert
165db8c885
make line and column numbers the same as editor (i.e. 1-based) 2022-11-25 17:55:27 +01:00
Folkert
07b7a93b9f
fix not being able to dbg variable 2022-11-25 17:55:01 +01:00
Brian Carroll
2bd67a3292
wasm_interp: tests for memory allocation instructions 2022-11-25 16:51:36 +00:00
Brian Carroll
06f3726e35
wasm_interp: tests for store instructions 2022-11-25 16:29:37 +00:00
Brian Carroll
65fc079393
clippy 2022-11-25 15:46:02 +00:00
Brian Carroll
e8f78a9618
wasm_interp: disable some debug code 2022-11-25 15:44:00 +00:00
Brian Carroll
e08b09538e
wasm_interp: implement memory size instructions 2022-11-25 15:41:11 +00:00
Brian Carroll
598e62275d
wasm_interp: implement store instructions 2022-11-25 15:41:11 +00:00
Brian Carroll
d9a8c6f64c
wasm_interp: Fix parse error hex formatting 2022-11-25 14:51:40 +00:00
Brian Carroll
73ede61cb1
wasm_interp: tests for load instructions 2022-11-25 14:50:55 +00:00
Brian Carroll
74e1bc412f
Merge pull request #4593 from roc-lang/wasm_interp_cli
Wasm interp CLI
2022-11-25 13:01:09 +00:00
Brian Carroll
c6bf34dd78
wasm_interp: Imeplement load instructions 2022-11-25 10:13:13 +00:00
Brian Carroll
85d5f3d109
wasm_interp: add a --hex CLI flag 2022-11-25 10:12:39 +00:00
Richard Feldman
39792bf144
Drop extraneous cwd.join
This actually caused a bug! To reproduce:

cargo run -- build --prebuilt-platform=false examples/cli/file.roc
2022-11-25 04:47:36 -05:00
Brian Carroll
96bff3e304
wasm_module: Create DataSection::load_into 2022-11-25 09:19:35 +00:00
Richard Feldman
a63f1378ef
Merge remote-tracking branch 'origin/main' into str-docs 2022-11-25 04:12:42 -05:00
Richard Feldman
bef59299a2
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-25 04:07:37 -05:00
Richard Feldman
59e13d5bec
Don't try to import reqwest::blocking on wasm 2022-11-25 03:32:15 -05:00
Richard Feldman
6b805b721b
Merge pull request #4596 from roc-lang/dbg-color
Print `dbg` output in blue
2022-11-25 03:23:15 -05:00
Richard Feldman
f52ad5cbba
Merge pull request #4591 from roc-lang/tuple-accessor
Tuple accessors after tuples/records
2022-11-24 22:34:27 -05:00
Richard Feldman
5d4fa4eff1
clippy 2022-11-24 21:34:02 -05:00
Richard Feldman
08764787f5
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-24 21:14:43 -05:00
Richard Feldman
253f903ae6
Drop openssl dependency 2022-11-24 21:14:26 -05:00
Richard Feldman
54da1b1e3b
Print a newline at the end of dbg output 2022-11-24 20:39:04 -05:00
Richard Feldman
c63baa2ede
Print dbg output in blue in terminal 2022-11-24 20:38:52 -05:00
Brian Carroll
a0fe01dd5f
wasm_interp: Use an Option instead of separate bool and String 2022-11-25 01:28:31 +00:00
Brian Carroll
77ebaba4ff
wasm_interp: include immediates in --debug output 2022-11-25 01:13:32 +00:00
Richard Feldman
40bf022e02
Merge pull request #4586 from roc-lang/wasm-debug-tips
gen_wasm: Add debugging tips to readme
2022-11-24 19:41:31 -05:00
Brian Carroll
dd93e2e46f
wasm_interp: Print out return value(s), if any 2022-11-25 00:14:44 +00:00