Commit Graph

8185 Commits

Author SHA1 Message Date
Kartik K. Agaram 8db35826e6 shell: starting to work on persistent globals 2021-04-14 21:52:57 -07:00
Kartik K. Agaram 5a46430e0e . 2021-04-14 21:47:59 -07:00
Kartik K. Agaram 98715a829e shell: primitives for comparison, cursor movement 2021-04-14 21:26:16 -07:00
Kartik K. Agaram 0b00cacac6 shell: more detailed description of primitives 2021-04-14 20:56:48 -07:00
Kartik K. Agaram f485bed515 shell: don't lose pixel graphics when moving cursor 2021-04-14 20:34:56 -07:00
Kartik K. Agaram 31b4368079 shell: word/line navigation 2021-04-14 20:09:25 -07:00
Kartik K. Agaram 76fb62a16d . 2021-04-14 15:26:04 -07:00
Kartik K. Agaram bbabe8bd1a shell: pixel graphics 2021-04-13 22:27:59 -07:00
Kartik Agaram 5a3f9a3185 . 2021-04-13 21:11:26 -07:00
Kartik K. Agaram fea45ccbea shell: full closures 2021-04-10 23:47:19 -07:00
Kartik K. Agaram 12569711c9 apply doesn't need caller env in lexical scope 2021-04-10 23:38:23 -07:00
Kartik K. Agaram 1c4e8fe775 shell: none of our primitives need to be closures 2021-04-10 23:32:38 -07:00
Kartik K. Agaram b0096cd6a6 shell: streams that you can append graphemes to 2021-04-10 23:05:16 -07:00
Kartik K. Agaram f38c2a1502 . 2021-04-10 22:38:02 -07:00
Kartik K. Agaram 1afc02113a shell: fake keyboard 2021-04-10 22:28:24 -07:00
Kartik K. Agaram e93bbec63b shell: start jumping to keyboard using Tab 2021-04-10 22:14:20 -07:00
Kartik K. Agaram 770cac9412 shell: UI now showing fake keyboard
But we don't actually support fake keyboards anywhere yet.
2021-04-10 21:20:46 -07:00
Kartik K. Agaram a509279aea shell: start on support for fake keyboard 2021-04-10 20:49:20 -07:00
Kartik K. Agaram 400574f956 shell: move fake screen to sandbox 2021-04-10 20:44:26 -07:00
Kartik K. Agaram 6fa86619b2 shell: tweaks for fake screens
- make them more discoverable
- clear them between commands
2021-04-10 20:09:18 -07:00
Kartik K. Agaram 17f77da27d shell: fake screens
I just realized Mu has a pretty big weakness: writes to null pointers don't
error out. Perhaps writes to address 0 do, but address 1 and so on don't?

