Commit graph

214 commits

Author SHA1 Message Date
Brian Teague
4499f8c6f4
isApproxEq function 2024-01-23 21:06:35 -05:00
Richard Feldman
2970fc4384
Merge remote-tracking branch 'origin/main' into str-unicode 2024-01-21 12:30:16 -05:00
Folkert
f1ffc36efe
add List.clone 2024-01-20 20:29:07 +01:00
Richard Feldman
b48fa0698a
Remove scalars and graphemes from Str 2024-01-17 21:30:34 -05:00
Bryce Miller
89febf52bc
Merge branch 'main' into list-walk-with-index-until 2023-12-11 23:13:21 -05:00
Bryce Miller
59eb28ef58
Add builtin List.walkWithIndexUntil 2023-12-11 23:04:40 -05:00
Brendan Hansknecht
b39d604745
Dict follow up and addition of releaseExcessCapacity 2023-12-10 00:06:58 -08:00
Brendan Hansknecht
65c5a490b8
fix Dict.listGetUnsafe to map to low level without wrapping 2023-12-09 18:11:22 -08:00
Brendan Hansknecht
51ec4311b5
Swap Dict implementation to ankerl dense unordered
ankerl::dense_unordered is a very fast hash map that is built to be an index map.
This enables extra optimizations compared to just wrapping a regular hash map.
As such, I think this map is very well suited for our index map impl in Roc.
I also think this dictionary implementation is simpler overall.
On top of that, this removes the need for SIMD instructions for peak performance.

Benchmarks of the C++ version and other C++ hash maps are here: https://martin.ankerl.com/2022/08/27/hashmap-bench-01/
Though this has clear bias of being written by the author of ankerl::dense_unordered,
the results all look correct and the benchmarks thorough.
2023-12-09 18:11:22 -08:00
LoipesMas
83ac8209ae Add Dict.keepIf, Dict.dropIf, Set.keepIf, Set.dropIf 2023-12-04 23:38:51 +01:00
Brendan Hansknecht
e5a0af5699
make DbgFormatter an unexposed implementation detail 2023-12-03 12:41:04 -08:00
Brendan Hansknecht
82cda1965c
use INSPECT_INSPECT_ABILITY instead of INSPECT_INSPECT 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
b8e644a1e3
add DbgFormatter to inspect 2023-11-28 16:40:40 -08:00
Ayaz Hafiz
5c805ce80f
Get first inspect for non-Inspect-implementing opaques specialized 2023-11-28 16:40:39 -08:00
Richard Feldman
34148645ae
wip 2023-11-28 16:40:39 -08:00
Richard Feldman
d0841fb018
Add derive key for Inspect 2023-11-28 16:40:39 -08:00
Richard Feldman
5a872a1bdd
Add Nat to Inspect ability 2023-11-28 16:40:39 -08:00
jecaro
c858031f74
Show the right fct name in type error messages 2023-11-16 16:44:55 +01:00
Richard Feldman
e59d4e57c5
Add List.appendIfOk and List.prependIfOk 2023-11-06 18:13:15 +01:00
Isaac Van Doren
139d3c6f89
make dropFirst and dropLast drop n elements 2023-10-29 13:23:33 -05:00
Isaac Van Doren
886b855594
add Str.contains to builtins 2023-10-14 14:56:51 -05:00
Elias Mulhall
b7923ac542 builtin(list): add List.chunksOf 2023-10-07 11:54:34 -04:00
Brendan Hansknecht
108d9a54e3
Switch Num.tan to a zig builtin
It should be able to share some work between sine and cosine to run faster.
2023-09-16 21:27:51 -07:00
Richard Feldman
b54a37e4b0
Merge remote-tracking branch 'origin/main' into walk-with-index 2023-08-17 11:54:34 -04:00
Richard Feldman
c3b556ffbc
Add List.walkWithIndex 2023-08-15 02:29:25 -04:00
Richard Feldman
83ead6b2b2
Special-case TotallyNotJson types for now 2023-08-14 18:58:50 -04:00
Richard Feldman
700776fad7
Make Inspect a builtin 2023-08-10 21:47:42 -04:00
Folkert
44d03eebfa
switch over to alloca expr 2023-07-30 18:48:35 +02:00
Folkert
cdd2aab217
add alloca as an expression 2023-07-30 18:46:00 +02:00
Ayaz Hafiz
6e5a308557
Content variant ErasedLambda 2023-07-12 13:57:17 -05:00
Ayaz Hafiz
fb4c550a29
Erased symbol 2023-07-12 13:53:51 -05:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Anton-4
c4b0a2ec29
Merge pull request #5620 from roc-lang/dict-set
Add some missing Dict and Set functions
2023-06-29 12:06:49 +02:00
Richard Feldman
ed9d9b12f5
Add some missing Dict and Set functions
Also remove some unnecessary Hash and Eq restrictions
2023-06-27 11:50:58 -04:00
Folkert
fc3004da58
free or reuse unconditionally when value is unique 2023-06-27 17:37:45 +02:00
Folkert
654cf7b861
changes after review 2023-06-24 14:49:57 +02:00
Folkert
9c85fb90d3
fix bugs 2023-06-24 14:49:47 +02:00
Folkert
0247237fe8
WIP 2023-06-24 14:49:46 +02:00
Folkert
76dcb75ff6
add Ptr lowlevels 2023-06-24 14:49:46 +02:00
Hannes
97fa6758d0 Rename trimLeft to trimStart and trimRight to trimEnd 2023-06-19 13:17:59 +08:00
Kilian Vounckx
402a89237d
Add Num.bitwiseNot function 2023-06-17 20:08:33 +02:00
Kilian Vounckx
ab0969f7bb
Add fractional constants 2023-06-15 20:31:17 +02:00
Fábio Beirão
ec94fc87a5
Add Num.min and Num.max
Implements #5533
2023-06-09 14:17:54 +02:00
Luke Boswell
c1ff49be6c
change just Json module name 2023-06-04 17:37:01 +10:00
Kilian Vounckx
d43a78d000
Add update to symbols table and auto generate test_mono 2023-05-30 09:07:15 +02:00
Ayaz Hafiz
3585d5bb5b
Implement hash for Dec 2023-05-26 11:38:30 -05:00
Brendan Hansknecht
b4c359588e
Seed Dict and Set
This changes Dict and Set to have a compilation depedent seed.
The seed is not exposed to userland in anyway.
This gets a much more DOS resistant Dict and Set with no cost.
2023-05-25 09:55:48 -07:00
ayebeedee
98226cb55a
fixed precedence difference for && || 2023-05-15 22:01:17 +05:00
Agustin Zubiaga
71a2990e21 Tip replacing <- with : for static values 2023-05-09 23:37:24 -03:00
Richard Feldman
df0ab01128
Merge pull request #5348 from basile-henry/basile/num-is-nan
Implement builtins for Num.isNan, Num.isInfinite, and Num.isFinite
2023-05-05 06:15:18 -04:00