Commit graph

1143 commits

Author SHA1 Message Date
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
8137e8aa84
add test case for List.map refcounting 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
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
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
Sam Mohr
f61b303a59
Merge branch 'main' into builtin-task 2024-07-03 00:42:48 -07:00
shua
0faa1d5f20
test_gen: replace stdlib Json with inline implementation
Towards the goal of removing Json from stdlib, this change replaces
usage of TotallyNotJson in test_gen/gen_abilities with a simple usable
inline implementation of Encoder/DecoderFormatting.

Similarly, the use of TotallyNotJson in test_reporting is not necessary
at all and is replaced with a Decoder that wouldn't actually work, but
which does compile.
2024-07-01 20:30:05 +02:00
Sam Mohr
700c7ae9aa
Add Task as a built-in module/type 2024-06-25 00:03:56 -07:00
shua
e2eb9c9aaa
rm dead FIXME comment
this comment was added originally in 24e6cd80e7, but was a comment on a `if cfg(..) {...}` block. Later that `if` was removed but the comment was not, and eventually got copied to another location making it even harder to figure out why it's there.
2024-06-22 19:07:26 +02:00
Anton-4
da95b6d28b
Merge pull request #6791 from shua/concatutf8
builtin: List.concatUtf8 : List U8, Str -> Str
2024-06-11 16:21:30 +02:00
Agus Zubiaga
ec23c9a41b
Add missing argument in test_gen helpers/wasm 2024-06-10 10:18:51 -03:00
Agus Zubiaga
a1b84f01f5
Add missing argument in test_gen helpers/dev 2024-06-09 15:25:01 -03:00
Agus Zubiaga
4e5fdfbf52
Handle root type when loading from str 2024-06-08 19:46:41 -03:00
shua
f7bec802c0
PR: rename to List.concatUtf8 2024-06-08 13:36:20 +02:00
shua
33e8a7a439
implement Str.concatUtf8 2024-06-07 19:05:52 +02:00
Andy Ferris
e636853bc8 Run cargo fmt 2024-05-04 12:39:34 +10:00
Andy Ferris
c74cc19220 Fix unit test with lambda 2024-05-04 11:42:04 +10:00
Andy Ferris
03e9344a83 Add new constants to symbol table, attempt to add tests 2024-05-03 19:50:12 +10:00
Anton-4
f7011c8e33
Merge pull request #6644 from roc-lang/rust-1-76-0-upgrade
Rust 1.76.0 upgrade
2024-05-03 07:25:19 +02:00
Anton-4
ec874655dd
apply Ayaz review suggestions 2024-04-30 19:34:21 +02:00
Agus Zubiaga
7ebfc6d06d
Support both inline and header imports
Load will now convert header imports to inline import defs, so that
we can support both temporarily.
2024-04-20 19:04:09 -03:00
Anton-4
c1d0c24194
fix expected type
Rust's u128 and Roc's U128 have different alignment. They can not be used interchangebly, that leads to segmentation faults. See also 434410692
2024-04-20 19:57:47 +02:00
Anton-4
99ca3f545f
clippy 2024-04-16 20:02:08 +02:00
Fabian Schmalzried
6786fd45c0
add tests 2024-04-01 21:08:12 +02:00
Fabian Schmalzried
f145f73aa0
add tests for decimal point 2024-04-01 21:08:11 +02:00
Brendan Hansknecht
6dc5bfb1b7
Use roc_target over target_lexicon
Tailors a target class for our needs.
Replaces tons of uses across the entire compiler.
This is a base for later adding new targets like thumb.
2024-03-31 10:50:26 -07:00
Richard Feldman
37b154df4f
Remove Str.fromUtf8Range
Seamless slices make this obsolete!
2024-02-17 13:20:33 -05:00
Richard Feldman
30712d352a
Silence some unused test macro warnings 2024-02-14 20:16:39 -05:00
Richard Feldman
3aec2a9182
Address some unused warnings 2024-02-14 13:47:26 -05:00
Richard Feldman
adfaefd4b7
Fix some more usize -> u64 in gen tests 2024-02-14 13:43:49 -05:00
Richard Feldman
5fe9c0d7a3
Remove obsolete wasm-specific test cfg 2024-02-13 12:58:42 -05:00
Richard Feldman
b2ce7e5fcf
Rearrange where usize -> u64 conversions happen 2024-02-13 12:50:40 -05:00
Richard Feldman
ca8f83b896
Use usize instead of pointer type for wasm tests 2024-02-11 12:35:37 -05:00
Richard Feldman
24a38c4a26
Merge remote-tracking branch 'origin/main' into remove-nat 2024-02-11 12:26:36 -05:00
Richard Feldman
50ea255703
Fix some tests that were expecting usize over u64 2024-02-11 12:21:50 -05:00
Anton-4
3c7a834da1
update to new interpolation syntax 2024-02-02 13:39:10 +01:00
Brendan Hansknecht
fc6b519b59
Merge pull request #6463 from roc-lang/dec-pow
`Num.pow` for `Dec`
2024-02-01 09:17:55 -08:00
Richard Feldman
aabd95404f
Merge remote-tracking branch 'origin/main' into remove-nat 2024-01-30 21:42:45 -05:00
Brendan Hansknecht
e7be9d435d
Merge pull request #6460 from roc-lang/dec-div-floor
`floor`, `ceiling` and `round` for `Dec`
2024-01-30 16:38:12 -08:00
Folkert
73d4a4ee56
wasm: incorrect step used to read RocList elements 2024-01-30 18:51:14 +01:00
Folkert
e16b25c93e
Num.pow for Dec 2024-01-30 16:33:50 +01:00
Kiryl Dziamura
b3dfdb562b
crash on rem div by zero 2024-01-30 11:12:02 +01:00
Richard Feldman
7c19b42a99
Merge pull request #6457 from roc-lang/division-by-zero
Division by zero
2024-01-29 08:37:31 -05:00
Folkert
db3b40a07b
Dec floor/ceiling/round 2024-01-29 13:39:38 +01:00
Richard Feldman
3e27e18566
Merge remote-tracking branch 'origin/main' into remove-nat 2024-01-29 07:23:58 -05:00
Folkert de Vries
eadc0d37cd
Merge pull request #6448 from roc-lang/dev-backend-glue-new
glue with the dev backend works again
2024-01-29 11:51:12 +01:00
Folkert
979128cf32
make division by zero (integer) not trap 2024-01-29 01:38:32 +01:00