Ayaz Hafiz
32d4b45557
Add a uitest for pseudo-polymorphic specializations
2023-04-10 16:31:00 -05:00
Ayaz Hafiz
b9ab93fd98
Introduce annotation in first step of recursive solving independently
...
The algorithm for solving recursive definitions proceeds in several
steps. There are three main phases: introduction of what's known,
solving what's not known, and then checking our work of what was
inferred against what the programmer claimed. Concretely:
1. All explicitly-annotated signatures in the mutually recursive set are
introduced and let-generalized.
2. Then, inference type variables (`_`) and unannotated def signatures are
introduced to the cycle, without generalization. The bodies of these
defs, that are either unannotated or have inference variables, are
solved.
3. The defs from step (2) are now let-generalized, since we now know
that their types are consistent. At this point, all the defs in the
cycle have their types introduced and let-generalized, but we still
haven't checked the bodies of the defs froom step (1).
4. Check the bodies of explicitly-annotated defs in recursive set. This
might materially affect the actual types in the signature, for
example do to fixpoint-fixing or alias expansion.
5. As a result of (4) possibly changing the structure of the annotated
type, and because the previous annotated types in (1) were introduced
at a lower rank, we now re-introduce and re-generalize the solved def
types, in the same we did in step (3).
5. The rest of the program is solved.
Now, a very important thing here is that the annotation signature
introduced for (1) consists of different type variables than the
annotation signature introduced in (5). The reason is that they live at
different ranks. Prior to this patch we were not explicilty doing so;
this commit ensures that we do.
2023-04-10 16:31:00 -05:00
Ayaz Hafiz
352345d1d9
Refactor expr constraining to align with top-level constraining
2023-04-10 15:46:15 -05:00
Ayaz Hafiz
7fa508b3c8
Refactor headers_from_annotation to match over TypeTag
2023-04-10 15:44:11 -05:00
Ayaz Hafiz
c8de1e5a27
Function to get index from SoA slice
2023-04-10 15:43:30 -05:00
Ayaz Hafiz
f0b017b807
Correct what destructures are exhaustive
2023-04-10 15:43:02 -05:00
Brendan Hansknecht
4f48873178
Merge pull request #5209 from roc-lang/ingest-file
...
Directly import files as `Str` or `List U8`
2023-04-10 13:59:52 +00:00
Brendan Hansknecht
c440b2ca05
Switch to PathBuf to avoid Path turning into a fat pointer. Avoids growing Constraints
2023-04-09 21:14:05 -07:00
Brendan Hansknecht
a282995fa8
Merge pull request #5114 from Aurelius333/more-dev-aarch64-instructions
...
Add more gen_dev aarch64 instructions
2023-04-09 21:23:04 +00:00
Brendan Hansknecht
165ffcf38d
properly unify ingested file type variable
2023-04-09 14:03:34 -07:00
Brendan Hansknecht
8dd9a5e3c7
correct wrong early return
2023-04-09 14:03:34 -07:00
Brendan Hansknecht
e5b88366fe
add proper error messages for ingested files
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
62fcc71be3
snapshot subs to avoid cloning them
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
90f4885f4b
use Arc to avoid ever needing to actually copy the underlying bytes
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
a354860d07
clippy
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
2e2b687fac
fix errors with alias analysis
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
6302a8d4b5
switch from type annotation to type variable
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
8f4945f286
make file loading errors that happen late in compilation still fatal
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
21d063da26
add load tests from ingested files
2023-04-09 14:03:33 -07:00
Brendan Hansknecht
ff414610ca
clippy
...
add basic test case for now in helloworld
reset helloworld back to original example
reset helloworld back to original example
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
08179d2a65
make errors more correct and check for utf8 bytes
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
07eb3614ea
get ingesting working both for Str and List U8
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
7079361841
add ingested file category for error messages
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
d42aa43b41
add ingest file to can ir and start pipelining it through the compiler
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
7c77f7c2a2
get a basic full pipeline working that will load a file as a string
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
56ed985cc9
pass through correct path and type for ingested file
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
0c366949cb
add basic checking for if an ingested file exists
2023-04-09 14:03:32 -07:00
Brendan Hansknecht
f4411afbbc
get basic wiring of a value through the compiler
2023-04-09 14:03:31 -07:00
Brendan Hansknecht
5354637cec
add new defines to to header
2023-04-09 14:03:31 -07:00
Brendan Hansknecht
8f238046be
get basic parsing and formatting working
2023-04-09 14:03:31 -07:00
Brendan Hansknecht
99547086ee
add very rough framework of how the parse might need to change
2023-04-09 14:03:31 -07:00
Richard Feldman
1059c81d33
Merge pull request #5267 from Ocupe/json-example-qualified-imports
...
use qualified imports for json example
2023-04-09 14:37:20 -04:00
Ajai Nelson
be3cf0abd3
Add comments in aarch64 branch functions
2023-04-09 14:33:43 -04:00
Ajai Nelson
c71d7bb648
Simplify aarch64 mov_reg64_reg64 by delegating to orr_reg64_reg64_reg64
2023-04-09 14:11:59 -04:00
Ajai Nelson
ca0ef8f88f
Add structs to make new
method parameters more readable in aarch64
2023-04-09 14:07:25 -04:00
Folkert de Vries
6b72139cda
Merge pull request #5268 from roc-lang/towards-dev-glue
...
More dev backend tag union fixes
2023-04-09 19:34:57 +02:00
Ajai Nelson
260c080d41
Fix clippy warnings
2023-04-09 13:02:27 -04:00
Ajai Nelson
5f831b6f50
Add aarch64 signed_compare_reg64 and unsigned_compare_reg64
2023-04-09 13:02:19 -04:00
Ajai Nelson
f9e31b828b
Merge branch 'main' into more-dev-aarch64-instructions
...
Fix merge conflict with fdffcc8b36
:
- Add unused _register_width arguments
- Delete comparison functions,
add empty signed_compare_reg64 and unsigned_compare_reg64 functions
2023-04-09 13:01:51 -04:00
Folkert
649b2775b2
enable more gen_tags tests
2023-04-09 18:27:40 +02:00
Folkert
d4bb5053b8
make function names unique by adding layout hash
2023-04-09 18:18:39 +02:00
Jonas Schell
399543a730
use qualified imports for json example
2023-04-09 17:38:21 +02:00
Folkert
c36a82d134
fix return type/CC issue
2023-04-09 16:52:53 +02:00
Folkert
9f8fb61281
fix assert
2023-04-09 16:49:19 +02:00
Folkert
cd95920d60
implement passing of non-recursive tag unions to functions
2023-04-09 15:15:56 +02:00
Folkert
679337e4c4
fix alignment issue in union creation
2023-04-09 15:13:24 +02:00
Folkert
2a4c4f0403
enable more tag dev tests
2023-04-09 14:46:53 +02:00
Folkert
079dd4c51e
ensure literal loading happens independently in branches
2023-04-09 14:41:16 +02:00
Brendan Hansknecht
f79ef07012
Merge pull request #5263 from yukiomoto/fix-dec-div
...
Fix dec division problem
2023-04-09 04:00:31 +00:00
Yuki Omoto
7ef166a11f
remove wrong subtraction in dec div
2023-04-09 11:34:24 +09:00