Commit Graph

3710 Commits

Author SHA1 Message Date
Richard Feldman
8bbc3ad925
Drop Program and third type param from Task 2022-11-24 03:21:14 -05:00
Richard Feldman
28bccb792f
Merge remote-tracking branch 'origin/main' into precompiled-legacy 2022-11-24 02:20:50 -05:00
Richard Feldman
d925e43465
Drop unused parameter 2022-11-24 02:15:40 -05:00
Richard Feldman
e8f5c13cf9
Consider linking type in preprocessed_host_path 2022-11-24 02:14:46 -05:00
Richard Feldman
9627946144
Drop redundant file copy 2022-11-24 02:10:09 -05:00
Ayaz
3059fd31c9
Merge branch 'main' into specialization-sets-for-impl-opaques
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2022-11-23 17:12:04 -06:00
Ayaz Hafiz
7c3a0807c2
Suggest binding type variables to an ability when they're unsatisfied 2022-11-23 16:37:50 -06:00
Folkert
51c018b03c
fix compile error in tests 2022-11-23 23:24:53 +01:00
Folkert
1875176319
improve formatting 2022-11-23 23:16:37 +01:00
Folkert
e44a8a9eed
print all the relevant info 2022-11-23 22:58:58 +01:00
Folkert
e7f3c6f281
inline dbg 2022-11-23 21:23:28 +01:00
Folkert
dcb530d3af
Revert "toplevel debug"
This reverts commit 5ea8d96f3e.
2022-11-23 20:29:55 +01:00
Folkert
5ea8d96f3e
toplevel debug 2022-11-23 20:29:45 +01:00
Folkert de Vries
df7f57e4a3
Merge pull request #4563 from roc-lang/fix-recursion-checks-of-inferred-vars
Force occurs check for introduced types after checking annotated bodies
2022-11-23 13:02:50 +01:00
Folkert de Vries
099ab4938f
Merge pull request #4565 from roc-lang/more-standalone
Use include_bytes! so builtin hosts live in binary
2022-11-23 13:01:39 +01:00
Richard Feldman
e1959d0a84
Fix wasm host_input_path generation 2022-11-23 00:38:54 -05:00
Richard Feldman
04e3ac37f4
Fix wasm host_dest name generation 2022-11-23 00:06:43 -05:00
Richard Feldman
c0b065b51a
Fix a couple of preprocessed host bugs 2022-11-22 23:38:07 -05:00
Richard Feldman
d9f3e11634
Add wasm32 support to preprocessed_host_filename 2022-11-22 23:02:12 -05:00
Richard Feldman
bcf53e58fe
Fix a missing to_str() on Windows 2022-11-22 22:44:42 -05:00
Richard Feldman
928495072c
Add dbg to sort_can_defs 2022-11-22 21:37:39 -05:00
Richard Feldman
73a591743b
Add parser tests for dbg 2022-11-22 21:27:10 -05:00
Richard Feldman
dcb7ab97c2
Fix a regression in a macOS workaround 2022-11-22 21:12:40 -05:00
Richard Feldman
49f8768271
Parse and format dbg 2022-11-22 21:08:26 -05:00
Richard Feldman
4e50d3fe2e
Fix a missing .to_str() 2022-11-22 20:58:17 -05:00
Richard Feldman
18fdc54022
Update error message 2022-11-22 20:55:05 -05:00
Richard Feldman
a8b6fa051a
Centralize host tempfile builder logic 2022-11-22 20:52:44 -05:00
Richard Feldman
0b73ea69af
Make sure tempfiles don't get dropped too early 2022-11-22 20:22:08 -05:00
Richard Feldman
6b446fe592
Avoid an unused variable warning 2022-11-22 19:25:15 -05:00
Richard Feldman
9c1291d57d
Give tempfiles the file extensions Zig expects 2022-11-22 19:19:54 -05:00
Richard Feldman
16fd39c4f7
Missed a couple of .to_str().unwrap()s 2022-11-22 18:51:01 -05:00
Richard Feldman
2d83c95d23
Only reference native host binaries (for now) 2022-11-22 18:40:08 -05:00
Richard Feldman
4a601ffd4c
Use tempfile::NamedTempFile in more places 2022-11-22 18:40:06 -05:00
Richard Feldman
2d066469ee
Drop obsolete .gitignore entries 2022-11-22 18:00:51 -05:00
Richard Feldman
e97a5fe7f6
Use include_bytes! so builtin hosts live in binary 2022-11-22 17:57:32 -05:00
Richard Feldman
2dba97d6a2
Simplify legacy_host_filename_ext 2022-11-22 17:19:36 -05:00
Richard Feldman
87ad2cdf82
Fix linux surgical linker tests 2022-11-22 14:27:53 -05:00
Ayaz Hafiz
faa804d54d
Do not run occurs checks when printing type variables
This is a hack. Let's find and correct these problems earlier in the
compiler.
2022-11-22 13:04:32 -06:00
Ayaz Hafiz
c70b23ac9c
Debug Work 2022-11-22 13:04:27 -06:00
Ayaz Hafiz
dce4d6c4c7
Force occurs check for introduced types after checking annotated bodies
The current type inference scheme is such that we first introduce the
types for annotation functions, then check their bodies without
additional re-generalization. As part of generalization, we also perform
occurs checks to fix-up recursive tag unions.

