Commit Graph

8775 Commits

Author SHA1 Message Date
Kiryl Dziamura
7a8a5bc9e7
update type annotation errors 2024-07-23 23:16:49 +02:00
Kiryl Dziamura
10bdabf52e
better desugared idents 2024-07-23 23:16:49 +02:00
Kiryl Dziamura
9a37aeb82f
fix types propagation 2024-07-23 23:16:49 +02:00
Kiryl Dziamura
4d5586b68a
simplify identity unwrap 2024-07-23 23:16:49 +02:00
Kiryl Dziamura
a7ca02dd61
unwrap identity call 2024-07-23 23:16:48 +02:00
Kiryl Dziamura
3e17168098
print formatted desugared code instead of ast 2024-07-23 23:16:48 +02:00
Kiryl Dziamura
56eae5df95
propagate type annotations to desugared ast 2024-07-23 23:16:47 +02:00
Brendan Hansknecht
f40fab3da2
Merge pull request #6918 from roc-lang/copy-better
Generate copy functions in roc and pass them into zig
2024-07-22 04:11:56 -07:00
Brendan Hansknecht
5ad85bcd08
get native dev backend working 2024-07-21 20:07:52 -07:00
Brendan Hansknecht
b8fb83af86
get wasm dev backend working 2024-07-21 19:53:36 -07:00
Brendan Hansknecht
82764dc697
switch to passing the copy function into zig (implement llvm) 2024-07-21 19:04:57 -07:00
Brendan Hansknecht
d028aa3c74
try a different formulation. Maybe it will avoid lookup table 2024-07-21 18:17:37 -07:00
Brendan Hansknecht
f3cae9147c
generate all static size memcpy's 2024-07-21 17:03:07 -07:00
Luke Boswell
9814b24a31
Merge pull request #6917 from roc-lang/remove-examples
Remove gui and swift examples
2024-07-22 08:43:45 +10:00
Brendan Hansknecht
fec875d045
have zig generate more efficient copy functions 2024-07-21 14:56:21 -07:00
Luke Boswell
7ba44a5cd0
remove gui and swift examples 2024-07-21 19:50:04 +10:00
Brendan Hansknecht
bccab34833
correct comment 2024-07-20 21:30:25 -07:00
Brendan Hansknecht
e804501a92
clippy 2024-07-20 21:21:43 -07:00
Brendan Hansknecht
703224b275
fix alloca args overwriting eachother 2024-07-20 21:14:31 -07:00
Brendan Hansknecht
a81d4b8b16
add extra test case from issue 2024-07-20 20:31:29 -07:00
Brendan Hansknecht
c5a74bdc12
for referenced values, use allocas instead of phi nodes 2024-07-20 19:52:11 -07:00
Brendan Hansknecht
ee7f1e39c7
move all allocas to the entry block 2024-07-20 19:17:11 -07:00
Brendan Hansknecht
2772aa4912
fix slice refcounting mistakes that can modify data before a list 2024-07-17 22:19:40 -07:00
Brendan Hansknecht
5b87d82b01
Merge pull request #6907 from roc-lang/refcount-followup
Refcount followup
2024-07-16 15:25:06 -07:00
Brendan Hansknecht
2779145ec5
clarify list drop specialization state 2024-07-16 13:14:39 -07:00
Brendan Hansknecht
f6c231e259
disable some previous and still failing tests 2024-07-15 19:01:40 -07:00
Brendan Hansknecht
5dc20e0f4e
update mono tests 2024-07-15 17:25:51 -07:00
Brendan Hansknecht
ae0f445d86
A clarity around disabling list drop specialization 2024-07-15 17:12:22 -07:00
Brendan Hansknecht
50ba3071e1
disable list drop specialization 2024-07-15 17:04:32 -07:00
Luke Boswell
5cf4a4af1f
Merge pull request #6905 from roc-lang/rocresult-refcount
Add impl RocRefcounted for RocResult
2024-07-16 08:10:52 +10:00
Anton-4
7a288dd53b
Merge pull request #6893 from roc-lang/basic-cli-12-update
DO NOT MERGE YET update to basic-cli 0.12
2024-07-15 22:48:00 +02:00
Brendan Hansknecht
1f5f0956b7
add basic_cli parsing based refcount test 2024-07-15 09:12:23 -07:00
Brendan Hansknecht
507d339691
fix infinite recursion in dev rc generation 2024-07-15 09:04:50 -07:00
Luke Boswell
45cca34c12
add impl RocRefcounted for RocResult 2024-07-15 14:33:19 +10:00
Kiryl Dziamura
1c01a8f0d3
remove measleading fmt code from snapshots 2024-07-14 09:52:01 +02:00
Brendan Hansknecht
0284248320
Merge pull request #6894 from roc-lang/list-size-on-heap
List refcounting perf fix: List size on heap
2024-07-13 19:30:56 -07:00
Anton-4
be4f687208
Merge pull request #6901 from roc-lang/wasm-repl-warnings
fix wasm repl warnings
2024-07-14 02:41:54 +02:00
Kiryl Dziamura
f3e91a104b
remove redundant dependency 2024-07-13 20:46:23 +02:00
Kiryl Dziamura
8b95816797
generate snapshots 2024-07-13 20:46:23 +02:00
Kiryl Dziamura
8949fc710b
use snapshots for suffixed tests 2024-07-13 20:46:22 +02:00
Brendan Hansknecht
c5c2617596
clippy 2024-07-13 10:39:59 -07:00
Brendan Hansknecht
9110457480
cleanup refcount generation for record fields 2024-07-13 10:39:59 -07:00
Brendan Hansknecht
b1eb1e2971
deal with xcode version and ld_classic 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
0533578562
add missed RocRefcounted 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
3198ed5c8e
minimal generation to get glue tests passing 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
2cd0d51409
add RocRefcounted to RocBox 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
386f7a6729
update glue fixtures to new syntax 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
6da61d0d16
re-enable glue tests and add unimplemented RocRefcounted impl 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
2fd2c25c13
guard all inc and dec calls in zig by elements_refcounted to avoid noop loops 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
9052fbd09c
fix List.sublist and add some more refcounting tests 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
6e90052000
fix typo 2024-07-13 10:39:58 -07:00
Brendan Hansknecht
8008c12a81
fix element refcounted for non-list types in dev backend 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
4e8f916204
correct pointer alignment on decref 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
d4b86a745b
update mono tests 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
afda757433
avoid extra joinpoint and loop for list refcounting 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
0d083bc192
fix dev-wasm ListGetUnsafe refcounting 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
5d613cd5f5
add more refcounting test cases 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
f4117c99d5
add more refcounting test cases 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
675e0693a4
clarify function name 2024-07-13 10:39:57 -07:00
Brendan Hansknecht
c734a27b59
move List.map* into roc 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
7d8fbfbe85
also remove inc functions from gen_dev 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
8137e8aa84
add test case for List.map refcounting 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
94cb4fb8ff
remove inc functions from list.map*, the closure will inc in necessary 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
6712824891
correct arg mapping for inline refcounting calls 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
b28e6b343a
cleanup gen_refcount and add new test based on map2 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
9a020100a9
skip broken glue tests for now 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
266fe4bdc8
fix zig tests 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
1e04668ee4
remove ld_classic and fix dev backend missing layout 2024-07-13 10:39:56 -07:00
Brendan Hansknecht
0f7964cc9c
get runtime representation within a pointer instead of of pointers to correctly find refcount functions 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
a8bef30392
fix gen_refcount tests 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
ad76fa2a4e
use calloc to make wasm tests consistent 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
f92d1934d4
add missing symbol in call 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
ba9b15f7d6
generate elem refcount function and pass it into decref lowlevel 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
516afaff41
minor arg correction 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
7529883451
correct list.dropAt arguments in dev wasm 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
927eff0bf4
generate indirect refcount calls in wasm backend 2024-07-13 10:39:55 -07:00
Brendan Hansknecht
0ad638b17d
minor cleanup 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
b381271150
tiny bit of minor cleanup 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
d0b564360b
correct low level calling for list incref/decref 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
23154c41aa
Revert "start correct list refcount function generation"
This reverts commit a8b4d0ef7f.
2024-07-13 10:39:54 -07:00
Brendan Hansknecht
e92cf1be42
Revert "attempt to correct list refcount generation in dev backends"
This reverts commit 0854a1a53a.
2024-07-13 10:39:54 -07:00
Brendan Hansknecht
175255cf86
remove accidental .zig-cache 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
36bc8bfac4
attempt to correct list refcount generation in dev backends 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
94fe0820d5
start correct list refcount function generation 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
61784629e7
update todos around list refcount func generation 2024-07-13 10:39:54 -07:00
Brendan Hansknecht
6b761f6f81
fix zig builtin compilation and warnings 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
669daad33d
wasm backend call into zig to allocate with refcount correctly 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
54d0409396
correct some gen dev layouts 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
9e70308952
cleanup misc minor issues 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
48eb9c31a9
update list generated refcounting functions for dev and wasm 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
3238ee7d0d
correct UTILS_FREE_DATA_PTR function calls 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
0d0a4a8806
Update refcounting of list builtins to the new system. 2024-07-13 10:39:53 -07:00
Brendan Hansknecht
d5e91ed61e
Update dev and wasm backend to use new list bitcode args 2024-07-13 10:39:52 -07:00
Brendan Hansknecht
c79febb52d
Change RocRefcounted to have argumentless inc function
Just inc by 1. No need for inc by n.
2024-07-13 10:39:52 -07:00
Brendan Hansknecht
f87c32ca7d
clippy 2024-07-13 10:39:52 -07:00
Brendan Hansknecht
442ba0b49a
Manually implement RocRefcounted in Glue
I needed to update RustGlue.roc to generate this.
That said, I want to see and measure results.
As such, I am just manually implementing this for now!
2024-07-13 10:39:52 -07:00
Brendan Hansknecht
44cd1ee9c4
Avoid accessing unallocated bytes in list.incref 2024-07-13 10:39:52 -07:00
Brendan Hansknecht
9b6798ead1
Correct refcounting check to be recursive through aggregate types 2024-07-13 10:39:52 -07:00
Brendan Hansknecht
951cb1ef3d
Correct list replace bitcode arg order 2024-07-13 10:39:52 -07:00
Brendan Hansknecht
e2dc112f86
Correct sizes when allocating lists from rust 2024-07-13 10:39:51 -07:00
Brendan Hansknecht
a1d08702a4
Update roc_std List to handle size on the heap
This increased the number of failing tests for some reason (more segfaults).
That said, I think it is correct.

