Commit graph

205 commits

Author SHA1 Message Date
Sam Mohr
f857872903
Properly type constrain all function types 2024-11-21 04:09:47 -08:00
Sam Mohr
66cc96edbb
Address PR comments from @ayazhafiz 2024-10-29 15:58:35 -07:00
Sam Mohr
01369dc6d8
Add mono tests to validate refcounts with early return 2024-10-24 22:56:03 -07:00
Elias Mulhall
19931ecd43
Support passing values into dbg with the pipe operator
In order to desugar `dbg` in a pipeline we need to allow a bare `dbg`
node in desugaring and only report it as an error if the bare node
survives to the next step of canonicalization. This means we move the
error code out of `desugar_expr` and into `canonicalize_expr`. This is
much simpler to do now that these functions use the same `env` struct,
since previously we would have had to pass down extra args to
`canonicalize_expr`. Sharing the `env` struct means that we also don't
have to worry about calculating `line_info` more than once.
2024-09-05 20:13:54 -04:00
Agus Zubiaga
2469a3aa2d
Merge pull request #7050 from roc-lang/arg-patterns-as 2024-09-02 14:02:17 -03:00
Agus Zubiaga
458878dbea
Fix record as pattern mono test 2024-09-02 12:29:14 -03:00
Agus Zubiaga
e2bd31a549
Add mono tests for opaque pattern with as 2024-09-02 12:23:25 -03:00
Agus Zubiaga
ada24e4fd9
Add mono tests for record pattern with as 2024-09-02 12:17:53 -03:00
Anton-4
02cf61f985
Merge pull request #7038 from mulias/expr-dbg
Support `dbg` in expressions
2024-09-02 13:30:32 +02:00
Anton-4
7938e4bdc8
basic-cli 0.15, test fixes 2024-08-28 18:39:15 +02:00
Elias Mulhall
9dae102603 Allow dbg expression inside string interpolation 2024-08-28 11:53:44 -04:00
Elias Mulhall
220bb55048 Desugar dbg expression into a dbg statement
Use a temporary variable to print and then return the body of the dbg
expression.
2024-08-28 11:53:44 -04:00
Sam Mohr
12df3a04de
Merge attempt 2024-08-19 23:34:05 -07:00
Sam Mohr
50f6e11423
Deprecate backpassing to prepare for eventual removal 2024-08-16 22:36:04 -07:00
shua
67f555feea
test_mono, uitest: rm stdlib Json dependency
use the same tag len fmt introduced in test_gen/gen_abilities tests
2024-07-01 20:36:28 +02:00
Ayaz Hafiz
8cdb193301
Update stale document references 2024-06-26 02:16:20 -04:00
Agus Zubiaga
4e5fdfbf52
Handle root type when loading from str 2024-06-08 19:46:41 -03:00
JRI98
eebd4b21c3
Support guards on lists with rest 2024-04-30 13:25:18 +01:00
Brendan Hansknecht
6dc5bfb1b7
Use roc_target over target_lexicon
Tailors a target class for our needs.
Replaces tons of uses across the entire compiler.
This is a base for later adding new targets like thumb.
2024-03-31 10:50:26 -07:00
Richard Feldman
24a38c4a26
Merge remote-tracking branch 'origin/main' into remove-nat 2024-02-11 12:26:36 -05:00
Folkert de Vries
4cbdf08a2d
Merge pull request #6499 from JRI98/fix_6174
Don't skip closure captures when fixing them
2024-02-04 13:57:18 +01:00
Anton-4
b2b55876d3
Merge pull request #6488 from roc-lang/forgot-old-interpolation-syntax
update to new interpolation syntax
2024-02-04 11:03:34 +01:00
JRI98
be30e470a8
Don't skip closure captures when fixing them 2024-02-03 23:19:08 +00:00
JRI98
ad6900514b
Create symbols for struct fields before record update 2024-02-02 23:49:48 +00:00
Anton-4
3c7a834da1
update to new interpolation syntax 2024-02-02 13:39:10 +01:00
Richard Feldman
8f82bc38c0
Remove Nat from tests 2024-01-26 16:19:52 -05:00
Richard Feldman
4a38d3a1af
Remove Nat from some compiler tests that use lists 2024-01-26 16:06:08 -05:00
Anton-4
1126f85b5a
fix clippy unnecessary hashes 2024-01-01 16:38:36 +01:00
JRI98
689a1ff352
Fix list rest bind in when branch tuple destructure 2023-12-21 11:55:29 +00:00
Anton-4
eaa085fa93
more visible+better mono error 2023-12-13 17:38:20 +01:00
Brendan Hansknecht
e5a0af5699
make DbgFormatter an unexposed implementation detail 2023-12-03 12:41:04 -08:00
Brendan Hansknecht
9b181e1b3f
add inspect implementation for dict and set 2023-11-28 16:40:42 -08:00
Brendan Hansknecht
32c3d49e85
ignore unimlemented ability test case 2023-11-28 16:40:42 -08:00
Brendan Hansknecht
21b68a2e27
add a set of currently failing mono tests for inspect 2023-11-28 16:40:42 -08:00
Elias Mulhall
0ccc71389a
move pattern desugar tests to test_mono 2023-11-26 20:26:43 -05:00
Isaac Van Doren
139d3c6f89
make dropFirst and dropLast drop n elements 2023-10-29 13:23:33 -05:00
Richard Feldman
2da41be29f
Merge remote-tracking branch 'origin/main' into abilities-syntax 2023-08-10 20:36:01 -04:00
Ayaz
b36ad76cdd
Merge pull request #5576 from roc-lang/spike-erasure
Implement function erasure
2023-07-17 03:27:29 -05:00
Folkert
48fa4f7a8e
When possible, prefer NonNullableUnwrapped over NullableWrapped
e.g. in the scenario of `[ A Str, B, C, D ]`, rather than having one tag be nullable, we want
to store the tag id in the pointer. This generally saves 8 bytes for
every allocation, and prevents an allocations for all tags except A.
2023-07-16 20:06:46 +02:00
Ayaz Hafiz
44c4797d9a
Parameterize program solving on a FunctionKind
This new flag determines whether we should introduce a new kind to
represent lambda sets, or whether lambdas should be erased. The latter
is not yet implemented.
2023-07-12 13:53:50 -05:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Ayaz Hafiz
a5e1558a6e
Do not drop uninhabited captures from lambda sets
Previously, we would drop uninhabited captures from lambda sets' runtime
representations, which meant sets like