However, type annotations can contain type inference variables that are
neither part of the generalization scheme, nor are re-generalized later
on, and in fact end up forming a closure of a recursive type. If we do
not catch and break such closures into recursive types, things go bad
soon after in later stages of the compiler.

To deal with this, re-introduce the values of recursive values after we
check their definitions, forcing an occurs check. This introduction is
benign because we already generalized appropriate type variables anyway.
Though, the introduction is somewhat unnecessary, and I have ideas on
how to make all of this simpler and more performant. That will come in
the future.
2022-11-22 12:58:51 -06:00
Ayaz Hafiz
40da261dfd
Mark mono test 2022-11-22 12:57:32 -06:00
Richard Feldman
c3fa64afbd
Add /packages to ~/.cache/roc over ROC_VERSION 2022-11-22 12:10:45 -05:00
Richard Feldman
207160e22c
Print downloading message when downloading package 2022-11-22 12:05:19 -05:00
Richard Feldman
822f059e6e
Always include ROC_VERSION in cache dir 2022-11-22 12:05:03 -05:00
Ayaz Hafiz
91ceebc065
Fix imports 2022-11-22 11:00:14 -06:00
Richard Feldman
f60ed0059a
Turns out this was used by the repl 2022-11-22 11:55:46 -05:00
Ayaz Hafiz
414a320358
Constrain flex inference variables without re-generalization
When constraining a recursive function like

```
f : _ -> {}
f : \_ -> f {}
```

our first step is to solve the value type of `f` relative to its
annotation. We have to be careful that the inference variable in the
signature of `f` is not generalized until after the body of `f` is
solved. Otherwise, we end up admitting polymorphic recursion.
2022-11-22 10:43:59 -06:00
Ayaz Hafiz
03e6d6d7e0
Report builtins type errors during load building as appropriate 2022-11-22 10:36:41 -06:00
Richard Feldman
7356809fc3
clippy 2022-11-22 10:59:17 -05:00
Richard Feldman
52b71cd85f
Using a HTTPS URL platform implies it's prebuilt 2022-11-22 10:45:22 -05:00
Richard Feldman
f39eaff217
Don't match on the same thing twice 2022-11-22 10:34:04 -05:00
Richard Feldman
b7726c87bb
Drop unused field 2022-11-22 08:49:31 -05:00
Richard Feldman
13caa0bc17
Fix doc comment 2022-11-22 08:38:59 -05:00
Richard Feldman
c7f9ecccf1
Fix compression inference 2022-11-22 08:38:02 -05:00
Richard Feldman
092d21a663
Properly resolve shorthands to HTTPS URL packages 2022-11-22 08:28:54 -05:00
Richard Feldman
d16b247523
Rename some variables 2022-11-22 07:20:35 -05:00
Brian Carroll
a90d9d465d
Merge pull request #4555 from roc-lang/wasm_interp
Wasm interp
2022-11-22 10:45:18 +00:00
Richard Feldman
7b7f64e6c0
Streaming downloading and hash verification works 2022-11-21 19:24:25 -05:00
Brian Carroll
92039547b6
wasm_interp: remove unsafe code 2022-11-22 00:09:38 +00:00
Ayaz Hafiz
e36618b9e9
Support custom abilities for opaques with immaterial lambda sets
If a specialization of an ability member has a lambda set that is not
reflected in the unspecialized lambda sets of the member's prototype
signature, then the specialization lambda set is deemed to be immaterial
to the specialization lambda set mapping, and we don't need to associate
it with a particular region from the prototype signature.

