Ayaz Hafiz
af81ceae38
Add method to grab default compilation width of a number
2022-11-16 13:54:48 -06:00
Ayaz Hafiz
281bc94b55
Remove FlatType::Erroneous
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
05e8e6de6f
Disallow typing optional fields when required fields are annotated
...
Closes #4313
2022-10-18 15:50:20 -05:00
Ayaz Hafiz
729f0a8e27
Remove return
on unreachable result
2022-10-12 16:37:50 -05:00
Ayaz Hafiz
bc2f4569aa
Able variables that are never used can become void
2022-10-12 16:37:50 -05:00
Ayaz
83b64c4fb3
Merge pull request #4209 from roc-lang/impl-tag-discriminant
...
Derive `Hash` implementations for tag unions
2022-10-10 22:23:05 -05:00
Ayaz Hafiz
61cf8e53e6
Have FunctionOrTagUnion include multiple possible tags
2022-10-05 17:24:52 -05:00
Ayaz Hafiz
251b3865d9
Implement tag union discriminant extraction for byte- and newtype-variants
2022-10-04 18:04:46 -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
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
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
Ayaz Hafiz
3b2e3d515f
Include var in lambda set size traces
2022-08-23 15:42:01 -05:00
Ayaz Hafiz
b3f8ead89d
Add tracing of lambda set sizes in mono layout
2022-08-23 15:20:39 -05:00
Ayaz Hafiz
a8bd529664
Support derivers for tag unions with ext vars
2022-08-23 10:41:06 -05:00
Ayaz Hafiz
0606086eb6
Compare values with runtime representation
2022-08-19 22:16:41 -05:00
Ayaz Hafiz
64fc60f55f
Make lambda set set
private
2022-08-19 22:16:41 -05:00
Ayaz Hafiz
a93735473a
Describe how a enum lambda set should be switched in the representation
2022-08-19 22:16:40 -05:00
Ayaz Hafiz
d4a79780b3
Determine whether to extend lambda set arg to call args by checking call options
2022-08-19 22:16:40 -05:00
Ayaz Hafiz
62dde549e6
Determine whether lambda set is represented as an arg
2022-08-19 22:16:40 -05:00
Ayaz Hafiz
fc4979e2ce
Add ClosureCallOptions enum to describe how to switch calling lambda
2022-08-19 22:16:40 -05:00