```
[L1 {a: Str}, L2 {a: []}]
```

had runtime representation

```
{Str}
```

rather than

```
Union({Str}, {[]})
```

if we drop unreachable lambdas from the representation, then the
reachable lambdas are somewhat more efficient to compile (as there are
less material tag options), but the compiler complexity increases
because we must represent voided capture sets in the lambda set.

Even if a lambda has voided captures, we must specialize it, because
failing to do so opens us up to losing relevant specializations needed
later on. See 2f7020aa31 for a
previous occurence of that.

As such, simply keep voided layouts in place during lambda set
compilation. The optimizer should elide them anyway.
2023-06-29 17:32:50 -05:00
Folkert
ae47cc5171
in TRMC, still apply normal TCE 2023-06-24 19:45:44 +02:00
Folkert
9c85fb90d3
fix bugs 2023-06-24 14:49:47 +02:00
Folkert
4a9514d2c4
rough implementation 2023-06-24 14:49:46 +02:00
Ayaz Hafiz
c91b82198d
Use correct variable when compiling dbg continuation
Closes #5479
2023-06-13 16:45:02 -05:00
Folkert
ed3551a14c
make more mono tests use larger stack 2023-06-10 23:58:42 +02:00
J.Teeuwissen
46bff75517
progress 2023-06-10 23:55:09 +02:00
J.Teeuwissen
d735742fdb
used resulting incremented_symbols 2023-06-10 23:54:00 +02:00
J.Teeuwissen
94fb89bde4
Start drop specialisation for joinpoints 2023-06-10 23:53:19 +02:00