Commit graph

152 commits

Author SHA1 Message Date
Ayaz Hafiz
ce5ca4a93c
Mark emplace_variable as must_use 2022-11-16 14:05:52 -06:00
Ayaz Hafiz
27c2bd025d
Remove debug_assertions requirement 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
9a7402f40b
Add Subs.dbg 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
2d57aa2170
Use thread-local buffer for occurs check seen variables
This materially improves performance for programs that are
recursion-heavy (as most Roc programs will likely be).

```
$ hyperfine '/tmp/roc-old check examples/cli/cli-platform/Arg.roc' '/tmp/roc-new check examples/cli/cli-platform/Arg.roc' --warmup 10
Benchmark 1: /tmp/roc-old check examples/cli/cli-platform/Arg.roc
  Time (mean ± σ):      53.8 ms ±   1.3 ms    [User: 87.3 ms, System: 10.8 ms]
  Range (min … max):    52.2 ms …  60.4 ms    51 runs

Benchmark 2: /tmp/roc-new check examples/cli/cli-platform/Arg.roc
  Time (mean ± σ):      45.0 ms ±   1.6 ms    [User: 59.4 ms, System: 11.3 ms]
  Range (min … max):    42.6 ms …  49.8 ms    60 runs

Summary
  '/tmp/roc-new check examples/cli/cli-platform/Arg.roc' ran
    1.20 ± 0.05 times faster than '/tmp/roc-old check examples/cli/cli-platform/Arg.roc'
```

