Commit Graph

85 Commits

Author SHA1 Message Date
Kartik Agaram
a93cd189c9 5803 2019-12-07 20:50:23 -08:00
Kartik Agaram
58467e6cbc 5792
Fix a bug in one test: it checks eax when the component under test returns
nothing. It's been just accidentally passing all these months.
2019-12-05 23:29:24 -08:00
Kartik Agaram
931b17daa0 5782 - fix a widespread bug with Heap-size 2019-11-30 11:14:49 -08:00
Kartik Agaram
8d5437838b 5778 2019-11-29 01:27:39 -08:00
Kartik Agaram
3a7da4e735 5769 - support uppercase hex in SubX 2019-11-28 00:37:26 -08:00
Kartik Agaram
70187b1c01 5765
A couple more primitives now working. In the process I ran into an issue
with some buffer filling up when running ntranslate. Isolating it to survey.subx
was straightforward, but --trace ran out of RAM, and --trace --dump ran
out of (7GB of) disk. In the end what helped was just repeatedly inserting
exits at different points, and I realized there was a magic number that
hadn't been turned into a named constant.
2019-11-26 22:11:23 -08:00
Kartik Agaram
442fdabe30 5752
Support binary operations with reg/mem and reg operands.

Everything is passing. However, the self-hosting translator now generates
some discrepancies compared to the C++ translator :(
2019-11-18 01:15:29 -08:00
Kartik Agaram
f0b7e327c5 5714
Replace calculations of constants with labels.
2019-10-25 06:10:36 -07:00
Kartik Agaram
5ef9597631 5687
Move stack operations to a layer of their own.

It was some short-term pain to take out the syntax sugar from it, but we
need access to this layer from braces, which can't depend on sugar since
it's part of sugar. Just simpler to keep one clear line and not have to
build sometimes with some sugar but not others.
2019-09-23 09:21:40 -07:00
Kartik Agaram
a19dddcabe 5676 2019-09-19 23:29:28 -07:00
Kartik Agaram
fd91f7f61b 5675 - move helpers from subx-common into layers
This undoes 5672 in favor of a new plan:

Layers 000 - 099 are for running without syntax sugar. We use them for
building syntax-sugar passes.

Layers 100 and up are for running with all syntax sugar.

The layers are arranged in approximate order so more phases rely on earlier
layers than later ones.

I plan to not use intermediate syntax sugar (just sigils without calls,
or sigils and calls without braces) anywhere except in the specific passes
implementing them.
2019-09-19 23:25:49 -07:00
Kartik Agaram
8a73e0d19a 5673 - standardize a few knobs 2019-09-19 16:32:10 -07:00
Kartik Agaram
dfbe155087 5672 - move hex out of apps 2019-09-19 15:59:22 -07:00
Kartik Agaram
68666b07b8 5669 2019-09-19 15:19:07 -07:00
Kartik Agaram
a9d473e224 5668 - start reorg to permit syntax sugar in layers
Right now we always build the library before any apps.
Apps are where our syntax sugar translators (sigils, calls, braces) live.
So we can't use sugar in the standard library.

New idea: move all code for SubX phases into the top-level.
Perhaps we should also just build a single file rather than pipeline stages.
But for now we'll build each phase by building up to some specific layer.

This will simplify test_apps and move lots of one-off logic to a more standard
form in test_layers.

I'm also going to reorg existing layers so that we introduce each phase
at a point where it mostly only gets the helpers it needs.

This commit itself is just cleaning up some common strings. Using explicit
names for them streamlines binaries a bit.
2019-09-19 15:12:50 -07:00
Kartik Agaram
ecfbbfb5b5 5647 - experimental support for swapping OS 2019-09-11 19:53:23 -07:00
Kartik Agaram
e836615a60 5630 2019-09-06 16:17:51 -07:00
Kartik Agaram
77c96940d5 5623 2019-09-04 21:29:42 -07:00
Kartik Agaram
719dec729c 5616 2019-09-04 17:30:40 -07:00
Kartik Agaram
968380517a 5608 - write int to stream 2019-09-02 15:15:11 -07:00
Kartik Agaram
282681c729 5600 2019-08-31 23:42:45 -07:00
Kartik Agaram
333525360b 5592 - switch register names to lowercase 2019-08-26 11:59:21 -07:00
Kartik Agaram
22fb844ba4 5591 2019-08-26 11:54:29 -07:00
Kartik Agaram
d8c2f71ce9 5586 - bugfix: no desugar inside string literals 2019-08-25 22:03:23 -07:00
Kartik Agaram
33de6b8031 build out all variants for skipping whitespace
skip {whitespace, non-whitespace} x {from stream, from slice}
2019-08-24 08:18:09 -07:00
Kartik Agaram
306812cc30 done implementing all variants of 'get' 2019-08-13 22:13:14 -07:00
Kartik Agaram
328a8e11f6 done with get-or-stop 2019-08-13 17:15:08 -07:00
Kartik Agaram
0059698b0b half-done testing get-or-stop
Probably not needed for desugar; I'm just working through what we may
replace the calls to 'get-slice' with if and when we decide to start
focusing error messages and so writing tests for them.
2019-08-13 12:40:25 -07:00
Kartik Agaram
63b8b18ef7 standardize test input/output/error streams 2019-08-13 12:27:15 -07:00
Kartik Agaram
64e8faba37 . 2019-08-13 12:19:49 -07:00
Kartik Agaram
64d51af46f . 2019-08-13 09:55:28 -07:00
Kartik Agaram
d826a2d659 new variant: maybe-get-slice 2019-08-13 00:06:18 -07:00
Kartik Agaram
2b48729fd2 new variant: maybe-get returns null on failure 2019-08-12 23:39:53 -07:00
Kartik Agaram
15a84e2449 better error message when get aborts 2019-08-12 23:18:31 -07:00
Kartik Agaram
6e1eeeebfb 5485 - promote SubX to top-level 2019-07-27 17:47:59 -07:00