Commit Graph

142 Commits

Author SHA1 Message Date
Ayaz Hafiz
01dea13b49
Pretty print symbols 2022-12-03 22:33:45 -06:00
Ayaz Hafiz
7b21936d4f
Add mono checker to tests 2022-12-03 22:10:37 -06:00
Ayaz Hafiz
7562525e96
Bugfix match 2022-12-02 16:31:47 -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
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
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
Richard Feldman
b2beeb770e
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-25 19:50:06 -05:00
Ayaz Hafiz
cb7de132e5
Update mono 2022-11-24 14:46:54 -06:00
Ayaz Hafiz
7e975b9111
Update mono tests 2022-11-24 14:46:53 -06:00
Ayaz Hafiz
220c8a8e64
Add a crash test to mono 2022-11-24 14:46:51 -06:00
Ayaz Hafiz
c7ef1668d4
Implement mono of crash 2022-11-24 14:46:51 -06:00
Richard Feldman
f5cb2d73a1
Merge branch 'precompiled-legacy' into https-packages 2022-11-24 04:29:56 -05:00
Ayaz Hafiz
40da261dfd
Mark mono test 2022-11-22 12:57:32 -06:00
Ayaz Hafiz
91ceebc065
Fix imports 2022-11-22 11:00:14 -06:00
Richard Feldman
721841fa1f
Provide roc_cache_dir everywhere 2022-11-20 19:53:48 -05:00
Folkert de Vries
de472015f6
Merge pull request #4505 from roc-lang/fix-web-repl-palette
Fix web REPL error formatting by routing the active Palette everywhere
2022-11-15 15:49:37 +01:00
Folkert
662bf1de99
more workspace dependencies 2022-11-13 16:10:02 +01:00
Brian Carroll
894697b284
Build fixes 2022-11-12 08:46:18 +00:00
Luke Boswell
2c2a70b8e7 Merge remote-tracking branch 'upstream/main' into rust-docs 2022-11-06 09:15:57 +11:00
Richard Feldman
8dfdddbedc
Update mono...for some reason 2022-11-04 17:18:32 -04:00
Ayaz
0b6b16563f
Merge pull request #4451 from roc-lang/fix-mono-tests
Consolidate mono test behavior in debug and release modes
2022-11-03 22:11:43 -05:00
Folkert
66a1ba00eb
1.65 clippy fixes 2022-11-03 16:20:37 +01:00
Luke Boswell
f3bdb5f321
updating rust package documentation 2022-11-03 20:00:06 +11:00
Ayaz Hafiz
204ac2f8b4
Consolidate mono test behavior in debug and release modes
Makes sure that we turn on `debug-symbols` in mono tests, and that this
feature is fully respected in symbol generation, so that output in
release + debug builds are the same.

Closes #4435
2022-11-02 15:04:47 -05:00
Ayaz Hafiz
822aa71a0a
Compute list element stores lazily 2022-11-01 15:37:36 -05:00
Ayaz Hafiz
27b9dd8253
Simplify arity and branching calculation 2022-11-01 15:33:23 -05:00
Ayaz Hafiz
45f7cd5ad7
Make sure to update path of matched list 2022-11-01 15:22:31 -05:00
Ayaz Hafiz
ae71c7efe2
Decision tree compilation of list patterns 2022-11-01 15:22:31 -05:00
Ayaz Hafiz
ca4ee908f8
Avoid shadowing Hash in mono tests 2022-10-04 10:23:39 -05:00
Ayaz Hafiz
fda485431f
Update mono test 2022-09-21 13:41:20 -05:00
Ayaz Hafiz
2037ad22fd
Update encode mono test 2022-09-21 13:40:50 -05:00
Ayaz Hafiz
dc70c1b0b0
Update mono tests 2022-09-21 13:39:10 -05:00
Ayaz
211c297230
Merge pull request #4041 from KilianVounckx/opaque-bool
Opaque bool
2022-09-21 11:15:41 -05:00
Ayaz Hafiz
0abfca401a
Update mono tests 2022-09-20 14:42:08 -05:00
kilianv
08c238ff27
Generate new files in test_mono after changing to opaque bools 2022-09-20 14:42:05 -05:00
kilianv
9717747a54
Update tests
not all tests pass yet. Will look at them with Ayaz.
2022-09-20 14:42:03 -05:00
Ayaz Hafiz
2f7020aa31
Eliminate voided branches only after resolving their bodies' specializations 2022-09-20 08:35:10 -05:00
Ayaz Hafiz
f41936d5e5
Unwrap layouts containing void layouts as newtypes
Addresses the attempt to do so in https://github.com/roc-lang/roc/pull/3465

Co-authored-by: Folkert <folkert@folkertdev.nl>
2022-09-19 16:50:49 -05:00
Ayaz Hafiz
be853b65c5
Support unification of extension types with uninhabited branches 2022-09-19 10:32:39 -05:00
Ayaz Hafiz
ac752adc7c
Check in some more work 2022-09-16 16:09:21 -05:00
Ayaz Hafiz
a81d4d4be2
Allow any numeric range to become a float
Currently things like `1 / 200` lead to a miscompilation because we type
`200` (and as a result, both `1` and the division result) as a ranged
number with width >= U8. During mono that forces the number to become an
`I64` because our logic was that a ranged number can only become a float
if it's at least as wide as an I8. But this is incorrect; as long as the
type is wrapped in `Frac` constructor and it's a ranged number (and not
a ranged int), it should become a fractional type.

```
» 1 / 200

0.005 : Float *
```

Closes #4047
2022-09-16 10:05:43 -05:00
dependabot[bot]
0079048944
Bump bumpalo from 3.10.0 to 3.11.0
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases)
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.10.0...3.11.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 21:08:56 +00:00
Ayaz Hafiz
1e49622b61
Clippy 2022-08-31 14:36:44 -05:00
Ayaz Hafiz
3b4b1838b8
Push layout interner further through Layout 2022-08-31 14:33:52 -05:00
Ayaz Hafiz
2b9013c5f5
Add roc_tracing to test_mono 2022-08-23 13:11:30 -05:00
Ayaz Hafiz
d8a8dff70d
Treat unwrapped capture sets as unwrapped directly 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
68bb03ec09
Update mono tests 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
fc4979e2ce
Add ClosureCallOptions enum to describe how to switch calling lambda 2022-08-19 22:16:40 -05:00
dependabot[bot]
4c6ad52c47
Bump indoc from 1.0.6 to 1.0.7
Bumps [indoc](https://github.com/dtolnay/indoc) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.6...1.0.7)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 13:18:18 +00:00
Richard Feldman
58c3575e44
Fix mono tests 2022-08-12 15:28:05 -04:00