Commit graph

996 commits

Author SHA1 Message Date
Brian Carroll
5c53530c81
Support refcounting List seamless slices for dev backends 2023-05-14 15:20:40 +02:00
Ayaz Hafiz
1b84cbafe3
Only compare reprs in gen_dev 2023-05-11 12:48:38 -05:00
Ayaz Hafiz
931d26206f
Only check for repr equality in codegen 2023-05-11 09:23:45 -05:00
Ayaz Hafiz
8ca71c7eda
Get started with semantic layouts for tag unions 2023-05-10 18:47:10 -05:00
Ayaz Hafiz
4d50817968
Preserve semantic when reifying recursion layouts 2023-05-10 17:29:00 -05:00
Ayaz Hafiz
94203ca6d9
Preserve semantic when fixing rec pointer 2023-05-10 17:25:15 -05:00
Ayaz Hafiz
fa787b9b48
Unused imports 2023-05-10 17:25:05 -05:00
Ayaz Hafiz
49b8886b82
Hide semantic repr in layout 2023-05-10 17:24:45 -05:00
Ayaz Hafiz
31c9cc8227
Hide away SemanticRepr definition 2023-05-10 17:10:58 -05:00
Ayaz Hafiz
a37a0f1770
DbgDeep for semantic reprs 2023-05-10 17:09:50 -05:00
Ayaz Hafiz
4296d5a349
Drop Layout::struct_no_name_order 2023-05-10 15:58:51 -05:00
Ayaz Hafiz
1170b542b6
Remove field_order_hash from struct layouts 2023-05-10 15:49:30 -05:00
Ayaz Hafiz
43d4135dc8
Semantic layouts for tuples 2023-05-10 15:40:44 -05:00
Ayaz Hafiz
c06ffc434b
Begin generating semantic reprs for records 2023-05-10 15:38:25 -05:00
Ayaz Hafiz
6714a6fd92
Use LayoutRepr directly when possible 2023-05-10 15:28:11 -05:00
Ayaz Hafiz
7b2d149deb
Move repr-specific functions to LayoutRepr and impl deref 2023-05-10 15:26:31 -05:00
Ayaz Hafiz
58fe2bb4e0
Ignore all semantic layouts for now 2023-05-10 15:21:01 -05:00
Ayaz Hafiz
f100e8753c
Introduce the concept of SemanticRepr 2023-05-10 13:51:04 -05:00
Ayaz Hafiz
c3eeb5e2cc
Wrap layouts in a LayoutRepr constructor
Part 1 of support semantic layout representations.
2023-05-10 13:22:10 -05:00
Folkert
6091ccd3b0
enable list_ends_with test for dev backend 2023-05-07 20:31:47 +02:00
Folkert
72a997f1bf
move ptr equality check under length equality check 2023-05-07 20:31:47 +02:00
Folkert
a4be750a3a
properly load pointers before comparison 2023-05-07 20:31:47 +02:00
Folkert de Vries
deb1e9952d
Merge pull request #5365 from roc-lang/dev-backend-cli
Dev backend list tests
2023-05-07 14:47:39 +02:00
Folkert de Vries
ec21f19826
Merge pull request #5374 from GabrielDertoni/remove-needless-string-alloc
refactor: remove needless string allocation in pretty printer
2023-05-06 00:34:48 +02:00
Folkert
6ed899d8be
indirec inc/dec generation in mono helpers 2023-05-05 15:02:21 +02: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
Gabriel Dertoni
7d0027f428
refactor: remove needles string allocation in pretty printer
Many times, in order to create a `ven_pretty::Doc` containing a text
node, the pattern `alloc.text(format!(...))` would be used. This code
then creates a fresh string that is then used in the `Doc`. However,
many times only a small string is necessary and so the allocation could
be optimized. The `ven_pretty` crate supports this through a `SmallString`
type. Allocating a fresh string with `format!` also moves control away
from the `DocAllocator` which isn't ideal, since it could also handle
the string allocations. So, instead of creating a fresh string, one can
simply call `alloc.as_string(format_args!(...))` and delegate the
allocation to the `DocAllocator` without any loss in expressivity. So,
in order to encorage this pattern, this commit also introduces the
`text!` macro.