The time spent in `occurs` during checking for `Arg` drops from 50% to 23%.
2022-11-15 17:52:12 -06:00
Ayaz Hafiz
ce160f28a2
Chase under aliases during occurs checking
Closes #4368
2022-11-15 16:22:01 -06:00
Ayaz Hafiz
b30e8fc9b2
Remove Cells from Types 2022-11-15 09:00:16 -06:00
Ayaz Hafiz
f4fcb9f421
Fix Types types 2022-11-14 15:37:25 -06:00
Ayaz Hafiz
28f4b1ac56
Allow lints 2022-11-14 15:15:21 -06:00
Ayaz Hafiz
5564796927
SoA Types get variable emplacement (!)
We're now reaching the steady state we want to be closert to - when a
type is translated to a variable, emplace the variable we created for it
in the type index, so that types are never converted again!
2022-11-14 15:15:19 -06:00
Folkert
662bf1de99
more workspace dependencies 2022-11-13 16:10:02 +01:00
Ayaz Hafiz
54f4a70a0b
Explain evil 2022-11-11 21:16:23 -06:00
Ayaz Hafiz
a2e90c3709
Fix types SoA usage in solve 2022-11-11 21:16:23 -06:00
Ayaz Hafiz
6b5f632364
[skip-ci] Fix borrow issues in constraining 2022-11-11 21:16:22 -06:00
Ayaz Hafiz
59d2de5a55
Constrain with Types SoA, sans borrow checker 2022-11-11 21:16:05 -06:00
Ayaz Hafiz
6f6a90320e
Store types on ConstrainedModule 2022-11-11 21:16:01 -06:00
Ayaz Hafiz
80a05be8e5
Pretty-printer for debug representation of SoA types
```
[roc_load 0.0.1] [crates/compiler/solve/src/solve.rs:331] types.dbg(typ) = (`List.List` (`Num.U8`)), 68 -70->
[roc_load 0.0.1]   (`Decode.DecodeResult` 69
[roc_load 0.0.1]     ==> {result!: `Result.Result` 69 (`Decode.DecodeError` ==> [TooShort]73),
[roc_load 0.0.1]          rest!: `List.List` (`Num.U8`)})
```
2022-11-09 13:34:59 -06:00
Ayaz Hafiz
6071ef9696
Update use of Error tag 2022-11-08 14:12:45 -06:00
Ayaz Hafiz
28c3709ddf
Miscellaneous cleanup 2022-11-08 14:11:26 -06:00
Ayaz Hafiz
1b38cd0504
s/Type::Erroneous/Type::Error 2022-11-08 14:11:26 -06:00
Ayaz Hafiz
c1237215ea
Remove type Problem enum 2022-11-08 14:11:25 -06:00
Ayaz Hafiz
09748aec48
Remove problems from error type API surface 2022-11-08 14:11:25 -06:00
Ayaz Hafiz
b6322ff883
Report empty problems in translating to error type 2022-11-08 14:11:25 -06:00
Ayaz Hafiz
c4bd9fb79d
Remove problems from Subs 2022-11-08 14:11:25 -06:00
Ayaz Hafiz
281bc94b55
Remove FlatType::Erroneous 2022-11-08 14:11:25 -06:00
Ayaz Hafiz
1974d8e848
Add comment on missing reporting 2022-11-08 14:11:24 -06:00
Ayaz Hafiz
fd80f5b70e
Remove problem in alias instantiation 2022-11-08 14:11:24 -06:00
Ayaz Hafiz
c9953129cb
Remove problem storage in Type::Erroneous 2022-11-08 14:11:24 -06:00
Ayaz
b984351514
Merge pull request #4489 from roc-lang/types-soa-more-in-solve
Types SoA for aliases instantiated during solving
2022-11-08 14:06:57 -06:00
Folkert de Vries
95f8bac859
Merge pull request #4485 from roc-lang/types-soa
Types SoA and Type -> Variable conversion via SoA
2022-11-08 20:32:27 +01:00
Ayaz Hafiz
7034a4d692
Types SoA for aliases instantiated during solving 2022-11-08 12:57:30 -06:00
Ayaz Hafiz
b0bcda4117
typo 2022-11-08 09:00:25 -06:00
Ayaz Hafiz
db8e135a05
Simplify AbilitySet storage 2022-11-08 09:00:25 -06:00
Ayaz Hafiz
b7af241538
Address clippy for Types 2022-11-08 09:00:25 -06:00
Ayaz Hafiz
e240b18b27
Recover Erroneous in type 2022-11-08 09:00:25 -06:00
Ayaz Hafiz
58020a55d6
Type to variable through Types SoA 2022-11-08 09:00:24 -06:00
Ayaz Hafiz
5da11d7fdd
Index into Types 2022-11-08 09:00:24 -06:00
Ayaz Hafiz
dad9a8e537
Pass Types SoA repr in types to Variable translation 2022-11-08 09:00:24 -06:00
Folkert
93b9130edf
Type soa and conversion from existing data structure 2022-11-08 09:00:24 -06:00
Luke Boswell
2c2a70b8e7 Merge remote-tracking branch 'upstream/main' into rust-docs 2022-11-06 09:15:57 +11:00
Folkert
134de80150
various updates 2022-11-03 17:18:27 +01: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
9ab5d0efb8
Constraining of list patterns 2022-10-31 17:05:08 -05:00
Ayaz Hafiz
b0a8b85de3
Canonicalization of list patterns 2022-10-31 17:04:47 -05:00
Ayaz Hafiz
a526fd92aa
inferred extension vars are material if they're not flex or empty 2022-10-31 09:38:22 -05:00
Ayaz Hafiz
4f367e2608
Clippers lose to the Thunder, I lose to Clippy 2022-10-31 09:38:22 -05:00
Ayaz Hafiz
9854f5f2ac
Print alias's underlying structures if OIOP vars are material 2022-10-31 09:38:22 -05:00
Ayaz Hafiz
debe6332c5
Support OIOP for type aliases 2022-10-31 09:38:21 -05:00
Ayaz Hafiz
85e58440de
Allow too many args 2022-10-31 09:37:41 -05:00
Ayaz Hafiz
4d48ea7c2f
Materialize extension variable polarity in error type reporting 2022-10-31 09:37:40 -05:00