Commit graph

5882 commits

Author SHA1 Message Date
Anton-4
37ba50e746 bug fixes involving IdentId 2021-10-11 20:16:22 +02:00
Brian Carroll
85ca33ddd6 tweak test script 2021-10-11 08:20:33 +01:00
Brian Carroll
403fbb362d Merge branch 'trunk' of github.com:rtfeldman/roc into wasm_reduce_set_get 2021-10-10 23:20:06 +01:00
Brian Carroll
f6685349b3 Batch local declarations to save a few bytes and make some code a little nicer 2021-10-10 22:21:13 +01:00
Brian Carroll
58549bdf07 CodeBuilder doc comments 2021-10-10 20:56:49 +01:00
Brian Carroll
041e26e807 rename CodeBuilder methods 2021-10-10 20:56:39 +01:00
Brian Carroll
c5ee41af25 rename code_builder 2021-10-10 20:56:32 +01:00
Brian Carroll
8164a14dfa rename module_builder 2021-10-10 20:56:20 +01:00
Brian Carroll
c9997f2115 Turn off output file generation & delete duplicate test 2021-10-10 20:55:53 +01:00
Folkert
5084fd533b only do type checing for roc check 2021-10-10 16:32:14 +02:00
Richard Feldman
a0887da6ca
Merge pull request #1645 from rtfeldman/list-walk-flip
Reorder List.walk arguments
2021-10-10 08:38:20 -04:00
Brian Carroll
9dcc6f2bc5 size comparison tweaks 2021-10-10 12:52:53 +01:00
Folkert
15a2ac7410 update more List.walk uses 2021-10-10 12:35:52 +02:00
Folkert
ebcee4021c flip list.walk passed function arguments 2021-10-10 12:35:03 +02:00
Brian Carroll
14f7f0f3b4 Improved test setup for size comparison 2021-10-10 10:42:02 +01:00
Brian Carroll
47f93bddea Fix & refactor create_storage 2021-10-10 10:36:23 +01:00
Brian Carroll
32b9f4fb07 Generate a .wasm file for every test, for size benchmarking 2021-10-09 18:47:37 +01:00
Brian Carroll
d166f65a31 Fix bug: Forgot to generate a local for the stack frame pointer 2021-10-09 18:16:24 +01:00
Brian Carroll
476c1664ec Add debug logging to CodeBuilder and fix a minor bug 2021-10-09 17:24:37 +01:00
Brian Carroll
3aaafdefe1 Get Join/Jump working with VM storage 2021-10-09 16:46:59 +01:00
Anton-4
03d9d41a7a debugging closure -> MarkupNode 2021-10-08 20:19:52 +02:00
Brian Carroll
d81999045a Get Switch statements working with VM storage 2021-10-07 09:14:35 +01:00
Folkert
94e8c62613 make things compile, base64 has a memory leak 2021-10-06 22:57:11 +02:00
Brian Carroll
af823fe5a8 Get rid of unneeded local.set/get in common cases 2021-10-06 20:07:20 +01:00
Richard Feldman
c6a8bdfdbe Swap closure indices in alias analysis 2021-10-06 08:59:38 -04:00
Richard Feldman
90401477c9 Fix List.walkUntil arg order 2021-10-06 07:32:56 -04:00
Richard Feldman
54a1a33ddf Improve unreachable error message 2021-10-05 21:19:08 -04:00
Richard Feldman
8391c337ab Merge remote-tracking branch 'origin/trunk' into list-walk-flip 2021-10-05 20:50:50 -04:00
Brian Carroll
d6bba482ee Treat the Virtual Machine stack as a form of SymbolStorage
Simulate the behaviour of the stack machine, mark where Symbol values
are created, and track where they are in the stack as we emit instructions.

This will allow us to be smarter with setting and getting locals.
However that's not actually implemented yet! At the moment,
we're still generating the same code as before but in a fancier way.

What's happening:

Let's say we have a function call that takes two arguments [A,B]
and that we are lucky and just happen to have a VM stack of [A,B]
That's great, we _should_ not have to do anything, just emit 'Call'