This can happen when an opaque contains functions that are some specific
than the generalized prototype signature; for example, when we are
defining a custom impl for an opaque with functions.

Addresses a bug found in 8c3158c3e0
2022-11-21 18:03:56 -06:00
Ayaz
ef5d83a42d
Merge pull request #4556 from roc-lang/fix-fixpoint-fixing
Correct when fixpoint-fixed type variables can be reunified
2022-11-21 17:44:06 -06:00
Brian Carroll
ce10199bb4
clippy + comments 2022-11-21 23:04:22 +00:00
Ayaz Hafiz
e1afd964c7
Correct when fixpoint-fixed type variables can be reunified
With fixpoint-fixing, we don't want to re-unify type variables that were
just fixed, because doing so may change their shapes in ways that we
explicitly just set them up not to be changed (as fixpoint-fixing
clobbers type variable contents).

However, this restriction need only apply when we re-unify two type
variables that were both involved in the same fixpoint-fixing cycle. If
we have a type variable T that was involved in fixpoint-fixing, and we
unify it with U that wasn't, we know that the $U \notin \bar{T}$, where
$\bar{T}$ is the recursive closure of T. In these cases, we do want to
permit the usual in-band unification of $T \sim U$.
2022-11-21 15:57:36 -06:00
Richard Feldman
ea8bb8820b
Switch from ureq to reqwest::blocking 2022-11-21 15:01:43 -05:00
Brian Carroll
3d7fb380a5
wasm_interp: Tests for ExecutionState 2022-11-21 19:54:48 +00:00
Brian Carroll
26cce05bbe
wasm_module: create WasmModule::new for testing 2022-11-21 19:54:48 +00:00
Brian Carroll
2ca74e5070
wasm_interp: create execute module 2022-11-21 19:54:48 +00:00
Brian Carroll
d038094a51
wasm_interp: tests for ValueStack 2022-11-21 19:54:48 +00:00
Brian Carroll
3b0a024a56
wasm_interp: tests for call_stack 2022-11-21 19:54:48 +00:00
Brian Carroll
08e9fb65a6
wasm_interp: create call_stack module 2022-11-21 19:54:48 +00:00
Brian Carroll
b0e89dd386
wasm_interp: new crate, with a value_stack module 2022-11-21 19:54:48 +00:00
Brian Carroll
2f709580cd
Use workspace versioning for wasm_module Cargo.toml 2022-11-21 19:54:48 +00:00
Brian Carroll
9353c25826
formatting 2022-11-21 19:51:21 +00:00
Brian Carroll
880ef2704c
Merge branch 'main' of github.com:rtfeldman/roc into wasm_module_crate 2022-11-21 19:49:00 +00:00
Brian Carroll
a35e912c0a
Fix wasm repl tests 2022-11-21 19:48:38 +00:00
Brian Carroll
a3cfdd478d
rename called_preload_fns to called_fns 2022-11-21 19:48:02 +00:00
Richard Feldman
52783558a5
If Content-Encoding is missing, try to infer it 2022-11-21 04:24:50 -05:00
Richard Feldman
06e8ca2bd1
Be explicit about certain Brotli encoder params 2022-11-21 03:59:53 -05:00
Richard Feldman
d0a1fa3d57
Bundle tarballs with compression after all 2022-11-21 03:57:05 -05:00
Anton-4
f32e329798
Merge pull request #4549 from roc-lang/editor_design_docs
improve/expand design docs for editor and plugins
2022-11-21 09:13:58 +01:00
Richard Feldman
a38380ec76
Remove references to obsolete .rp1 format 2022-11-21 02:58:18 -05:00
Richard Feldman
9e304e4b1e
Fix some issues with tarball generation 2022-11-21 02:51:53 -05:00
Richard Feldman
8b75545176
Separate error for multiple content encodings 2022-11-20 20:58:00 -05:00
Richard Feldman
7d2fa63dca
Make roc_cache_dir() panic if it can't find $HOME 2022-11-20 20:54:03 -05:00
Richard Feldman
4987fe1656
Put RocCacheDir::Temp behind #[cfg(test)] 2022-11-20 20:49:26 -05:00
Richard Feldman
60f89f75aa
clippy 2022-11-20 19:54:20 -05:00
Richard Feldman
721841fa1f
Provide roc_cache_dir everywhere 2022-11-20 19:53:48 -05:00
Richard Feldman
13bed30411
Have Either derive Clone and Copy 2022-11-20 16:20:24 -05:00
Richard Feldman
4139b4ddb1
Combine some imports 2022-11-20 16:20:15 -05:00
Richard Feldman
581c2f248d
Download files into tempdir if no cache available 2022-11-20 11:29:31 -05:00
Richard Feldman
a6c0bd854f
Revert "Always use a tempdir for caches during tests"
This reverts commit 6572b46983.
2022-11-20 11:10:51 -05:00
Richard Feldman
6572b46983
Always use a tempdir for caches during tests 2022-11-20 11:10:17 -05:00
Richard Feldman
d6fa2acc54
Properly pass around roc_cache_dir during loading 2022-11-20 11:05:53 -05:00
Richard Feldman
79be1f94fa
Go back to old load_platform_module name 2022-11-20 10:40:50 -05:00
Richard Feldman
f9676098d3
clippy 2022-11-20 10:39:57 -05:00
Richard Feldman
514fa73701
Early return an io::Result 2022-11-20 10:39:24 -05:00
Richard Feldman
0fe3ecd00e
Drop unused enum 2022-11-20 10:39:07 -05:00
Richard Feldman
40bd8ff1de
Support loading platform modules via HTTPS 2022-11-20 10:37:55 -05:00
Richard Feldman
2831c0eb5a
Incorporate caching into HTTPS packages 2022-11-20 10:37:55 -05:00
Richard Feldman
291e6cce73
Make a lock get dropped sooner 2022-11-20 07:08:21 -05:00
Richard Feldman
2cc6a16dd1
Extract an &mut so we don't do it every time 2022-11-20 07:00:30 -05:00
Richard Feldman
066eb38043
Drop unusued tempfile dependency in packaging 2022-11-19 23:47:34 -05:00
Richard Feldman
d654ba77f1
Clippy 2022-11-19 23:46:30 -05:00
Richard Feldman
017fcca641
Fix https write logic (thanks, Clippy!) 2022-11-19 23:46:29 -05:00
Richard Feldman
804a7cb7bf
Fix compile errors for https module 2022-11-19 23:46:29 -05:00
Richard Feldman
7c1c48afa7
Add https module 2022-11-19 23:46:29 -05:00
Richard Feldman
04492ce485
.rp1 -> .tar; let the server handle compression! 2022-11-19 23:46:29 -05:00
Richard Feldman
92b71da633
Make some brotli settings more explicit 2022-11-19 23:46:29 -05:00
Richard Feldman
0fe3a2e1dc
Switch from lz4 to brotli compression 2022-11-19 23:46:29 -05:00
Richard Feldman
58c8722c4d
Only add precompiled hosts and .roc file to bundle 2022-11-19 23:46:28 -05:00
Richard Feldman
1661c0c87f
Only check for --bundle flag in roc build 2022-11-19 23:46:28 -05:00
Richard Feldman
2fd59981e5
Tweak wording on --bundle 2022-11-19 23:46:28 -05:00
Richard Feldman
32086e25be
Don't recursively create rp1 files! 2022-11-19 23:46:28 -05:00
Richard Feldman
777e05cdc8
Report how long it took to make the bundle 2022-11-19 23:46:28 -05:00
Richard Feldman
4f34eac1e6
Add roc build --bundle to CLI 2022-11-19 23:46:28 -05:00
Richard Feldman
841d764ca1
Add roc_packaging::rp1 initial implementation 2022-11-19 23:46:28 -05:00
Richard Feldman
0e416adc3a
Give a nice error if precompiled host is missing 2022-11-19 23:46:27 -05:00
Richard Feldman
00128e3a18
Don't spawn platform-rebuilding thread if prebuilt 2022-11-19 23:46:27 -05:00
Richard Feldman
571844fc27
Change preprocessedhost filename 2022-11-19 23:46:27 -05:00
Ayaz
1a3119e4c5
Merge pull request #4525 from roc-lang/fix-fixpoints-2
Implement fixpoint-fixing and unconditionally emplace variables into type indices
2022-11-19 17:47:02 -06:00
Anton-4
d2959e95c2
improve/expand design docs 2022-11-19 18:27:09 +01:00
Folkert de Vries
3e0176a717
Merge pull request #4541 from roc-lang/fix-echo
Fix warnings on examples/cli/echo.roc
2022-11-19 14:46:14 +01:00
Richard Feldman
200d456b7b
Create single source of favicon truth 2022-11-19 06:23:46 -05:00
Richard Feldman
674d449bc1
Give a nice error if precompiled host is missing 2022-11-19 00:20:04 -05:00
Richard Feldman
61153ed33b
Don't spawn platform-rebuilding thread if prebuilt 2022-11-19 00:10:37 -05:00
Richard Feldman
062ecce84c
Change preprocessedhost filename 2022-11-18 23:54:21 -05:00
Joshua Warner
2d9aba2242
Refactor parser methods to not return State as part of ParseError
As previously discovered with #4464, it's easy to accidentally mis-use the State value returned on the Err path.

