Commit Graph

5800 Commits

Author SHA1 Message Date
Kartik Agaram 3b40e3c331 5750
We can now compile primitive statements while selecting the right template
to code-gen each one from. Even when multiple templates have the same name.
2019-11-17 21:01:36 -08:00
Kartik Agaram eafdbfc103 5749
Support running a single test when the current function around the cursor
ends in '?'.
2019-11-17 17:21:15 -08:00
Kartik Agaram 86894ca577 5748
A new draft of docs as I build out mu.subx. Once we have the second Mu
language, it makes sense to relegate most of the underlying SubX docs to
a separate doc.

I want each layer to be learned bottom-up as I've been organizing SubX
so far. But it's counter-productive to require people to learn SubX before
Mu.
2019-11-16 14:51:32 -08:00
Kartik Agaram edda65475a 5747 2019-11-15 18:44:04 -08:00
Kartik Agaram de3aecff25 5746
After much struggle, one more test: emitting a primitive with a register
operand.

The following two instructions have the same name:
  reg <- increment
  increment var

and they emit the same opcodes:
  ff 0/subop

But they're considered distinct policies in the code-generation 'table',
one for incrementing variables on the stack and the other for incrementing
variables in a register.
2019-11-15 18:41:45 -08:00
Kartik Agaram 95ccc2e055 5745
I've been under-estimating the complexity of translating primitive statements.
We need to separately track information for each primitive about operands
for both the source and emitted SubX notation.
2019-11-14 20:10:49 -08:00
Kartik Agaram c88572eb7e 5744 2019-11-14 17:39:32 -08:00
Kartik Agaram 445373f335 5743 2019-11-14 17:29:40 -08:00
Kartik Agaram a0cc00c0b6 5742
No, let's represent register as just a string to save a translation.
2019-11-14 17:25:47 -08:00
Kartik Agaram 75d5b73cfc 5741
Support variables at positive stack offsets (formal parameters for functions),
and also an indicator for 'any register' for primitive operations.
2019-11-14 17:19:52 -08:00
Kartik Agaram 0d8cdcf290 5740 2019-11-14 15:58:10 -08:00
Kartik Agaram ddb8334fef 5739
Add mu.subx to CI.
2019-11-10 21:12:22 -08:00
Kartik Agaram 525767cb0e 5738 2019-11-10 21:04:21 -08:00
Kartik Agaram 6a53a6cbbf 5737 - first 2 Mu statements translating to SubX 2019-11-10 21:03:33 -08:00
Kartik Agaram b8a5469f7a 5736
Rethink how vars are organized. We need separate aggregates for vars in
the definition stack, defined in function headers, and used by statement
operands. So now vars have no 'next' fields themselves. The definition
stack will be a real stack, while the function headers and statement operands
will have separate 'next' fields.
2019-11-10 19:09:38 -08:00
Kartik Agaram c1eea94481 5735
Switching gears to emitting function calls. The function name is working now.
2019-11-09 19:04:48 -08:00
Kartik Agaram 5c6bf8f04f 5734
No, we need to handle primitives and calls separately.
2019-11-09 12:52:54 -08:00
Kartik Agaram 364bd7edc2 5733 2019-11-09 12:09:20 -08:00
Kartik Agaram 34e01d7f26 5732 2019-11-09 09:34:57 -08:00
Kartik Agaram fb26bd2141 5731 2019-11-09 09:07:41 -08:00
Kartik Agaram 3a74e0e646 5730 2019-11-09 09:02:24 -08:00
Kartik Agaram 0aa689a490 5729
Just a random snapshot of mu.subx. The two new tests aren't passing yet.
2019-11-09 09:00:42 -08:00
Kartik Agaram bf3defde08 5728 2019-11-08 17:31:11 -08:00
Kartik Agaram 0c31de3852 5727 2019-11-08 11:32:14 -08:00
Kartik Agaram 6dd309a2e1 5726 2019-11-03 00:44:25 -07:00
Kartik Agaram de54d4735b 5725 2019-10-30 09:51:07 -07:00
Kartik Agaram 01c811d9ae 5724 2019-10-29 23:04:12 -07:00
Kartik Agaram efae9496be 5723 2019-10-29 22:39:47 -07:00
Kartik Agaram 6c9450b5d1 5722
Already http://akkartik.name/post/mu-2019-2 is out of date.
2019-10-29 22:34:01 -07:00
Kartik Agaram 4e631258c8 5721 2019-10-29 18:01:01 -07:00
Kartik Agaram 076828b93b 5720 - start of Mu's eponymous level-2 language
http://akkartik.name/post/mu-2019-2
2019-10-29 17:51:54 -07:00
Kartik Agaram a28956d220 5719 2019-10-29 17:51:47 -07:00
Kartik Agaram 481bae6edb 5718 2019-10-29 15:36:03 -07:00
Kartik Agaram ffd4a419b4 5717 2019-10-27 00:52:44 -07:00
Kartik Agaram 999c529cb9 5716 2019-10-26 23:51:14 -07:00
Kartik Agaram 0fba3393a5 5715
Clean up pseudocode to match planned syntax for the type- and memory-safe
level-2 Mu language.

http://akkartik.name/post/mu-2019-2 is already out of date.
2019-10-26 23:42:27 -07:00
Kartik Agaram f0b7e327c5 5714
Replace calculations of constants with labels.
2019-10-25 06:10:36 -07:00
Kartik Agaram 76599bb813 5713 2019-10-23 00:47:02 -07:00
Kartik Agaram 4ef2d0fe42
Merge pull request #41 from tekknolagi/mb-rewrite-loop
Simplify loop
2019-10-22 19:48:25 -07:00
Kartik Agaram f372a4decc
Merge pull request #40 from tekknolagi/master
Raise an error if too few arguments are provided
2019-10-22 19:47:42 -07:00
Max Bernstein 9d622b12ce Simplify loop 2019-10-22 19:36:57 -07:00
Max Bernstein 0a6e6c28c9 Raise an error if too few arguments are provided
This is a notably better user experience than an assert failing.
2019-10-22 19:28:12 -07:00
Kartik Agaram 0a2247726a 5708 2019-10-19 18:53:05 -07:00
Kartik Agaram c8998b51e1 5707 2019-10-19 18:49:40 -07:00
Kartik Agaram c83dca9cb4 5706 - example at different levels of syntax sugar
Thanks Mateusz Czapliński for the feedback:
  https://lobste.rs/s/xtxlec/mu_minimal_hobbyist_computing_stack#c_1mzq94
2019-10-19 18:43:16 -07:00
Kartik Agaram b7b6ee5024 5705 2019-10-19 15:05:06 -07:00
Kartik Agaram bb1a1ac2b6 5704
Minor tweaks based on feedback from Max Bernstein.
2019-10-19 14:44:54 -07:00
Kartik Agaram 3a2d36a936 5703
Fix https://github.com/akkartik/mu/issues/38: gen_soso_iso on Arch Linux.

Also deemphasize bootable disk images in the Readme since that side's less
mature.
2019-10-18 23:11:55 -07:00
Kartik Agaram 469a1a9ace 5702 - fix a typo in online help
This commit fixes #37. Thanks Thomas Munoz!
2019-10-18 08:50:55 -07:00
Kartik Agaram b1635a5c8e 5701 2019-10-17 22:03:48 -07:00