BUT what we are doing is "load A to the top" and then "load B to the top".
This sounds good but it's actually stupid
We are saying we want A at the top of the stack when we don't!!
We want it right where it is, just beneath the top!

So we are emitting code to bring it from 2nd position to the top.
How do we do that? By inserting a local.set instruction to save it,
and a local.get instruction to load it to the top!

What should be happening:

Check the entire VM stack at once for all the symbols we are trying to load.
If they happen to be there (which is likely given the IR structure) do nothing.
If it's not quite perfect... then emit lots of local.set and local.get. Whatever.

What would be the way to solve this properly?

Build the Wasm instructions as a tree, then serialise it depth-first.
The tree encodes all of the information about what needs to be on the
stack at what point in the program. If a tree node has two children,
it consumes two items from the stack. If you do it this way, all
of the instructions get executed just at the right time.
2021-10-05 21:39:19 +01:00
Brian Carroll
d796bbcc68 add a couple of assertions 2021-10-05 21:19:08 +01:00
Anton-4
ab665b7380 Merge branch 'trunk' of github.com:rtfeldman/roc into docs_markup 2021-10-05 11:58:45 +02:00
Anton-4
4324b08a30 cleanup+fmt+clippy 2021-10-05 11:58:11 +02:00
Richard Feldman
894e295b85
Merge pull request #1764 from rtfeldman/list
Some List docs changes
2021-10-04 18:08:32 -05:00
Anton-4
548d806a88 def->MarkupNode working 2021-10-04 19:26:31 +02:00
Folkert de Vries
fa4875da83
Merge pull request #1761 from rtfeldman/giesch
Add List.dropAt
2021-10-04 15:01:17 +02:00
Richard Feldman
cfe7d5afbb Document List.map2 and List.map3 2021-10-04 08:42:52 -04:00
Richard Feldman
e6ec1ded22 Add mapJoin and mapOrDrop to List 2021-10-04 08:26:23 -04:00
Richard Feldman
696a8273ee
Merge pull request #1742 from rtfeldman/test-linker
Test linker
2021-10-03 23:26:15 -04:00
Richard Feldman
c7e20e0ccc
Merge pull request #1741 from rtfeldman/nested-rigid-introduced-twice
only introduce rigid once!
2021-10-03 22:23:39 -04:00
Brian Carroll
d9c595a6c2
Merge pull request #1757 from rtfeldman/wasm_shared_stack_pointer
Wasm shared stack pointer
2021-10-03 22:57:12 +01:00
Folkert de Vries
3d82369bcd
Merge branch 'trunk' into nested-rigid-introduced-twice 2021-10-03 23:55:23 +02:00
Brian Carroll
32f79b5ee2 Create CodeBuilder to track Wasm VM stack as we accumulate instructions 2021-10-03 22:50:11 +01:00
Brian Carroll
cc6f83f284 Clearer variant names for StackMemoryLocation 2021-10-03 21:53:18 +01:00
Brian Carroll
2756425eb9 Assert storage matches when copying 2021-10-03 21:52:27 +01:00
Richard Feldman
47c52b0220
Merge pull request #1737 from rtfeldman/fix-repl-sum-crash
repl cannot handle some functions
2021-10-03 15:52:26 -05:00
Richard Feldman
1054095e1a
Merge pull request #1744 from rtfeldman/call-with-closure
Call with closure
2021-10-03 15:49:34 -05:00
Richard Feldman
e3a8d436cf
Merge pull request #1607 from rtfeldman/editor-let-value
file loading/saving/running, headers, top level defs
2021-10-03 15:45:08 -05:00
Dan Knutson
b83336d3c3 remove outdated uniqueness doc 2021-10-03 14:39:35 -05:00
Dan Knutson
25215cb3e3 cleanup mutable case, split test 2021-10-03 14:09:07 -05:00
Dan Knutson
2a72439117 WIP adding unique mutable case 2021-10-03 13:55:11 -05:00