Commit graph

1777 commits

Author SHA1 Message Date
Richard Feldman
4ea4aa4708
Merge pull request #2838 from rtfeldman/abilities-typechecking
Inference and checking for abilities
2022-04-13 22:03:44 -04:00
Richard Feldman
75ed66b4a8
Merge pull request #2843 from rtfeldman/i/2812
Propogate errors in record fields to layout error
2022-04-13 21:56:53 -04:00
Ayaz Hafiz
41dd7d0b4d
Specialize bodies with body var, not function var
I'm surprised code generation worked so well without this, before...

Closes #2818
2022-04-13 18:35:50 -04:00
Ayaz Hafiz
6343382af5
Propogate errors in record fields to layout error
Closes #2812

Unfortunately we don't have a great way to test this without scaffolding
a host since this happens while processing a variable exposed to the
host. In tests the root cause just yields a type error first and codegen
works, just bails during the runtime. But this works.
2022-04-13 16:23:13 -04:00
Ayaz Hafiz
15a040ec87
Basic type inference and solving for abilities
Note that is still pretty limited. We only permit opaque types to
implement abilities, abilities cannot have type arguments, and also no
other functions may depend on abilities
2022-04-12 16:18:07 -04:00
Folkert de Vries
7675e0232b
Merge pull request #2819 from rtfeldman/zero-arg-tag
Drop unused `arguments` field from `ZeroArgumentTag`
2022-04-10 15:18:03 +02:00
Ayaz Hafiz
a102a7497e
Support box/unbox for types that are typically only on the stack
Closes #2786
2022-04-09 16:22:01 -04:00
Folkert de Vries
5dc8c852e9
Merge pull request #2815 from rtfeldman/i/2811
Specialize polymorphic values before binding to pattern
2022-04-08 21:44:11 +02:00
Ayaz
69ed0b755a
Merge pull request #2804 from rtfeldman/abilities-canonicalization
Basic canonicalization, error checking for abilities
2022-04-08 12:00:23 -04:00
Richard Feldman
b777b88e1c
Drop unused arguments field from ZeroArgumentTag 2022-04-08 11:53:16 -04:00
Ayaz
33a5fc65ce
Update comment 2022-04-08 08:50:31 -04:00
ayazhafiz
94a5cd3559 Improve shadow errors 2022-04-07 22:38:20 -04:00
Ayaz Hafiz
73bfff699f Handle symbols that shadow ability member definitions
Just add the shadowing symbol for now. We'll handle checking that a
specialization's type matches the member's type definition in a later
pass, during typechecking.
2022-04-07 17:21:17 -04:00
Richard Feldman
cd00a98636
Add toF32/64 and checked versions 2022-04-07 16:13:57 -04:00
Ayaz Hafiz
a12e40a310
Specialize polymorphic values before binding to pattern
Closes #2811
2022-04-07 14:03:29 -04:00
Brian Carroll
2b74e55240 Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-higher-order-calls 2022-04-07 09:03:34 +01:00
Brian Carroll
51789f38c2 wasm: generate RC inc for higher order builtins 2022-04-05 00:02:05 +01:00
Folkert
68536e4026
Merge remote-tracking branch 'origin/trunk' into list-str-capacity 2022-04-04 19:55:04 +02:00
Folkert
0dd2cec09a
update with new clippy lints 2022-03-31 19:34:51 +02:00
Folkert
61aeaefc76
a start with 32-bit linux support 2022-03-30 23:55:34 +02:00
Folkert
5a3be2adf4
give correct stack size without alignment for tags 2022-03-30 19:18:16 +02:00
Folkert
fd209f90ff
fix bug where incorrect stack size is given 2022-03-30 17:25:28 +02:00
Folkert
c73c01aa34
Merge remote-tracking branch 'origin/trunk' into list-str-capacity 2022-03-30 14:07:17 +02:00
Folkert
71c11784a0
step 1: Deriv works and has no valgrind problems 2022-03-26 17:56:56 +01:00
Folkert
269d31b9ae
Revert "void type is not passed by-reference"
This reverts commit 0d89b9f37f.
2022-03-26 13:43:28 +01:00
Folkert
0d89b9f37f
void type is not passed by-reference 2022-03-26 13:13:25 +01:00
Brian Carroll
d479d1efb9 Formatting 2022-03-20 23:31:38 +00:00
Brian Carroll
5de539b9fa mono: Generate IR for refcount reset procedures 2022-03-20 22:48:23 +00:00
Brian Carroll
9b6b81a438 WIP 2022-03-20 11:17:34 +00:00
Brian Carroll
4c7aeb69a4 mono: add rc reset procs to code_gen_help 2022-03-19 09:25:24 +00:00
Folkert
6134e57921
Merge remote-tracking branch 'origin/trunk' into list-str-capacity 2022-03-18 18:13:55 +01:00
Folkert
a3b00fbf55
Merge branch 'explicit-closed-tag-record' into delay-instantiating-aliases 2022-03-17 20:34:52 +01:00
Folkert
7d8409f6a6
write Aliases implementation 2022-03-15 22:02:04 +01:00
ayazhafiz
73396c0607 aliases->references in partial procs 2022-03-15 11:05:59 -05:00
ayazhafiz
93804bb04c Unnecessary let binding 2022-03-14 17:44:07 -05:00
ayazhafiz
17029cff7e Link aliased lambdas to the partial procs of the original symbol
This ensures that we use the correct specialized variable at the call
site of a function. In #2725 what happened was that a generalized
function was aliased, causing it to undergo generalization again. Then,
we lost the variable used to specialize at the call site. Instead, just
link to the partial proc being aliased directly.

There is an added benefit here, which is that we can avoid the
possibly-quadratic replacement of symbols in the generated statement.

Closes #2725
2022-03-14 16:42:53 -05:00
ayazhafiz
2d01c21b5c Codegen tags that are polymorphic because of rigids
Closes #2724
2022-03-14 15:25:25 -05:00
Brendan Hansknecht
203bbca185 fix str and list layout in refcount proc generation 2022-03-11 12:32:04 -08:00
Brian Carroll
456d8ff9cb Merge branch 'trunk' of github.com:rtfeldman/roc into list-str-capacity 2022-03-11 19:28:13 +00:00
Brian Carroll
e4829b5b85 mono: Update Str refcount helpers to account for capacity field 2022-03-11 08:34:27 +00:00
Folkert de Vries
59378d35c6
Update compiler/mono/src/borrow.rs
Co-authored-by: hafiz <20735482+ayazhafiz@users.noreply.github.com>
2022-03-09 15:08:13 +01:00
Folkert
07063a8e18
Merge remote-tracking branch 'origin/trunk' into list-str-capacity 2022-03-09 14:36:34 +01:00
Folkert
6543c9bbc6
Merge remote-tracking branch 'origin/trunk' into box-all-the-things 2022-03-09 00:00:15 +01:00
Folkert
a3d56bce3a
layout of Box a 2022-03-08 22:21:25 +01:00
Folkert
f2b8c89878
clippy 2022-03-08 22:21:13 +01:00
Folkert
92f2927046
initial implementation 2022-03-08 19:09:42 +01:00
Derek Gustafson
c65e3d2bae
Fix how dec is formatted in mono ir. 2022-03-07 16:17:59 -05:00
Derek Gustafson
ba6b225761
Hide RocDec implemntation details. 2022-03-07 15:34:02 -05:00
Folkert
b3b3b8790c
add new Expr variants 2022-03-07 21:13:48 +01:00
Folkert
3510bad1d5
add scaffolding 2022-03-07 20:55:40 +01:00