There were mixed assumptions about what that State represents: (1) the State where the error occurred, or (2) the State at the beginning of the thing we were just parsing.

I fixed this up to always mean (2) - at which point we don't actually need to return the State at all - so it's impossible for further discrepency to creep in.

I also took the liberty to refactor a few more methods to be purely combinator-based, rather than calling `parse` directly.
2022-11-18 19:52:23 -05:00
Richard Feldman
7f617c87bf
Change precompiled host filename format 2022-11-18 17:08:10 -05:00
Richard Feldman
fa2e0648ca
Fix wasm32 host filename generation 2022-11-18 16:47:29 -05:00
Richard Feldman
e4e629c4e4
clippy doesn't like Result with () for the error 2022-11-18 14:45:12 -05:00
Richard Feldman
ebc314691c
Fix Swift linking 2022-11-18 14:26:04 -05:00
Richard Feldman
ba90cbfbd2
Panic in legacy linker if ld returns nonzero
We don't print an error message for this, so it's very
confusing if we don't panic - and legacy linker is
going away eventually anyway, so not worth investing in
better error reporting
2022-11-18 14:16:21 -05:00
Richard Feldman
c331925f3f
Drop obsolete comment 2022-11-18 14:16:12 -05:00
Richard Feldman
b80d92e344
Use legacy_host_filename instead of always host.o 2022-11-18 14:15:48 -05:00
Richard Feldman
e2b6d93096
Use debug_assert_eq! instead of debug_assert! 2022-11-18 14:01:51 -05:00
Ayaz Hafiz
bbaa9299f1
Update cli tests 2022-11-17 17:21:38 -06:00
Brian Carroll
c16d425936
Merge branch 'main' of github.com:roc-lang/roc into wasm_module_crate 2022-11-17 21:29:59 +00:00
Brian Carroll
29baa45774
debug generated linker data for Roc->JS calls 2022-11-17 21:26:33 +00:00
Ayaz
a74d7e14b7
Merge branch 'main' into i4416
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2022-11-17 09:07:00 -06:00
Ayaz
2836e0a9e9
Merge pull request #4534 from roc-lang/fix-able-binding-variables-behind-aliases
Ensure ability-bound variables are registered in their generalization pool
2022-11-17 07:45:49 -06:00
Richard Feldman
a8ee5b7cbf
Merge pull request #4537 from roc-lang/output-tweaks
Reporting tweaks
2022-11-17 08:28:57 -05:00
Brian Carroll
24e6e8445d
Remove the trick of pushing an extra N+1 entry to function_offsets. It's bug-prone. 2022-11-17 07:49:38 +00:00
Richard Feldman
6c4e2c8738
Revise wording on unnecessary wildcard warning
My concern with the previous wording is that:
- Beginners will be confused by "these are always open"
- Users advanced enough to understand what that actually means won't benefit from seeing it in this warning message!
2022-11-16 23:18:51 -05:00
Richard Feldman
2f54e46909
Add a blank line after failed inline expectations 2022-11-16 23:11:05 -05:00
Richard Feldman
1e4cf52fd4
Merge pull request #4504 from roc-lang/fix-styles
Fix some web styles
2022-11-16 21:53:05 -05:00
Ayaz Hafiz
fe0eacb70a
Propogate only_unseen phanton type count check 2022-11-16 19:46:54 -06:00
Ayaz Hafiz
48c0921cd2
Fix off by one conditional 2022-11-16 19:15:22 -06:00
Ayaz Hafiz
b43078440f
Ensure ability-bound variables are registered in their generalization pool
When we attempt to bind a type argument to an ability in an alias/opaque
instantiation, we create a fresh flex var to represent satisfaction of
the ability, and then unify the type argument with that flex var.
Previously, we did not register this fresh var in the appropriate rank
pool.

