Commit Graph

50 Commits

Author SHA1 Message Date
Kartik K. Agaram d253a31828 rename grapheme to code-point-utf8
Longer name, but it doesn't lie. We have no data structure right now for
combining multiple code points. And it makes no sense for the notion of
a grapheme to conflate its Unicode encoding.
2021-11-09 08:12:11 -08:00
Kartik K. Agaram 834377d6e3 . 2021-10-03 08:03:15 -07:00
Kartik K. Agaram 0dda332ce3 .
Roll back to commit 70919b45f0. Recent commits add lots of extra function
args for dubious benefit.
2021-06-12 21:11:22 -07:00
Kartik K. Agaram 286819685e eliminate some implicit writes to real screen 2021-06-12 16:24:27 -07:00
Kartik K. Agaram 4bd1785c86 shell: larger fake screen 2021-06-12 10:46:28 -07:00
Kartik K. Agaram 44c53fa572 . 2021-06-06 12:50:25 -07:00
Kartik K. Agaram 81b3f72fb8 . 2021-06-04 19:58:20 -07:00
Kartik K. Agaram 3ef69a05b0 . 2021-06-03 20:29:37 -07:00
Kartik K. Agaram ee536ff3e8 . 2021-05-31 15:18:25 -07:00
Kartik K. Agaram e2ab1b30b1 disallow null traces
We now use traces everywhere for error-checking. Null traces introduce
the possibility of changing a functions error response, and therefore its
semantics.
2021-05-19 20:56:37 -07:00
Kartik K. Agaram 6bbeadecaa . 2021-05-19 19:55:29 -07:00
Kartik K. Agaram 150db8d56a some boot-time heartbeat messages
This will help us with some common debug scenarios.
2021-05-07 12:27:20 -07:00
Kartik K. Agaram 719b6acf3d .
Use sandbox background in the top line on the right.
2021-05-01 15:54:02 -07:00
Kartik K. Agaram 2b616894fd move color scheme closer to Solarized dark
sed -i 's,0x12/bg=almost-black,0xdc/bg=green-bg,g' shell/*.mu
sed -i 's, 0/bg, 0xc5/bg=blue-bg,g' shell/*.mu
sed -i 's, 7/fg=trace, 0x38/fg=trace,g' shell/*.mu
sed -i 's, 7/bg=grey, 0x5c/bg=black,g' shell/*.mu

Still a few issues.

Thanks Adrian Cochrane and Zach DeCook.
  https://floss.social/@alcinnz/106152068473019933
  https://social.librem.one/@zachdecook/106159988837603417
2021-05-01 15:37:55 -07:00
Kartik K. Agaram c811754807 render definitions in 2 columns 2021-04-29 16:43:40 -07:00
Kartik K. Agaram b860f108f7 adjust some colors and padding 2021-04-29 15:10:17 -07:00
Kartik K. Agaram 8e89dd5a78 devote 2/3rds of screen to definitions 2021-04-25 17:55:17 -07:00
Kartik K. Agaram 35a6f3cc99 add some padding to the sandbox 2021-04-25 17:49:39 -07:00
Kartik K. Agaram bcd37c381a clear old output when new run is in progress
I'm currently doing this extremely naively/slowly/uglily. Not a bottleneck.
2021-04-21 20:06:46 -07:00
Kartik K. Agaram bc4b6021de . 2021-04-21 19:56:32 -07:00
Kartik K. Agaram 9a5e94ce1f . 2021-04-21 19:44:06 -07:00
Kartik K. Agaram d27994a9d7 shell: show screen state during evaluation
All highly experimental. Current constraints:

* No tail recursion elimination
* No heap reuse
* Keep implementation simple

So it's slow, and I don't want to complicate it to speed it up. So I'm
investing in affordances to help deal with the slowness. However, in the
process I've taken the clean abstraction of a trace ("all you need to do
is add to the trace") and bolted on call counts and debug-prints as independent
mechanisms.
2021-04-21 00:25:06 -07:00
Kartik K. Agaram 97df52bf2f shell: ctrl-r runs on real screen without a trace
We run out of memory fairly early in the course of drawing a chessboard
on the whole screen.
2021-04-17 23:52:52 -07:00
Kartik K. Agaram 1154db7a74 load sandbox even if there are no globals 2021-04-17 19:35:02 -07:00
Kartik K. Agaram 412ec38f30 heh, the current state actually overflows 2KB
It only works because the part that's truncated is cleanly the sandbox.

I need better error-checking in `read`.
2021-04-17 09:09:32 -07:00
Kartik K. Agaram 1a74c3a1e6 loosening a few more buffers
Mu computer now has more code in it:

  (
    (globals . (
      (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))))))
      (hline . (fn () (screen y) (hline1 screen y 0 (width screen))))
      (vline . (fn () (screen y) (vline1 screen y 0 (height screen))))
      (andf . (fn (a b)
                (if a
                  (if b
                    1
                    ())
                  ())))
      (brline . (fn (screen x0 y0 x1 y1)
                   ((fn (dx dy sx sy)
                      ((fn (err)
                         (brline1 screen x0 y0 x1 y1 dx dy sx sy err))
                       (+ dx dy)))
                    (abs (- x1 x0))
                    (- 0 (abs (- y1 y0)))
                    (sgn (- x1 x0))
                    (sgn (- y1 y0)))))
      (brline1 . (fn (screen x y xmax ymax dx dy sx sy err)
                   (pixel screen x y 12)
                   (if (andf (= x xmax) (= y ymax))
                     ()
                     ((fn (e2)
                        (brline1 screen
                          (if (>= e2 dy)
                            (+ x sx)
                            x)
                          (if (<= e2 dx)
                            (+ y sy)
                            y)
                          xmax
                          ymax
                          dx
                          dy
                          sx
                          sy
                          (+ err
                             (+
                               (if (>= e2 dy)
                                 dy
                                 0)
                               (if (<= e2 dx)
                                 dx
                                 0)))))
                      (* err 2)))))
    ))
    (sandbox . (brline screen 1 1 5 5))
  )
2021-04-17 08:29:43 -07:00
Kartik K. Agaram 21a6f5539b data.img now has more than one sector of data 2021-04-16 20:26:56 -07:00
Kartik K. Agaram 5b20f177b6 shell: restore bindings after restart 2021-04-15 21:40:48 -07:00
Kartik K. Agaram 0f760bd60c . 2021-04-15 20:56:52 -07:00
Kartik K. Agaram b2e0ce69ef . 2021-04-15 20:15:22 -07:00
Kartik K. Agaram 0192e2031f . 2021-04-15 20:12:36 -07:00
Kartik K. Agaram 91e30acbd8 . 2021-04-15 20:07:07 -07:00
Kartik K. Agaram 04da8ff8b0 add some structure to the serialization format 2021-04-15 19:56:16 -07:00
Kartik K. Agaram 849f80ac22 . 2021-04-15 18:42:14 -07:00
Kartik K. Agaram 2359e5ed63 shell: load data disk as s-expr rather than string 2021-04-14 22:04:42 -07:00
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 400574f956 shell: move fake screen to sandbox 2021-04-10 20:44:26 -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 f21e224fcd . 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 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 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 c0607ecca8 . 2021-03-22 22:56:33 -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 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