Commit Graph

548 Commits

Author SHA1 Message Date
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 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 K. Agaram 18ef136b2c . 2021-03-28 08:36:03 -07:00
Kartik K. Agaram 1a43d12b15 explicitly pass screen and keyboard to main 2021-03-26 23:07:35 -07:00
Kartik K. Agaram 21263b2edd bochs support for disk drives 2021-03-23 21:53:41 -07:00
Kartik K. Agaram 62a2442110 writes to disk now working
Tested by inserting a call into the shell, but we can't leave it in because
every test ends up clobbering the disk. So it's now time to think about
a testable interface for the disk.
2021-03-23 00:32:49 -07:00
Kartik K. Agaram c0607ecca8 . 2021-03-22 22:56:33 -07:00
Kartik K. Agaram b2e9887b83 . 2021-03-22 22:28:35 -07:00
Kartik K. Agaram 02b0317c3b shell: gracefully handle missing data disk 2021-03-22 22:21:51 -07:00
Kartik K. Agaram e6b42204ef shell: read initial expression from secondary disk
See shell/README.md for (extremely klunky) instructions.
2021-03-21 23:10:55 -07:00
Kartik K. Agaram fe72699390 . 2021-03-08 21:14:06 -08:00
Kartik K. Agaram 38ab33a18d . 2021-03-08 21:04:38 -08:00
Kartik K. Agaram 3ef3d46d72 . 2021-03-08 21:04:03 -08:00
Kartik K. Agaram 2e58ffd653 . 2021-03-08 21:03:15 -08:00
Kartik K. Agaram 0810c7b77e readme for the Mu shell 2021-03-08 20:57:11 -08:00
Kartik K. Agaram aaf2941bfe . 2021-03-08 18:05:36 -08:00
Kartik K. Agaram d124be9cb6 strip spaces when tokenizing
Thanks Max Bernstein for reporting this.
2021-03-08 17:54:07 -08:00
Kartik K. Agaram e58980b4c8 get rid of ctrl-d/ctrl-u when browsing trace
Also clean up the menu. Mode-specific stuff goes after Tab.
2021-03-08 16:27:41 -08:00
Max Bernstein 96e75f1070 Add j/k keybindings for navigating trace
These are familiar for Vim users.
2021-03-08 15:40:49 -08:00
Kartik Agaram 1a1a1671ed 7866 2021-03-07 19:46:21 -08:00
Kartik Agaram e5b8721ca4 7865 2021-03-07 19:29:54 -08:00
Kartik K. Agaram 65e22a3628 7864 - shell: clean up the trace some more 2021-03-07 14:18:24 -08:00
Kartik K. Agaram d2b7e3f44f 7863 - shell: anonymous fn calls 2021-03-07 11:05:03 -08:00
Kartik K. Agaram 5b50feaeee 7862 - shell: more informative traces for eval
Also a bugfix in dealing with streams in cells that is becoming part of
a pattern.
2021-03-07 10:55:11 -08:00
Kartik K. Agaram 410782c79e 7861 - shell: anonymous fn calls without args
((fn () (+ 1 1)))
2021-03-07 08:53:31 -08:00
Kartik K. Agaram 477e58f0b2 7860 2021-03-06 23:38:46 -08:00
Kartik K. Agaram 8f01e2d553 7859 2021-03-06 23:15:27 -08:00
Kartik K. Agaram 7fef31d272 7858 - shell: anonymous fn expressions 2021-03-06 23:03:23 -08:00
Kartik K. Agaram bcde6be528 7857 - shell: first function call 2021-03-05 15:18:46 -08:00
Kartik K. Agaram e4fc67ee44 7856 - shell: primitive functions 2021-03-05 09:30:15 -08:00
Kartik K. Agaram d3b508b16c 7855 2021-03-05 09:02:56 -08:00
Kartik K. Agaram 2454f72c8a 7854 - shell: symbol lookup 2021-03-05 06:19:21 -08:00
Kartik K. Agaram 275a652402 7853 2021-03-05 06:07:50 -08:00
Kartik K. Agaram 3417a0b32a 7852 2021-03-05 05:42:27 -08:00
Kartik K. Agaram 091a4e4001 7851 - shell snapshot: symbol lookup 2021-03-05 05:28:28 -08:00
Kartik K. Agaram e5ff0c39a6 7849 - shell: literal numbers 2021-03-04 22:05:39 -08:00
Kartik K. Agaram 71e4f38129 7842 - new directory organization
Baremetal is now the default build target and therefore has its sources
at the top-level. Baremetal programs build using the phase-2 Mu toolchain
that requires a Linux kernel. This phase-2 codebase which used to be at
the top-level is now under the linux/ directory. Finally, the phase-2 toolchain,
while self-hosting, has a way to bootstrap from a C implementation, which
is now stored in linux/bootstrap. The bootstrap C implementation uses some
literate programming tools that are now in linux/bootstrap/tools.

So the whole thing has gotten inverted. Each directory should build one
artifact and include the main sources (along with standard library). Tools
used for building it are relegated to sub-directories, even though those
tools are often useful in their own right, and have had lots of interesting
programs written using them.

A couple of things have gotten dropped in this process:
  - I had old ways to run on just a Linux kernel, or with a Soso kernel.
    No more.
  - I had some old tooling for running a single test at the cursor. I haven't
    used that lately. Maybe I'll bring it back one day.

The reorg isn't done yet. Still to do:
  - redo documentation everywhere. All the README files, all other markdown,
    particularly vocabulary.md.
  - clean up how-to-run comments at the start of programs everywhere
  - rethink what to do with the html/ directory. Do we even want to keep
    supporting it?

In spite of these shortcomings, all the scripts at the top-level, linux/
and linux/bootstrap are working. The names of the scripts also feel reasonable.
This is a good milestone to take stock at.
2021-03-03 22:21:03 -08:00