Usually this is not a problem; however, our generalization algorithm is
such that we skip adjusting the rank of redundant variables. Redundant
variables are those that are in the same unification tree, but are not
the root of the unification trees.

This means that if such a flex able var becomes the root of a
unification tree with the type argument, and the type argument is itself
generalized, we will have missed generalization of the argument.

The fix is simple - make sure to register the flex able var into the
appropriate rank pool.

Closes #4408
2022-11-16 17:09:47 -06:00
Ayaz Hafiz
716c4cb8e4
Print rigid name in debug representation 2022-11-16 17:09:31 -06:00
Brian Carroll
0c81063c68
Fix dummy function replacement 2022-11-16 21:25:53 +00:00
Brian Carroll
ba99870de0
minor tweaks 2022-11-16 21:25:16 +00:00
Ayaz Hafiz
b957e670e2
Fix cli run test 2022-11-16 14:54:06 -06:00
Brian Carroll
24cef94fb5
Fix Wasm dummy function 2022-11-16 20:34:38 +00:00
Ayaz Hafiz
b8ff9f7b19
Simplify debug flag check 2022-11-16 14:15:16 -06:00
Ayaz Hafiz
28768bcfba
Fix order of alias arg discovery 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
cc677917a7
Fix typo 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
76a3e92088
Fix debug flags for release mode 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
a8b55dc794
Admit occurs check under recursive tag unions when programs have type errors 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
216a786d52
Make sure to count generated phantom type variables in error type 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
735685dd86
Include error vars in is_recursion_var checks 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
bef9b54124
Avoid parsing doc comments as code 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
f7bc3148ae
Address lints 2022-11-16 14:05:53 -06:00
Ayaz Hafiz
c529505aef
Disable cli/args test for now, but continue testing roc check on it
Args.roc has always been in a broken state, relying on particular
hand-holding of the compiler to operate. With recent changes to type
emplacement, Args.roc now shows off compiler bugs that cannot be papered
over and need to be addressed head-on. These are problems that I do not
think can be directly solved via eliminating type emplacement; I think
they are a combination of constraining and mono bugs, and will be
investigated separately.

