Commit graph

654 commits

Author SHA1 Message Date
Richard Feldman
d3acf34415
Merge pull request #1591 from rtfeldman/single-quote-literal
Single Quote literal
2022-02-26 23:27:46 -05:00
Brendan Hansknecht
ffee5ab97a add some more tests, including failure for new line 2022-02-25 22:05:21 -08:00
Brendan Hansknecht
c025b8806b disable accidentally enabled test on dev backend 2022-02-25 21:07:20 -08:00
Brendan Hansknecht
39d070e543 flip platform flag to be default 2022-02-25 20:10:36 -08:00
Brendan Hansknecht
c13c8ece1f pipe target and roc_build features around 2022-02-25 11:37:44 -08:00
Brendan Hansknecht
f59b5cab95 fix undefined symbols in roc_std with platform feature 2022-02-25 11:05:08 -08:00
Brendan Hansknecht
cd0d89fdc9 Merge remote-tracking branch 'origin/trunk' into single-quote-literal 2022-02-25 07:39:58 -08:00
Tom Dohrmann
954064fa1e make more types more explicit 2022-02-25 13:58:07 +01:00
Tom Dohrmann
868316abb8 make types more explicit 2022-02-25 13:02:11 +01:00
Brendan Hansknecht
c327681ebc Wasmer: use cranelift for non-x86_64 since singlepass is not supported 2022-02-24 10:31:21 -08:00
Brendan Hansknecht
f7c0e2ef19 Merge remote-tracking branch 'origin/trunk' into single-quote-literal 2022-02-24 10:13:39 -08:00
Tom Dohrmann
788c8a6af2 reimplement RocList and RocStr 2022-02-23 16:02:13 +01:00
Brian Carroll
3952a7cc7c test_gen: Add comments to some extremely subtle test code 2022-02-21 22:52:50 +00:00
Brian Carroll
89b8926d27 gen_wasm: fix bug choosing the right proc specialization (#2549) 2022-02-21 22:52:45 +00:00
ayazhafiz
dd2b3097e1 Disable WASM test for now 2022-02-21 14:10:46 -05:00
ayazhafiz
475be2363c Add a gen test for #2535 2022-02-21 14:10:46 -05:00
Brendan Hansknecht
74daec84df
Merge pull request #2472 from rtfeldman/add_Int.toInt_builtins
Add `{Int *}.to{Int *}` builtins
2022-02-21 18:03:14 +00:00
Brian Carroll
e8571de1ae
Merge pull request #2517 from rtfeldman/repl-www
Web REPL initial version
2022-02-21 13:58:23 +00:00
Brian Carroll
603c98d1d9 wasm tests: use wasmer .unwrap_i32 2022-02-20 09:05:08 +00:00
Brian Carroll
a75aa52b91 repl_test: write Rust replacements for JS functions 2022-02-19 23:29:06 +00:00
ayazhafiz
ee37d8c4e0 Disable unimplemented int casts on wasm 2022-02-19 17:08:20 -05:00
ayazhafiz
25b355eb38 Fix cast tests 2022-02-19 16:24:49 -05:00
ayazhafiz
13067f2908 Implement Num.toNNNChecked
Closes #2411
2022-02-19 16:20:21 -05:00
ayazhafiz
d90915a8cd Implement Num.to* builtins
Just wrap over Num.intCast
2022-02-19 11:28:41 -05:00
Jan Van Bruggen
e12d98af98 WIP: Start adding new Int.toInt builtins 2022-02-19 11:28:12 -05:00
Folkert
5582644166
use str/list helpers to prepare for adding capacity 2022-02-18 22:23:05 +01:00
Folkert
04adbe75ca fix test compilation 2022-02-14 21:09:51 +01:00
hafiz
91483dbf55
Merge pull request #2471 from rtfeldman/fix_args_order
Swap arg order in `List` builtins to put the more-complex types first
2022-02-13 23:25:05 -05:00
ayazhafiz
6e5c1d5914 Specialize Num.toFloat for different target float types
Closes #2476
2022-02-13 20:20:25 -05:00
ayazhafiz
c831b99432 Add test for issue #1162
This was fixed some time ago; add a regression test.

Closes #1162
2022-02-13 14:02:39 -05:00
Jan Van Bruggen
f47dbb5171
Swap List.mapWithIndex arg1 args order to put the element first 2022-02-11 16:10:29 -07:00
Jan Van Bruggen
92e0f8714f
Swap List.repeat args order to put the list first 2022-02-11 16:10:29 -07:00
ayazhafiz
8c0e39211d Instantiate recursive aliases to their smallest closures
Now, when we have two aliases like

```
T a : [ A, B (U a) ]
U a : [ C, D (T a) ]
```

during the first pass, we simply canonicalize them but add neither to
the scope. This means that `T` will not be instantiated in the
definition of `U`. Only in the second pass, during correction, do we
instantiate both aliases **independently**:

```
T a : [ A, B [ C, D (T a) ] ]
U a : [ C, D [ A, B (U a) ] ]
```

and now we can mark each recursive, individually:

```
T a : [ A, B [ C, D <rec1> ] ] as <rec1>
U a : [ C, D [ A, B <rec2> ] ] as <rec2>
```

This means that the surface types shown to users might be a bit larger,
but it has the benefit that everything needed to understand a layout of
a type in later passes is stored on the type directly, and we don't need
to keep alias mappings.

Since we sort by connected components, this should be complete.

Closes #2458
2022-02-11 08:43:33 -05:00
Brian Carroll
cff762afe5 Fix test_gen llvm 2022-02-08 11:03:48 +00:00
Brian Carroll
c21b2bd0da Formatting and Clippy 2022-02-08 11:03:48 +00:00
Brian Carroll
85b418ebdf wasm: get rid of Result from gen_wasm, rename a function, improve comments 2022-02-08 11:03:48 +00:00
Brian Carroll
2fd2a85887 wasm: delete redundant enum TestType 2022-02-08 11:03:48 +00:00
Brian Carroll
c5ccc99e20 repl: rename Wasm32TestResult -> Wasm32Result 2022-02-08 11:03:48 +00:00
Brian Carroll
1783fa8009 repl: rename FromWasm32Memory -> FromWasmerMemory 2022-02-08 11:03:48 +00:00
Brian Carroll
e9871947d3 repl: move wasm32_test_result to gen_wasm, and extract Wasm32Sized from FromWasm32Memory 2022-02-08 11:03:48 +00:00
Brian Carroll
aaa5fa04cd wasm: delete obsolete code 2022-02-08 11:03:48 +00:00
ayazhafiz
40196185a0 Specialize zero-argument thunks with the correct variable
Previously we would pass the annotation down as the
type-to-be-monomorphized for, but that would just mean the annotation
would unify with itself. We instead want to use the variable the thunk
is being used as to be the one unified with the thunk's annotation.

Closes #2445
Closes #2446
2022-02-06 20:58:13 -05:00
ayazhafiz
ff3596505e Fix gen tests 2022-02-06 15:04:12 -05:00
Richard Feldman
9b05d8dd50
Move expect zig code out of utils 2022-02-02 19:15:47 -05:00
Richard Feldman
f8eec65229
Drop an obsolete todo 2022-02-01 20:43:43 -05:00
Richard Feldman
65244d6383
Fix unclosed brace 2022-02-01 08:43:47 -05:00
Richard Feldman
a55ff62e6c
Merge remote-tracking branch 'origin/trunk' into expect-dont-panic 2022-01-30 20:22:26 -05:00
Chelsea Troy
4f8d0776b3 We got a test working for panicking with the appropriate number fo failures. Ultimatly we want:
+ An error maessage that says what the failures were
+ Not panicking (so these are effectively error productions)
2022-01-30 18:55:09 -06:00
ayazhafiz
47a59c560c Make test use an i64 2022-01-29 15:04:22 -05:00
ayazhafiz
5943873654 Inline polymorphic calls at usage sites
This is a bit.. ugly, or at least seems suboptimal, but I can't think of
a better way to do it currently aside from demanding a uniform
representation, which we probably don't want to do.

Another option is something like the defunctionalization we perform
today, except also capturing potential uses of nested functions in the
closure tag of an encompassing lambda. So for example,

```
f = \x -> \y -> 1
```

would now record a lambdaset with the data `[Test.f
[TypeOfInnerClos1]]`, where `TypeOfInnerClos1` is e.g.
`[Test.f.innerClos1 I8, Test.f.innerClos1 I16]`, symbolizing that the
inner closure may be specialized to take an I8 or I16. Then at the time
that we create the capture set for `f`, we create a tag noting what
specialization should be used for the inner closure, and apply the
current defunctionalization algorithm. So effectively, the type of the
inner closure becomes a capture.

I'm not sure if this is any better, or if it has more problems.
@folkertdev any thoughts?

Closes #2322
2022-01-28 23:49:19 -05:00