In order to find all instances of the code pattern, the following
tree-sitter query was used:

```scm
(call_expression
    function: (field_expression
        field: (field_identifier) @field.name
               (#eq? @field.name "text"))
    arguments: (arguments
        (macro_invocation
            macro: (identifier) @macro.name
            (#eq? @macro.name "format")))) @reference.call
```
2023-05-03 21:28:36 -03:00
Ayaz Hafiz
0744ef946b
Determine host-exposed lambda sets once based on proc variable
Rather than calculating the HELS for each host-exposed layout (of which
there may be multiple), we only need to calculate the HELS based on the
top-level type of the host-exposed function.

Also renamed `GlueProcs.extern_names` to
`GlueProcs.legacy_layout_based_extern_names` since they are still
currently generated based on the layout, but I think we want to generate
all HELS via type variable.

Fixes false-interpreter builds in debug.
2023-05-03 10:00:50 -05:00
Basile Henry
b8aaaaabda Implement builtins for Num.isNan, Num.isInfinite, and Num.isFinite
Closes #5310 and closes #5309
2023-05-03 09:33:28 +01:00
Folkert
05a9b4d601
fix that inc on list was no longer recursive 2023-05-03 01:03:09 +02:00
Folkert
cb4b726c7e
don't refcount the empty tag union 2023-05-02 22:31:57 +02:00
Ayaz Hafiz
a9975b1f7f
Crash at runtime rather than panicking when if condition is erroneous
Closes #5318
2023-05-01 15:48:05 -05:00
Folkert
f9f4d5eb49
infra for exposed_generic in the dev backend 2023-05-01 18:39:10 +02:00
Folkert de Vries
a5a91d428f
Merge pull request #5336 from roc-lang/dev-backend-list-map
dev backend: many more builtins
2023-05-01 10:20:15 +02:00
Folkert de Vries
5183bf0196
Merge pull request #5335 from JTeeuwissen/drop_specialization
Drop specialization
2023-04-30 21:14:06 +02:00
J.Teeuwissen
362bdb97ea
using correct id 2023-04-30 16:55:08 +02:00
J.Teeuwissen
297658caba
Merge branch 'main' into symbol_tags 2023-04-30 16:35:22 +02:00
J.Teeuwissen
e2042debfd
feedback 2023-04-30 12:01:01 +02:00
J.Teeuwissen
b8a2ea1bf2
Merge branch 'main' into drop_specialization 2023-04-29 18:31:12 +02:00
Anton-4
ff6ec21a09
Merge pull request #5324 from roc-lang/rust_version_upgrade
WIP Rust version upgrade
2023-04-29 18:01:04 +02:00
J.Teeuwissen
042482a19f
pipeline 2023-04-29 17:59:17 +02:00
J.Teeuwissen
231feb2fe2
assuming recursive rc 2023-04-29 15:31:27 +02:00
J.Teeuwissen
dbab89cc64
start 2023-04-29 15:28:25 +02:00
J.Teeuwissen
c1ced3c5d2
inc lowlevel return value 2023-04-29 14:30:14 +02:00
Folkert de Vries
3018ee6ec3
Merge pull request #5298 from roc-lang/externs-using-variables
find extern names using the variables (not layouts)
2023-04-29 05:44:30 +02:00
Folkert
2e6c632fb4
make only used fields pub(crate) 2023-04-28 22:08:55 +02:00
Folkert
4d681821bf
use get_lambda_set helper 2023-04-28 22:01:57 +02:00
Folkert
45b881d553
cleanup 2023-04-28 21:16:48 +02:00
Folkert
b9cc3b7823
don't check a non-recursive tag union for uniqueness 2023-04-28 18:46:07 +02:00
J.Teeuwissen
5d1349973e
removed recursive decrement wasm 2023-04-28 18:40:58 +02:00