For now, turn off attempts to build Args, and instead just test that
`roc check` continues to behave well.
2022-11-16 14:05:52 -06:00
Ayaz Hafiz
08eda910ef
Add gen test for #4077 2022-11-16 14:05:52 -06:00
Ayaz Hafiz
2a5864c19a
Update reporting tests 2022-11-16 14:05:52 -06:00
Ayaz Hafiz
972e531431
Check in solve test
Closes #4077
2022-11-16 14:05:52 -06:00
Ayaz Hafiz
ce5ca4a93c
Mark emplace_variable as must_use 2022-11-16 14:05:52 -06:00
Ayaz Hafiz
33a9c39cfd
Update gen tests that have changed due to emplacement 2022-11-16 14:05:52 -06:00
Ayaz Hafiz
0a9a20a53c
Correct emplace variables in type indices during translation
Prior to this commit, we emplace type variables into `Index<TypeTag>`
only for translated top-level types. However, we need to be careful to
do this emplacement for nested types as well! This patch ensures we do,
but immediately emplacing the destination variable of a type when we
allocate a variable for it.
2022-11-16 14:05:52 -06:00
Ayaz Hafiz
2cba520839
Document fixpoint fixing algorithm 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
8414c8e2de
Remove unneeded comments 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
27c2bd025d
Remove debug_assertions requirement 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
5a92947326
Use fixpoint-fixing in unification 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
9a7402f40b
Add Subs.dbg 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
3c968b581d
Check in fixpoint-fixing algorithm 2022-11-16 14:05:51 -06:00
Ayaz Hafiz
6d0c42d480
Add retain to VecSet 2022-11-16 14:05:50 -06:00
Ayaz Hafiz
60178f14e4
Remove redundant signature index 2022-11-16 14:05:50 -06:00
Ayaz Hafiz
f7e0383058
Drop dead reference 2022-11-16 13:59:11 -06:00
Ayaz Hafiz
9c8a4ec027
Choose hash implementation for ranged number based on default width
Closes #4416
2022-11-16 13:57:03 -06:00
Ayaz Hafiz
3305041316
Add Debug derives in lambda set compaction 2022-11-16 13:55:15 -06:00
Ayaz Hafiz
af81ceae38
Add method to grab default compilation width of a number 2022-11-16 13:54:48 -06:00
Folkert de Vries
0920fb4227
Merge pull request #4508 from roc-lang/windows-final-cli-tests
Windows final cli tests
2022-11-16 18:21:49 +01:00
Anton-4
fba1dc2b80
ignore one more test 2022-11-16 13:58:21 +01:00
Anton-4
87042bc3e1
ignore more tests 2022-11-16 13:58:21 +01:00
Anton-4
37ad8a941a
ignore some tests on windows 2022-11-16 13:58:21 +01:00
Folkert
6938ec62fc
display the command string in a prettier way 2022-11-16 13:58:21 +01:00
Anton-4
0517d8959c
clippy, run subset of cli_run tests 2022-11-16 13:58:21 +01:00
Anton-4
5a447a9fcc
Merge branch 'main' of https://github.com/roc-lang/roc into windows-final-cli-tests 2022-11-16 13:58:17 +01:00
Anton-4
b681949461
clippy+fmt 2022-11-16 13:55:58 +01:00
Anton-4
e9d8d13b02
windows fixes, error improvements 2022-11-16 13:55:58 +01:00
Folkert de Vries
1976174a46
Merge pull request #4530 from roc-lang/fast-occurs-check
Use thread-local buffer for occurs check seen variables
2022-11-16 13:10:12 +01:00
Brian Carroll
e57ca0aa12
Remove "Roc host" specifics from Wasm dead code elimination 2022-11-16 08:07:22 +00:00
Joshua Warner
be42668202
Merge pull request #4519 from joshuawarner32/fix-fmt
Add fmt test to make sure formatting works for all parser test cases
2022-11-15 19:39:18 -08:00
Ayaz
53a2d683e6
Merge pull request #4526 from roc-lang/reset-reuse-morphic-v2 2022-11-15 19:06:15 -06:00
Joshua Warner
36f0e9d4f5
Add test for multiline tuple with comments 2022-11-15 19:51:02 -05:00
Joshua Warner
d4bf946327
Assert formatting for parse tests 2022-11-15 19:47:28 -05: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
Brian Carroll
18195c8bd7
Fix resetting of vm stack blocks in CodeBuilder 2022-11-15 21:59:20 +00:00
Brian Carroll
dff6715a33
Remove some very outdated text from gen_wasm readme 2022-11-15 21:21:05 +00:00
Brian Carroll
2fa4c33b77
Merge branch 'main' of github.com:roc-lang/roc into wasm_module_crate 2022-11-15 21:16:25 +00:00
Folkert
5aa29c4e8b
morphic + reset/reuse 2022-11-15 22:06:09 +01:00
Ayaz
2cc9c32c37
Merge pull request #4523 from roc-lang/fix-alias-analysis-bugs
Collect deeply nested type names in alias analysis
2022-11-15 14:46:55 -06:00
Folkert de Vries
8a494d11b4
Merge pull request #4524 from roc-lang/fix-expects-macos
Fix inline expects on macos
2022-11-15 19:48:35 +01:00
Folkert
98b88fef16
fix a weird merge conflict 2022-11-15 19:46:36 +01:00
Folkert de Vries
5e5218fc7e
Merge pull request #4501 from roc-lang/types-soa-variable-opt
Emplace variables after converting SoA types, and remove types from constraining
2022-11-15 18:35:56 +01:00
Ayaz Hafiz
b6f53f22c3
Fix inline expects on macos
MacOS SIGUSR1 is signal 30, not 10 as it is on Linux.
At least on MacOS clang, we need the added headers to the c platform's
host to compile correctly.
2022-11-15 09:30:28 -06:00
Ayaz Hafiz
3723071c15
Collect deeply nested type names in alias analysis
Previously we only collected type names that appeared on the surface of
a type during alias analysis, but certain types that need to be named
(i.e. recursive types) may be observed only when we actually convert the IR
to the morphic IR. Make sure we collect those appropriately.