Probably just exposing errors from elsewher that haven't been addressed (maybe causing a double free).
2024-07-13 10:39:51 -07:00
Brendan Hansknecht
93fab26c01
Add a RocRefcounted trait in roc_std
This is required to properly handle refcounting of RocList.
Without it, we can't tell if we need to get the length from the heap.
That said, it isn't a pretty solution.

I think dealing with generating bespoke type in glue would feel nicer than this but be much more work.
It also would deal with the issue of implementations in the bitcode not matching external libraries.
That said, it would require exposing way more symbols from roc for each monomophorphized list variant.
2024-07-13 10:39:51 -07:00
Brendan Hansknecht
3c842196fa
Update LLVM to properly increment and decrement lists 2024-07-13 10:39:51 -07:00
Brendan Hansknecht
255cc31ad9
change zig bitcode refcounting to require whether or not an element is refcounted
This also requires zig bitcode to have access to the dec functions for elements.
This is needed so that zig will be able to free elements in lists.
2024-07-13 10:39:51 -07:00
Anton-4
42a366481b
fix wasm repl warnings 2024-07-13 18:45:01 +02:00
Anton-4
b702cb634f
better mono repl error 2024-07-12 17:02:34 +02:00
Anton-4
3a36d84c45
update to basic-cli 0.12 2024-07-10 20:07:03 +02:00
Anton-4
15a7ed2e95
added error tip 2024-07-09 19:46:33 +02:00
Anton-4
0d9db5bf2d
Merge pull request #6881 from roc-lang/empty-open-union
fix openness inference for empty tag
2024-07-09 16:46:54 +02:00
Anton-4
4341c37b99
cleanup 2024-07-09 13:55:39 +02:00
Sam Mohr
b9a17f4a49
Merge pull request #6883 from smores56/new-builder-syntax
Implement new builder syntax alongside old one
2024-07-08 11:19:01 -07:00
Anton-4
0502734293
fmt 2024-07-08 14:14:36 +02:00
Anton-4
6b2d2e3406
minor improvements 2024-07-08 14:11:22 +02:00
Kiryl Dziamura
2cad4b3e21
update test snapshots 2024-07-08 11:51:29 +02:00
Kiryl Dziamura
3f22c55dda
fix suffixed tests 2024-07-08 11:39:04 +02:00
Kiryl Dziamura
ebf55fa793
fix region calculation 2024-07-08 11:39:03 +02:00
Kiryl Dziamura
b2484f144c
fix def replace 2024-07-08 11:39:03 +02:00
Kiryl Dziamura
8163de02f3
refactor unique ident generator 2024-07-08 09:44:36 +02:00
Kiryl Dziamura
64220567e5
better documentation for underscore pattern 2024-07-08 09:44:36 +02:00
Kiryl Dziamura
e0af069645
don't unwrap empty destructuring pattern 2024-07-08 09:44:35 +02:00
Sam Mohr
74f05eca40
Fix broken test_reporting test 2024-07-07 19:02:31 -07:00
Sam Mohr
618b713ecd
Merge branch 'main' into new-builder-syntax 2024-07-07 18:33:36 -07:00
Sam Mohr
fe1b6d71fc
Update from PR comments 2024-07-07 18:33:20 -07:00
Luke Boswell
1d1b96abb9
Merge pull request #6862 from JRI98/fix_6215
Fix handling of spaces after for `as`
2024-07-08 08:51:53 +10:00
Richard Feldman
595695af23
Merge pull request #6869 from roc-lang/fs
Add no_std fs
2024-07-07 18:47:24 -04:00
Brendan Hansknecht
69d670d27e
Merge pull request #6878 from roc-lang/glue-borrow
Update rust glue to allow for borrowing payloads from tags
2024-07-07 15:23:14 -07:00
Ayaz
eca229e3d1
Merge pull request #6887 from roc-lang/in-layout-unit 2024-07-07 17:22:56 -05:00
Folkert
80a83f3935
when inserting into an interner, re-use Layout::UNIT when possible
it is prettier in debug output, and should also be more efficient
2024-07-07 23:11:36 +02:00
Ayaz Hafiz
0e52a7e069
Make sure FunctionKind is determined in all entry points
There are a lot of entry points for a Roc program. They should probably
be all consolidated into one, but for now, when FunctionKind is needed,
determine it from the environment. This fixes EXPERIMENTAL_ROC_ERASE for
`roc test` etc.

