Commit Graph

86 Commits

Author SHA1 Message Date
Kartik K. Agaram c95648c960 reading from streams
The Mu shell has no string literals, only streams. No random access,
only sequential access. But I've been playing fast and loose with its
read pointer until now. Hopefully things are cleaned up now.
2021-07-03 18:27:01 -07:00
Kartik K. Agaram 577123e975 one more bug 2021-06-23 00:56:39 -07:00
Kartik K. Agaram fa26249931 new macro: with 2021-06-20 22:32:03 -07:00
Kartik K. Agaram bc21fe0baf document responsiveness trade-off 2021-06-15 13:02:15 -07:00
Kartik K. Agaram 2bf7cb83ba do more work per fake-screen refresh
Refreshing the fake screen is still a heavyweight operation. Double-buffering
makes it less obvious but doesn't actually reduce the amount of work. We
need to ensure that we do enough work between refreshes to make them economic.
2021-06-15 12:36:38 -07:00
Kartik K. Agaram 8068b8450f more precisely track count of calls to eval
Before I only separately counted calls at each stack depth. I don't remember
if that seemed good enough or was just an oversight.
2021-06-15 12:28:52 -07:00
Kartik K. Agaram c2c6f4c7ab flickerlessly render fake screens in environment
Font rendering now happens off the real screen, which provides the effect
of double-buffering.

Apps can now also use convert-graphemes-to-pixels for more traditional
double-buffering.
2021-06-15 10:33:18 -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 70919b45f0 .
Rename cells containing screens to screen vars because of the ambiguity
that each grapheme in fake screens is represented by a type screen-cell.
While we're at it, we also analogously rename keyboard vars.
2021-06-12 15:16:50 -07:00
Kartik K. Agaram 4bd1785c86 shell: larger fake screen 2021-06-12 10:46:28 -07:00
Kartik K. Agaram be9fa3780a .
Add argument to a few functions.
2021-06-09 21:05:29 -07:00
Kartik K. Agaram 0aed24e222 . 2021-06-09 20:50:19 -07:00
Kartik K. Agaram 67aeff8934 .
I wrote a comment about how some code was not covered by tests, and then
promptly forgot what it was for. This is why we need tests.

Now the hack is gone.
2021-06-08 15:06:08 -07:00
Kartik K. Agaram 0b3d456f2c clean up a large memory leak
It turns out (bowboard screen 128) on a real screen massively slowed down
and ran out of memory since commit e2ab1b30b1 on May 19. The culprit was
these changes, which created memory allocations for a new trace on every
recursive call.

I originally had some vague desire to isolate these calls from the user-visible
trace. That's expensive enough that I'll wait until it becomes a concern
before trying to isolate again.
2021-06-05 20:43:39 -07:00
Kartik K. Agaram bb1ccae27f rename the definition primitive to 'def' 2021-06-04 16:07:07 -07:00
Kartik K. Agaram 9446e7e594 .
Drop some low-entropy trace lines.
2021-06-03 00:03:20 -07:00
Kartik K. Agaram 7640a77c5f interrupt repl on keypress 2021-05-31 15:18:25 -07:00
Kartik K. Agaram 0c0541d709 . 2021-05-31 15:18:25 -07:00
Kartik K. Agaram ee536ff3e8 . 2021-05-31 15:18:25 -07:00
Kartik K. Agaram e3c7445330 clean up trace depth in a few places
It turns out the problem was that `and` wasn't cleaning up after itself
when it short-circuited evaluation. Similar problems in a couple more places.
2021-05-31 10:38:39 -07:00
Kartik K. Agaram 067fa9c725 bugfix: unbound variables were not raising error
Since we switched error trace semantics from a designated label to a designated
depth (commit 9831a8cef9 on May 19).
2021-05-30 18:02:40 -07:00
Kartik K. Agaram 4cc603deeb unconditionally trace errors
Now that we never have a null trace, tracing errors is always safe. And
now that we're running with low trace max-depth we're more likely to run
into problems with missing errors in the trace.
2021-05-30 17:15:21 -07:00
Kartik K. Agaram 64d3e8e2e0 . 2021-05-19 23:32:16 -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 ec2dab7801 shell: traces track a maximum depth to record 2021-05-19 01:26:25 -07:00
Kartik K. Agaram 91b7b0be73 shell: clean up trace for macroexpand 2021-05-18 20:01:11 -07:00
Kartik K. Agaram 837926751a shell: add a lot of error-checking 2021-05-18 20:01:11 -07:00
Kartik K. Agaram 665b1e8f07 a full-circle rainbow 2021-05-08 07:58:56 -07:00
Kartik K. Agaram 61a68452ae all apps working again after null get check 2021-05-07 20:40:42 -07:00
Kartik K. Agaram 19dd573a92 . 2021-05-07 20:02:01 -07:00
Kartik K. Agaram d3f17627d8 an often-overflowing stream when running brcircle
We really need to systematically check our trace streams.
2021-05-07 15:12:56 -07:00
Kartik K. Agaram d605ba1f9a clean up chessboard
We still benefit from some helpers here because of the unrolling and multiple
calls to helpers.
2021-05-07 11:56:43 -07:00
Kartik K. Agaram 74be534e2b starting to implement first macros
Another commit, another bugfix.

Some snippets from my currently exploding todo list:

- always investigate lookup errors immediately. Beyond the root cause, they should never happen at the moment, while we aren't reclaiming memory.
  we should always return a more precise error message. Usually involving null pointer checks.

- on abort, print out stack trace
  - emit mapping of labels to addresses during survey
  - store a mapping of symbols somewhere in the code image

- stop allocating 1KB per token; expand space for tokens as needed
2021-05-07 09:49:16 -07:00
Kartik K. Agaram 1648a04cc0 literal macros
Current plan:
- some way to define macros. For now:
    (def f (litmac litfn () (a b) `(+ ,a , b)))
- macroexpand will expand calls by passing them through the cdr
    (f 3 4)
    macroexpand: ((litfn () (a b) `(+ ,a ,b)) 3 4)
      => (+ 3 4)
    eval: (+ 3 4) => 7
2021-05-06 17:29:51 -07:00
Kartik K. Agaram e9981404da . 2021-05-06 17:27:17 -07:00
Kartik K. Agaram effbe423a7 . 2021-05-06 15:10:56 -07:00
Kartik K. Agaram ba5f556543 . 2021-05-04 20:20:03 -07:00
Kartik K. Agaram 5e0f459848 . 2021-05-04 20:09:07 -07:00
Kartik K. Agaram 0069028dae . 2021-05-04 20:00:03 -07:00
Kartik K. Agaram 66c18fda1d shell: unquote splice 2021-05-04 04:28:04 -07:00
Kartik K. Agaram bb9f4e4e1d shell: unquote 2021-05-04 03:53:00 -07:00
Kartik K. Agaram de94891356 shell: start evaluating backquote 2021-05-03 21:01:50 -07:00
Kartik K. Agaram 1c69a13a88 . 2021-05-03 20:31:57 -07:00
Kartik K. Agaram a08658f218 . 2021-05-03 18:16:15 -07:00
Kartik K. Agaram 1048729a6e . 2021-05-03 17:31:19 -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 3385febc11 shell: allow 'def' to overwrite 2021-04-29 23:53:28 -07:00
Kartik K. Agaram ca47215a6b keep the temporary progress screen off the keyboard 2021-04-29 20:38:18 -07:00
Kartik K. Agaram e73f1a3b41 . 2021-04-28 12:21:51 -07:00