This is a cherry pick of the relevant changes in #4121.
2022-11-15 09:23:28 -06:00
Ayaz Hafiz
b30e8fc9b2
Remove Cells from Types 2022-11-15 09:00:16 -06: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
Brian Carroll
04fcf89653
Fix compile errors in wasm tests 2022-11-15 09:40:55 +00:00
Brian Carroll
ddddb7d4f1
Fix import relocations in CodeBuilder. 2022-11-15 09:36:59 +00:00
Folkert
18574560d3
clippy 2022-11-15 10:02:57 +01: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
a52e9d605d
Remove unneeded type storage in constraining 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
Anton-4
29230921e6
windows fixes 2022-11-14 19:37:25 +01:00
Richard Feldman
2fd968e023
Fix Str.fromUtf8 type annotation 2022-11-14 12:02:33 -05:00
Richard Feldman
e6808b3252
Delete some redundant Str docs 2022-11-14 11:58:09 -05:00
Richard Feldman
4a1196a2bf
Use present tense more in Str docs 2022-11-14 11:38:33 -05:00
Richard Feldman
477dda3cc6
Use expect more in Str docs 2022-11-14 11:36:54 -05:00
Richard Feldman
3f8829e310
Linkify a list mention in Str docs 2022-11-14 11:34:24 -05:00
Richard Feldman
d814ed3c27
Link to Bool.true and Bool.false in docs 2022-11-14 11:33:32 -05:00
Richard Feldman
c23e23abf5
Fix some Str docs 2022-11-14 11:33:17 -05:00
Richard Feldman
d9774109f1
Merge remote-tracking branch 'origin/main' into str-docs 2022-11-14 11:30:31 -05:00
Richard Feldman
8a47ebd22e
Some more Str docs changes 2022-11-14 09:42:59 -05:00
Joshua Warner
1efd7260de
Add fmt test to make sure formatting works for all parser test cases 2022-11-14 08:20:35 -05:00
Brian Carroll
4dea82b2f5
Move code_builder from wasm_module to gen_wasm 2022-11-14 09:18:53 +00:00
Joshua Warner
ca5d084497
Implement tuple pattern parsing
Step 2 of N in implementing #4465
2022-11-13 16:11:57 -05:00
Richard Feldman
5f74e10d32
Merge pull request #4515 from roc-lang/workspace-dependencies
Workspace dependencies
2022-11-13 11:44:29 -08:00
Folkert
662bf1de99
more workspace dependencies 2022-11-13 16:10:02 +01:00
Folkert
2c23a106f2
make inkwell a workspace dependency 2022-11-13 15:00:48 +01:00
Folkert
031866799a
use inkwell's FunctionIterator 2022-11-13 14:51:24 +01:00
Brian Carroll
c8f949d546
Temporarily copy DEBUG_SETTINGS into wasm_module crate 2022-11-13 09:19:55 +00:00
Brian Carroll
2e67bdf4d0
Move some wasm constants and macros 2022-11-13 09:03:26 +00:00
Brian Carroll
63d9187343
move wasm_module out of gen_wasm 2022-11-13 09:03:08 +00:00
Ayaz
b907f01f1f
Merge pull request #4507 from roc-lang/alias-analysis-rc-recursion
fix stack overflow in alias analysis
2022-11-12 12:54:06 -06:00
Folkert de Vries
1e74649864
Merge pull request #4510 from joshuawarner32/tuple-accessor
Implement parsing for tuple accessor functions (.1, .2, etc)
2022-11-12 19:44:23 +01:00
Anton-4
084cf819d3
Merge pull request #4506 from roc-lang/csv-parser-zig
csv parser: rewrite host to zig
2022-11-12 16:17:33 +01:00
Joshua Warner
f4ce4bf983
Implement parsing for tuple accessor functions (.1, .2, etc)
Step 2 of N toward implementing #4465
2022-11-12 09:56:29 -05:00
Folkert
2318ffe31d
don't include header files that don't exist on windows 2022-11-12 14:38:26 +01:00
Folkert
abbc2d2acd
ignore ruby platform on windows 2022-11-12 14:23:57 +01:00
Folkert
b6df9fe0dc
display the command nicely 2022-11-12 14:11:00 +01:00
Folkert
dba6a57c04
don't try to run expects on windows 2022-11-12 14:00:54 +01:00
Folkert
9536d0b1a0
fixes for the False example 2022-11-12 13:55:13 +01:00
Folkert
78b89cb894
handle RC along with lets in alias analysis to limit recursion depth 2022-11-12 13:42:10 +01:00
Folkert
9d7e1acb73
comment a string hack on windows 2022-11-12 13:41:06 +01:00
Brian Carroll
ed048c7c93
Fix more tests 2022-11-12 09:12:28 +00:00
Brian Carroll
894697b284
Build fixes 2022-11-12 08:46:18 +00:00