Also print the location of a failure when `internal_error!` is called. I
think this should panic instead, and I thought it used to - does anyone
know if that changed?
2024-07-07 16:01:14 -05:00
Sam Mohr
f415017c90
Implement new builder syntax alongside old one 2024-07-07 03:28:59 -07:00
Anton-4
7180a93273
fix openness inference for empty tag 2024-07-06 16:29:10 +02:00
Folkert
2ec7f56643
add TODO comment 2024-07-06 16:21:03 +02:00
Folkert
ee3ac41a58
add assert to prevent UB?! 2024-07-06 16:14:34 +02:00
Folkert
26e6f1ca92
clippy 2024-07-06 16:14:34 +02:00
Folkert
d5394345de
format RustGlue.roc 2024-07-06 16:14:33 +02:00
Folkert
90b70c3df0
slightly optimize modified tracking 2024-07-06 16:14:33 +02:00
Folkert
f4bd41352b
use BorrowSignature::from_layouts 2024-07-06 16:14:33 +02:00
Folkert
14b02c5827
remove clone 2024-07-06 16:14:32 +02:00
Folkert
413d6621c0
clippy 2024-07-06 16:14:32 +02:00
Folkert
9c0408b28e
fix ui tests 2024-07-06 16:14:32 +02:00
Folkert
047779d981
WIP infer join points too 2024-07-06 16:14:29 +02:00
Folkert
0932c542ca
update mono tests 2024-07-06 16:12:01 +02:00
Folkert
4a121a2348
nothing we can do for by-pointer calls 2024-07-06 16:08:59 +02:00
Folkert
92100d710d
better panic message when glue command fails 2024-07-06 16:08:59 +02:00
Folkert
f361d79249
make a real fixed point 2024-07-06 16:08:59 +02:00
Folkert
48ddbec9d1
mono tests 2024-07-06 16:08:56 +02:00
Folkert
3cbec41d59
hook borrow inference up 2024-07-06 16:05:52 +02:00
Folkert
199558b661
basic transitive inference 2024-07-06 16:05:52 +02:00
Brendan Hansknecht
20a1f3c359
Update rust glue to allow for borrowing payloads from tags 2024-07-05 23:30:05 -07:00
Anton-4
1bcf30391b
Merge pull request #6819 from roc-lang/rust-1-77-2-upgrade
Rust 1.77.2 upgrade
2024-07-06 03:23:54 +02:00