I need a slightly more sophisticated page table.
2021-04-10 18:32:27 -07:00
Kartik K. Agaram 30018fd687 . 2021-04-10 18:28:47 -07:00
Kartik K. Agaram 90748fa45d shell: render fake screens
'print' turns out to not be working yet.
2021-04-10 17:42:35 -07:00
Kartik K. Agaram f6aeecdc48 . 2021-04-10 17:15:42 -07:00
Kartik K. Agaram 97cffa20d4 shell: start of 'print' primitive 2021-04-10 15:59:40 -07:00
Kartik K. Agaram 1d724f9260 shell: structural equality check
Mu can now compute (factorial 5)
2021-04-09 22:51:24 -07:00
Kartik K. Agaram b3c6dddcd4 shell: if 2021-04-09 22:21:00 -07:00
Kartik K. Agaram 630a7396c5 shell: highlight matching paren for cursor 2021-04-09 21:57:40 -07:00
Kartik K. Agaram 5094473b2f shell: highlight matching close-paren 2021-04-09 20:39:53 -07:00
Kartik K. Agaram f5defca117 . 2021-04-09 20:10:47 -07:00
Kartik K. Agaram fd0e9b5b68 shell: render primitives at the bottom 2021-04-08 23:04:30 -07:00
Kartik K. Agaram f21e224fcd . 2021-04-08 23:04:30 -07:00
Kartik K. Agaram c3069ab818 shell: start rendering globals 2021-04-08 23:04:30 -07:00
Kartik K. Agaram d6d28b8c94 shell: create space to display globals 2021-04-08 22:19:24 -07:00
Kartik K. Agaram 119aea6d06 shell: ctrl-u to clear sandbox 2021-04-06 19:39:09 -07:00
Kartik K. Agaram 7032a92cf2 shell: 'set' for defining globals
Currently stateful, but still good for things.
2021-04-06 10:00:23 -07:00
Kartik K. Agaram 26a1849895 shell: quote 2021-04-06 09:40:13 -07:00
Kartik K. Agaram 6ef0eabdcf shell: now we can start adding primitives 2021-04-06 09:07:25 -07:00
Kartik K. Agaram b9656ea881 shell: look up globals 2021-04-06 07:51:56 -07:00
Kartik K. Agaram 0db683ffdb shell: extensible array of globals
I'm not bothering with full dynamic scope for now.
2021-04-05 23:55:13 -07:00
Kartik K. Agaram 9142cd8519 . 2021-04-05 23:23:41 -07:00
Kartik K. Agaram 07bc1eeb90 shell: save repl input to disk before running 2021-04-05 23:09:05 -07:00
Kartik K. Agaram 4861c39474 shell: ctrl-a/e 2021-04-05 22:39:37 -07:00
Kartik K. Agaram 143cce94ee support for arrow keys
Mu's keyboard handling is currently a bit of a mess, and this commit might
be a bad idea.

Ideally keyboards would return Unicode. Currently Mu returns single bytes.
Mostly ASCII. No support for international keyboards yet.

ASCII and Unicode have some keyboard scancodes grandfathered in, that don't
really make sense for data transmission. Like backspace and delete. However,
other keyboard scancodes don't have any place in Unicode. Including arrow keys.

So Mu carves out an exception to Unicode for arrow keys. We'll place the
arrow keys in a part of Unicode that is set aside for implementation-defined
behavior (https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_controls):

  0x80: left arrow
  0x81: down arrow
  0x82: up arrow
  0x83: right arrow

The order is same as hjkl for mnemonic convenience. I'd _really_ to follow
someone else's cannibalization here. If I find one later, I'll switch to
it.

Applications that blindly assume the keyboard generates Unicode will have
a bad time. Events like backspace, delete and arrow keys are intended to
be processed early and should not be in text.

With a little luck I won't need to modify this convention when I support
international keyboards.
2021-04-05 22:37:27 -07:00
Kartik K. Agaram 316bf37541 undo previous commit 2021-04-05 21:16:45 -07:00
Kartik K. Agaram 928fd47d68 snapshot: stupid debugging session
I spent a while building a little keyboard scancode printer:

  $ ./translate ex1.mu &&  qemu-system-i386 disk.img

..and wondering why up-arrow was 0x48 in hex but 724 in decimal. I ended
up paranoidly poking at a bunch of crap (though there _is_ a cool chromatography-based
debugging technique in 126write-int-decimal.subx) before I realized:

  - 724 just has one extra digit over the correct answer
  - the 0xe0 scan code is a 3-digit number in decimal -- and the final digit is '4'

There's nothing actually wrong.
2021-04-05 21:15:06 -07:00
Kartik K. Agaram 463878a4a4 shell: clean up unimplemented menu items 2021-04-05 19:46:47 -07:00
Kartik K. Agaram 8a31a087b0 . 2021-04-05 19:41:46 -07:00
Kartik Agaram f9e8b0c784 . 2021-04-05 13:56:02 -07:00
Kartik Agaram 40c1a2b595 . 2021-04-04 20:14:43 -07:00