Commit graph

1253 commits

Author SHA1 Message Date
Anthony Bullard
a24fe430b4
Support '??' syntax for optional record fields 2025-01-04 14:26:20 -06:00
Sam Mohr
30b8a1407d
Fix broken ability implementation 2025-01-04 05:37:17 -08:00
Sam Mohr
2aac2e01f8
Move builtins to snake_case with auto-case conversion 2025-01-04 03:29:01 -08:00
Ayaz Hafiz
a0461679dd Restrict usages of type variables in non-generalized contexts
Type variables can only be used on functions (and in number literals as
a carve-out for now). In all other cases, a type variable takes on a
single, concrete type based on later usages. This check emits errors
when this is violated.

The implementation is to check the rank of a variable after it could be
generalized. If the variable is not generalized but annotated as a type
variable, emit an error.
2025-01-02 14:26:37 -06:00
Sam Mohr
21aae74be2
Merge branch 'main' into issue-7425 2025-01-02 12:58:35 -05:00
Brendan Hansknecht
66c1d5f425
fix perf on x86 2025-01-01 21:19:01 -05:00
Brendan Hansknecht
b9832dd6d3
remove unnecessary pub 2025-01-01 14:19:41 -08:00
Brendan Hansknecht
0d800252f3
avoid storing refcount instead load it. That optimizes beter for some reason 2025-01-01 14:03:49 -08:00
Brendan Hansknecht
78530141a1
fix tests 2025-01-01 13:35:08 -08:00
Brendan Hansknecht
26bd2d437e
if the user reserves a specific number of elements, trust them 2025-01-01 13:00:34 -08:00
Brendan Hansknecht
c6d594a758
cleanup constant refcount checking 2025-01-01 12:28:16 -08:00
Brendan Hansknecht
4b8693537a
Simplify Refcounting
Instead of -max_size to -1 for regular refcounts, use 1 to max_size.
0 still means constant refcount.
The highest bit is used to signify atomic refcounting required.
This does not turn on any sort of atomic refcounting.
2025-01-01 11:00:18 -08:00
Brendan Hansknecht
8ad6c47211
also update is_unique for atomic isize 2024-12-31 20:52:04 -08:00
Brendan Hansknecht
f901946455
Improve roc atomic refcounting by using first bit to indicate threadlocal
By avoiding atomic refcounting for any threadlocal variable, this greatly improves performance.
Leads to the performance of threadlocal refcounting being only ~4% behind non-atomic refcounting.
The old atomic refcounting could be as far as ~50% behind (though normally 10-20%).

This does not enable anything atomic related.
If we enable all forms of data loading (List.get, Box.unbox, loading recursive tag) to propagate the atomic flag,
this should be a reasonable implementation for roc by default.
With propagation, a platform would just set a list to atomic. On load, individual elements would also get set to atomic.
We also should probably revert back to threadlocal if an atomic refcount drops to 1.
2024-12-31 20:52:03 -08:00
Ian McLerran
b4c20fca39
roc format 2024-12-31 12:13:23 -06:00
Ian McLerran
13a4d8a6e3
Add List.walk! example to documentation 2024-12-30 18:23:27 -06:00
Ian McLerran
3fc5c638a1
Expose walk! 2024-12-30 18:23:25 -06:00
Ian McLerran
53915bc6e1
Add List.walk! function 2024-12-30 18:23:23 -06:00
Sam Mohr
87fb90660f
Remove broken docs example for Task.batch 2024-12-25 12:30:43 -08:00
Sam Mohr
2b6eaf48d8
Add Task.combine 2024-12-25 11:57:35 -08:00
Jared Ramirez
7daa008a9a
Add Num.fromBool 2024-12-24 10:10:20 -05:00
Anton-4
63abc4bb01
Merge branch 'main' into fromutf8 2024-12-23 11:29:59 +01:00
Anton-4
1bae24b3ea
bitcode build fix (#7394)
* new broader workaround
2024-12-20 11:38:56 -08:00
Anton-4
bd5034e89d
flaky error retry
Closes #7380 

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-12-16 19:58:04 +01:00
Brendan Hansknecht
de18f25a65
attempt more zig cache clearing 2024-12-12 18:55:43 -08:00
Brendan Hansknecht
0f5f5fbe54
wasm does not like PIC 2024-12-12 17:45:31 -08:00
Brendan Hansknecht
2475feeb2f
more wasm fixes 2024-12-11 21:47:18 -08:00
Brendan Hansknecht
3790ddf743
expand zig nix workaround and update issue number 2024-12-11 21:31:56 -08:00
Brendan Hansknecht
7b39066593
Revert "remove old zig workaround for mac"
This reverts commit d5dfdfb36e.
2024-12-11 21:28:27 -08:00
Brendan Hansknecht
6b54e09565
add missing pic 2024-12-11 20:08:44 -08:00
Brendan Hansknecht
67bee420e9
remove pie...no help 2024-12-11 20:06:11 -08:00
Brendan Hansknecht
4f29d46bdc
add pie in hopes to fix relocations 2024-12-11 19:54:59 -08:00
Brendan Hansknecht
d5dfdfb36e
remove old zig workaround for mac 2024-12-11 16:59:20 -08:00
Brendan Hansknecht
4bad31f1ac
fixes from last merge of main 2024-12-11 16:47:19 -08:00
Brendan Hansknecht
0a573ca557
Merge remote-tracking branch 'origin/main' into upgrade-llvm-zig 2024-12-11 16:38:34 -08:00
Brendan Hansknecht
6e9f6843c4
Merge pull request #7319 from roc-lang/dec-mul
fix dec multiplication with overflow and saturation
2024-12-08 17:08:52 -08:00
Luke Boswell
6675734c16
Merge pull request #7314 from shua/wrapped
impl add/sub/mul wrapped for u128/i128
2024-12-09 11:19:58 +11:00
shua
2dfce54a7c
update Str.fromUtf8 error type 2024-12-08 23:09:47 +01:00
Brendan Hansknecht
562032e2d8
fix dec multiplication with overflow and saturation
fixes #7276
2024-12-08 11:14:38 -08:00
Ayaz
793a95264d
Merge branch 'main' into wrapped 2024-12-08 13:54:43 -05:00
Sam Mohr
01f4d4f3da
Merge branch 'main' into cleanup_unused 2024-12-08 10:14:47 -08:00
Mattthew Heath
3aeab753b4
tidying 2024-12-06 18:44:10 +00:00
Mattthew Heath
8c2cdeb332
aligns at 16 finally 2024-12-06 18:35:49 +00:00
Mattthew Heath
addd826511
Revert "aligns as 8"
This reverts commit 82a70c79b8.
2024-12-06 17:47:08 +00:00
Mattthew Heath
82a70c79b8
aligns as 8 2024-12-06 17:33:12 +00:00
Mattthew Heath
b33f1b0981
aligns as usize 2024-12-06 17:16:24 +00:00
JRI98
90f517712a
Remove unused code 2024-12-05 09:18:52 +00:00
shua
6f4e501069
impl add/sub/mul wrapped for u128/i128 2024-12-01 22:26:25 +01:00
shua
6dfa458e6c
Num.powInt: panic on overflow 2024-11-30 11:26:42 +01:00
Luke Boswell
656a7bcd87
Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig 2024-11-30 10:18:11 +11:00