Commit graph

474 commits

Author SHA1 Message Date
Ayaz Hafiz
251b3865d9
Implement tag union discriminant extraction for byte- and newtype-variants 2022-10-04 18:04:46 -05:00
Ayaz Hafiz
fd54cdfdd1
Low-level to extract discriminant from a tag union 2022-10-04 16:17:05 -05:00
Ayaz Hafiz
f2c30a699c
Remove stray dbg 2022-10-04 14:09:40 -05:00
Ayaz Hafiz
5b833e57b5
Support derivation of Hash for Str and List 2022-10-04 14:09:40 -05:00
Ayaz
211c297230
Merge pull request #4041 from KilianVounckx/opaque-bool
Opaque bool
2022-09-21 11:15:41 -05:00
Ayaz Hafiz
b3167ad49b
Clippy 2022-09-20 14:42:08 -05:00
Ayaz Hafiz
447e1492e1
Work around symbol specializations not getting captured 2022-09-20 14:42:08 -05:00
Ayaz Hafiz
b797e9c0c8
Admit non-trivial holes 2022-09-20 14:42:08 -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
Folkert
639c1e5fa3
get rid of UnitWithArguments 2022-09-19 16:49:55 -05:00
Ayaz Hafiz
d2cc1041aa
Unused import 2022-09-16 10:25:31 -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
Anton-4
f2ee8a441d
rust 1.63, clippy 2022-09-10 20:12:34 +02:00
Folkert de Vries
8bbeb34792
Merge pull request #3981 from roc-lang/use-copy-table
Cache variables sent to a module's external specializations in mono
2022-09-07 12:28:17 +02:00
Ayaz Hafiz
eebe5234f6
Correctly perform record updates that come from thunks
Closes #3908
2022-09-06 18:07:22 -05:00
Ayaz Hafiz
53e1551cd1
Move external specializations storage subs into its own struct 2022-09-06 14:33:41 -05:00
Ayaz Hafiz
882d589d5f
Basic caching of variables saved into storage subs 2022-09-06 14:11:03 -05:00
Ayaz Hafiz
3a130acc32
Fix mut in test 2022-08-31 15:01:01 -05:00
Ayaz Hafiz
c2d042eba2
Stray dbg 2022-08-31 14:53:52 -05:00
Ayaz Hafiz
95765bcb1e
Intern the lambda set representation 2022-08-31 14:50:56 -05: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
ed04c2040a
Push the layout interner through the backends 2022-08-31 14:33:52 -05:00
Ayaz Hafiz
c5466810a4
Add LayoutInterner to LayoutCache
Adds a thread-local interner of layouts to LayoutCache, and updates all
references appropriately.

This is a bit suboptimal for single-threaded workloads that will look at
creating layout caches again, like the REPL, but I think that's okay for
now - since the global interner will be uncontested for those workloads, it
should still be plenty fast to access the interner, even behind a lock.
2022-08-31 14:33:51 -05:00
Ayaz Hafiz
261cd75a71
Invalidate layout-cached variables correctly after merging 2022-08-31 14:33:50 -05:00
Ayaz Hafiz
7a7a4fa680
Use fnv hasher for layout cache 2022-08-31 14:26:16 -05:00
Ayaz Hafiz
c57fe24805
Use OptVariable rather than Option<Variable> 2022-08-31 14:23:50 -05:00
Ayaz Hafiz
9b1f3e6fde
Remove unused marker 2022-08-31 14:17:38 -05:00
Ayaz Hafiz
9fb9ca4cbc
return result, not cacheable 2022-08-31 14:17:15 -05:00
Ayaz Hafiz
7c215f9273
Remove stray dbgs 2022-08-31 14:17:15 -05:00
Ayaz Hafiz
ea2e5d171a
Invalidate layout-cached variables correctly after merging 2022-08-31 14:17:14 -05:00
Ayaz Hafiz
66e65714b9
Fix release errors 2022-08-31 14:16:44 -05:00
Ayaz Hafiz
d13b556295
Trace stats for layout cache 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
c2a0b878d3
Clippy 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
22a4a4dfbc
Relay metadata back when using cached result 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
7b8e1e1d53
Even more inline aggression 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
c53719eb95
Debug non-reused recursive structures 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
e24cdb8272
Be far more aggressive about cache inlining 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
a64d9d97c5
Do not reuse cached entries for recursive structures that are being reconstructed 2022-08-31 14:16:43 -05:00
Ayaz Hafiz
caf4a80542
Clippy 2022-08-31 14:16:42 -05:00
Ayaz Hafiz
3ce4c6c77d
Typo 2022-08-31 14:16:42 -05:00
Ayaz Hafiz
3856ea6199
Implement a cache policy - don't cache recursive pointers without a recursive layout 2022-08-31 14:16:42 -05:00
Ayaz Hafiz
eb5ec2bd98
Don't account for recursive unions in non-recursive layout gen 2022-08-31 14:16:42 -05:00
Ayaz Hafiz
d757701426
First pass at layout caching 2022-08-31 14:16:42 -05:00
Ayaz Hafiz
8b0f7dc82f
Propagate layout_cache throughout Env in generating layout
Sets up actually using the LayoutCache to get cached layouts.
2022-08-31 14:16:42 -05:00
Folkert
d93d42da8c
make chasing an ext return a custom type 2022-08-30 00:51:24 +02:00
Folkert de Vries
acb71d6007
Merge pull request #3835 from roc-lang/ext-vars-in-derivers
Support bound and unbound extension variables in deriving
2022-08-30 00:34:50 +02:00
Folkert de Vries
51d5aa789a
Merge pull request #3870 from roc-lang/dev-backend-div
add int/float division to the dev backend
2022-08-25 09:03:19 +02:00