Brendan Hansknecht
2ca1ebdd2d
appease the paperclip
2022-02-27 15:50:19 -08:00
Brendan Hansknecht
2e70bb8458
remove list set low level
2022-02-27 15:07:09 -08:00
Brendan Hansknecht
b802d681a3
Merge remote-tracking branch 'origin/trunk' into list-replace
2022-02-27 00:28:08 -08:00
Richard Feldman
d57334dd63
Merge pull request #2566 from rtfeldman/gui-example
...
GUI Example
2022-02-26 07:48:38 -05:00
Brendan Hansknecht
39d070e543
flip platform flag to be default
2022-02-25 20:10:36 -08:00
Brendan Hansknecht
7c6c9b52a9
Merge remote-tracking branch 'origin/trunk' into list-replace
2022-02-25 07:35:00 -08:00
Richard Feldman
a49b66e379
Merge branch 'trunk' into gui-example
2022-02-25 08:22:36 -05:00
Brendan Hansknecht
116b585cdc
add more tests
2022-02-24 22:59:47 -08:00
Brendan Hansknecht
badad1c1ad
get basic tests passing
2022-02-24 22:50:28 -08:00
Brendan Hansknecht
889b189191
fix list passing
2022-02-24 22:46:50 -08:00
Brendan Hansknecht
aff962809b
call ListReplace and generate struct afterwards
2022-02-24 22:33:36 -08:00
Brendan Hansknecht
dddf8ff785
switch from pair to record and change name to ListReplaceUnsafe
2022-02-24 20:41:26 -08:00
Brendan Hansknecht
27b47713aa
Add some comments and TODOs
2022-02-24 20:40:45 -08:00
Brendan Hansknecht
ba2e8cd32b
Add base piping for list.Replace
2022-02-24 17:58:56 -08:00
Brendan Hansknecht
69b4e78ac7
Add --opt-size and compiling smaller binaries
2022-02-24 15:39:50 -08:00
Richard Feldman
655373dbe7
Merge remote-tracking branch 'origin/trunk' into gui-example
2022-02-23 21:25:01 -05:00
ayazhafiz
2151e715dd
Fix rebased compile error
2022-02-21 14:12:49 -05:00
ayazhafiz
148dbb4efe
Unnecessary reference
2022-02-21 14:10:46 -05:00
ayazhafiz
e52d427ac8
Hash record field name order in generated layouts
...
Closes #2535
See the referenced issue for longer discussion - here's the synopsis.
Consider this program
```
app "test" provides [ nums ] to "./platform"
alpha = { a: 1, b: 2 }
nums : List U8
nums =
[
alpha.a,
alpha.b,
]
```
Here's its IR:
```
procedure : `#UserApp.alpha` {I64, U8}
procedure = `#UserApp.alpha` ():
let `#UserApp.5` : Builtin(Int(I64)) = 1i64;
let `#UserApp.6` : Builtin(Int(U8)) = 2i64;
let `#UserApp.4` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = Struct {`#UserApp.5`, `#UserApp.6`};
ret `#UserApp.4`;
procedure : `#UserApp.nums` List U8
procedure = `#UserApp.nums` ():
let `#UserApp.7` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = CallByName `#UserApp.alpha`;
let `#UserApp.1` : Builtin(Int(U8)) = StructAtIndex 1 `#UserApp.7`;
let `#UserApp.3` : Struct([Builtin(Int(I64)), Builtin(Int(U8))]) = CallByName `#UserApp.alpha`;
let `#UserApp.2` : Builtin(Int(U8)) = StructAtIndex 1 `#UserApp.3`;
let `#UserApp.0` : Builtin(List(Builtin(Int(U8)))) = Array [`#UserApp.1`, `#UserApp.2`];
ret `#UserApp.0`;
```
What's happening is that we need to specialize `alpha` twice - once for the
type of a narrowed to a U8, another time for the type of b narrowed to a U8.
We do the specialization for alpha.b first - record fields are sorted by
layout, so we generate a record of type {i64, u8}. But then we go to
specialize alpha.a, but this has the same layout - {i64, u8} - so we reuse
the existing one! So (at least for records), we need to include record field
order associated with the sorted layout fields, so that we don't reuse
monomorphizations like this incorrectly!
2022-02-21 14:10:45 -05:00
ayazhafiz
13067f2908
Implement Num.toNNNChecked
...
Closes #2411
2022-02-19 16:20:21 -05:00
ayazhafiz
d90915a8cd
Implement Num.to* builtins
...
Just wrap over Num.intCast
2022-02-19 11:28:41 -05:00
Folkert
5582644166
use str/list helpers to prepare for adding capacity
2022-02-18 22:23:05 +01:00
hafiz
91483dbf55
Merge pull request #2471 from rtfeldman/fix_args_order
...
Swap arg order in `List` builtins to put the more-complex types first
2022-02-13 23:25:05 -05:00
ayazhafiz
886e4e07f6
Update alias analysis, implementation for List.mapWithIndex
2022-02-13 22:50:27 -05:00
ayazhafiz
6e5c1d5914
Specialize Num.toFloat
for different target float types
...
Closes #2476
2022-02-13 20:20:25 -05:00
Richard Feldman
71f2444397
s/Int/Nat in a comment
2022-02-11 21:26:39 -05:00
Richard Feldman
e1cc4cbde6
Fix comment
2022-02-11 21:25:08 -05:00
Jan Van Bruggen
f47dbb5171
Swap List.mapWithIndex arg1 args order to put the element first
2022-02-11 16:10:29 -07:00
Jan Van Bruggen
92e0f8714f
Swap List.repeat args order to put the list first
2022-02-11 16:10:29 -07:00
ayazhafiz
1a1eaf7f68
Normalize c/Roc callconv parameters when C returns by pointer
...
Closes #2413
2022-02-06 21:57:14 -05:00
Richard Feldman
f8fc9cf577
Reproduce code gen crash
2022-02-06 07:39:16 -05:00
Richard Feldman
a8e3d5f9b6
Merge remote-tracking branch 'origin/trunk' into expect-dont-panic
2022-02-03 22:25:40 -05:00
Richard Feldman
9dea0e3a04
Automatically deallocate Failures in Rust
2022-02-03 22:17:53 -05:00
ayazhafiz
097c5afc73
Check lower bounds for numeric literals, and permit 128-bit literals
2022-02-02 23:35:57 -05:00
Richard Feldman
3e9eef4d0e
Add some TODO comments
2022-02-02 18:47:18 -05:00
Richard Feldman
dd8f63b1ab
Add some #[repr(C)] annotations
2022-02-02 18:47:02 -05:00
Richard Feldman
15969af53c
Use constant over string literal
2022-02-01 20:44:02 -05:00
Richard Feldman
e65e6c97d1
Use constant instead of hardcoded string
2022-02-01 09:17:28 -05:00
Richard Feldman
a55ff62e6c
Merge remote-tracking branch 'origin/trunk' into expect-dont-panic
2022-01-30 20:22:26 -05:00
Chelsea Troy
4f8d0776b3
We got a test working for panicking with the appropriate number fo failures. Ultimatly we want:
...
+ An error maessage that says what the failures were
+ Not panicking (so these are effectively error productions)
2022-01-30 18:55:09 -06:00
Brian Carroll
d7f10d80ae
repl: Change LLVM macro to use address instead of pointer
2022-01-29 11:24:13 +00:00
Folkert
684b873453
change name back ?!
2022-01-27 23:20:35 +01:00
Folkert
ee151c8f94
fix function name
2022-01-27 22:26:44 +01:00
Folkert
e31532360b
don't remove argument that is not pushed
2022-01-27 21:20:46 +01:00
Folkert
3ade77374a
Merge remote-tracking branch 'origin/trunk' into add_loop_examples
2022-01-27 16:49:47 +01:00
Folkert
7e28d557ec
improve how we generate the mainForHost function
2022-01-26 21:08:45 -07:00
Folkert
afd11e1cb1
move target -> roc_target
2022-01-26 23:33:29 +01:00
Folkert
0298013346
fix logical error
2022-01-26 17:03:49 +01:00
Folkert
c663a35e16
final phase
2022-01-26 15:44:24 +01:00
Folkert
74932a4cab
phase 2
2022-01-26 14:30:37 +01:00