about summary refs log tree commit diff stats
path: root/shell/sandbox.mu
Commit message (Collapse)AuthorAgeFilesLines
...
* shell: reenable the traceKartik K. Agaram2021-04-171-1/+1
| | | | | | | | | | | | | | We now have a couple of protections: - if we get close to running out of space in the trace we drop in an error - if we run out of space in the trace we stop trying to append - if there are errors we cancel future evaluations This is already much nicer. You can't do much on the Mu computer, but at least it gracefully gives up and shows its limitations. On my computer the Mu shell tries to run computations for about 20s before giving up. That seems at the outer limit of what interactivity supports. If things take too long, test smaller chunks.
* tmp: debugging why brline prints no pixelsKartik K. Agaram2021-04-171-1/+1
| | | | | | | | | | | | | | | | | Among other things, we turned off the trace to significantly speed up the debug cycle. State as of https://merveilles.town/@akkartik/106079258606146213 Ohhh, as I save the commit I notice a big problem: I've been editing the disk image directly because writes to the Mu disk lose indentation. But I've been forgetting that the state in the Mu disk needs to be pre-evaluated. So function bindings need extra parens for the environment. The `pixel` calls in the previous commit message are the first statement in the body, and they aren't actually considered part of the body right now. No wonder they don't run. There are lots of other problems, but this will clarify a lot.
* handle drawing 16*4 = 64 pixelsKartik K. Agaram2021-04-161-1/+1
| | | | | | | | | | | | | | | Previously we'd only drawn 8*5 = 40 pixels. Current contents of data.img: ( (globals . ( (hline . (fn () (screen y) (hline1 screen y 0 (width screen)))) (hline1 . (fn () (screen y lo hi) (if (>= lo hi) () ((fn () (pixel screen lo y 12) (hline1 screen y (+ lo 1) hi)))))) (vline1 . (fn () (screen x lo hi) (if (>= lo hi) () ((fn () (pixel screen x lo 12) (vline1 screen x (+ lo 1) hi)))))) )) (sandbox . (vline1 screen 5 0 (height screen))) )
* first session programming _within_ the Mu computerKartik K. Agaram2021-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I tried building a function to draw a horizontal line across the screen. Here's what I have in data.txt: ( (globals . ( (horline . (fn () (screen y) (horline_1 screen y 0 (width screen)))) (horline_1 . (fn () (screen y lo hi) (if (>= lo hi) () ((fn () (pixel screen lo y 12) (horline_1 screen y (+ lo 1) hi)))))) )) (sandbox . (horline_1 screen 0 0 20)) ) $ dd if=/dev/zero of=data.img count=20160 $ cat data.txt |dd of=data.img conv=notrunc $ ./translate shell/*.mu && qemu-system-i386 -hda disk.img -hdb data.img Result: I can't call (horline screen 0) over a fake screen of width 40. Some stream overflows somewhere after all the tweaks to various fixed-size buffers scattered throughout the app. Calling horline_1 gets to a 'hi' column of 20, but not to 30.
* shell: start persisting global bindingsKartik K. Agaram2021-04-151-1/+4
|
* .Kartik K. Agaram2021-04-151-0/+8
|
* .Kartik K. Agaram2021-04-151-0/+7
|
* .Kartik K. Agaram2021-04-151-1/+1
|
* parse dotted listsKartik K. Agaram2021-04-151-0/+135
|
* .Kartik K. Agaram2021-04-141-10/+3
|
* shell: word/line navigationKartik K. Agaram2021-04-141-0/+8
|
* shell: pixel graphicsKartik K. Agaram2021-04-131-17/+49
|
* shell: fake keyboardKartik K. Agaram2021-04-101-1/+1
|
* shell: start jumping to keyboard using TabKartik K. Agaram2021-04-101-25/+180
|
* shell: UI now showing fake keyboardKartik K. Agaram2021-04-101-9/+86
| | | | But we don't actually support fake keyboards anywhere yet.
* shell: start on support for fake keyboardKartik K. Agaram2021-04-101-2/+5
|
* shell: move fake screen to sandboxKartik K. Agaram2021-04-101-39/+35
|
* shell: tweaks for fake screensKartik K. Agaram2021-04-101-5/+137
| | | | | - make them more discoverable - clear them between commands
* shell: render fake screensKartik K. Agaram2021-04-101-4/+75
| | | | 'print' turns out to not be working yet.
* shell: start of 'print' primitiveKartik K. Agaram2021-04-101-8/+17
|
* .Kartik K. Agaram2021-04-081-0/+3
|
* shell: create space to display globalsKartik K. Agaram2021-04-081-1/+1
|
* shell: quoteKartik K. Agaram2021-04-061-0/+20
|
* shell: extensible array of globalsKartik K. Agaram2021-04-051-19/+19
| | | | I'm not bothering with full dynamic scope for now.
* shell: save repl input to disk before runningKartik K. Agaram2021-04-051-22/+29
|
* shell: clean up unimplemented menu itemsKartik K. Agaram2021-04-051-4/+0
|
* writes to disk now workingKartik K. Agaram2021-03-231-0/+3
| | | | | | 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.
* .Kartik K. Agaram2021-03-081-1/+1
|
* strip spaces when tokenizingKartik K. Agaram2021-03-081-0/+23
| | | | Thanks Max Bernstein for reporting this.
* get rid of ctrl-d/ctrl-u when browsing traceKartik K. Agaram2021-03-081-4/+4
| | | | Also clean up the menu. Mode-specific stuff goes after Tab.
* 7860Kartik K. Agaram2021-03-061-2/+1
|
* 7854 - shell: symbol lookupKartik K. Agaram2021-03-051-17/+2
|
* 7851 - shell snapshot: symbol lookupKartik K. Agaram2021-03-051-1/+20
|
* 7849 - shell: literal numbersKartik K. Agaram2021-03-041-2/+10
|
* 7842 - new directory organizationKartik K. Agaram2021-03-031-0/+263
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.