Commit Graph

369 Commits

Author SHA1 Message Date
Kartik K. Agaram
4dd08c268d . 2021-06-04 16:46:20 -07:00
Kartik K. Agaram
224e264a65 . 2021-06-04 16:43:19 -07:00
Kartik K. Agaram
cfb5dbce59 . 2021-06-04 16:41:18 -07:00
Kartik K. Agaram
e683a3fdee . 2021-06-04 16:39:05 -07:00
Kartik K. Agaram
380837ac2a more convenient 'def' 2021-06-04 16:12:30 -07:00
Kartik K. Agaram
bb1ccae27f rename the definition primitive to 'def' 2021-06-04 16:07:07 -07:00
Kartik K. Agaram
4bb826b40e . 2021-06-03 20:55:42 -07:00
Kartik K. Agaram
1c6b965a7f starting to support function editing 2021-06-03 20:49:24 -07:00
Kartik K. Agaram
d00f8dc6ca . 2021-06-03 20:37:51 -07:00
Kartik K. Agaram
3ef69a05b0 . 2021-06-03 20:29:37 -07:00
Kartik K. Agaram
6b34a1c9bf . 2021-06-03 14:55:33 -07:00
Kartik K. Agaram
b9ad848cff . 2021-06-03 14:49:49 -07:00
Kartik K. Agaram
63cd30d806 . 2021-06-03 14:42:07 -07:00
Kartik K. Agaram
9446e7e594 .
Drop some low-entropy trace lines.
2021-06-03 00:03:20 -07:00
Kartik K. Agaram
bd49d5c35c shell: more stable trace when rerunning 2021-06-02 23:57:23 -07:00
Kartik K. Agaram
60872b2b77 . 2021-06-02 23:36:34 -07:00
Kartik Agaram
35336a5f64 .
State as of https://archive.org/details/akkartik-mu-2021-05-31
2021-05-31 23:13:10 -07:00
Kartik Agaram
ccadba5b95 .
Until we get scrolling on functions, it's a little cleaner to draw the
primitives on top.
2021-05-31 20:40:08 -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
940401ff9e . 2021-05-31 10:19:38 -07:00
Kartik K. Agaram
0ea329da1f bugfix for disappearing trace
It turns out I have a problem with trace depth somewhere which I just wasn't
noticing before. Running certain sandboxes (line; maybe loops?) twice was
causing traces to no longer start at depth 1, which implies that they weren't
terminating at depth 1. This became a lot more obvious since I instituted
a max-depth.
2021-05-31 10:14:09 -07:00
Kartik K. Agaram
650f417de2 . 2021-05-31 08:59:09 -07:00
Kartik K. Agaram
3331144395 data.limg now loading properly again 2021-05-31 08:09:19 -07:00
Kartik K. Agaram
d2094133aa clearer test
It actually has nothing to do with macros. I just wasn't supporting backquotes
outside macros before.
2021-05-31 08:01:09 -07:00
Kartik K. Agaram
e9d2f00edb multi-macroexpanding backquote != nested backquote
This was quite difficult to diagnose. The issue I noticed was that brline
had stopped working. All the bugs in previous commits were hiding the cause.
Once I cleaned them up, I realized the problem was that the `(,x0 ,y0)
was triggering the nested-backquote check. The fix was fairly straightforward
then (even though I didn't yet understand why). But how to write a test
for this? I spent some time trying to do so without defining a macro using
literal macros, before I realized:

  You can't call literal macros; we don't have first-class macros.

Trying to insert literal macro support just breaks everything because we
have no way to distinguish between a literal macro call and the stage in
macroexpand where a symbol has been replaced with its macro definition.

How do you explain stuff like this? I grow weary of Lisp.

There's still some issue in loading the entire definition of brline from
data.limg.
2021-05-31 08:00:26 -07:00
Kartik K. Agaram
f691782d11 clean up a few things in macro tests 2021-05-31 07:24:51 -07:00
Kartik K. Agaram
af6fc79959 . 2021-05-30 21:52:31 -07:00
Kartik K. Agaram
35e0613849 shell: raise errors when loading code on boot 2021-05-30 19:12:20 -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
961ce67569 . 2021-05-30 17:20:42 -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
b699982fb4 . 2021-05-30 16:45:38 -07:00
Kartik K. Agaram
40c6066324 . 2021-05-30 16:41:38 -07:00
Kartik K. Agaram
cde14438e0 first test re-running sandbox with a deeper trace 2021-05-30 16:38:20 -07:00
Kartik K. Agaram
46009cd1bb . 2021-05-30 10:13:53 -07:00
Kartik K. Agaram
158b53eb8f first attempt doesn't work
I was aware of some complications. The various indexes and y coordinates
in the trace's cache would be unstable and need to be recomputed. But it's
surprising that the trace _completely disappears_.
2021-05-30 09:23:36 -07:00
Kartik K. Agaram
1496548287 start progressively increasing trace depth
The goal: the sandbox initially maintains a shallow trace. As you expand
into the trace, the environment reruns the sandbox at greater depth as
needed.

The challenge: expanding happens within edit-trace, which doesn't have
the whole sandbox needed to re-run the sandbox. We'll either need to expand
the trace's capabilities to include the whole sandbox, or duplicate some
logic to decide when to run the sandbox.
2021-05-30 08:51:58 -07:00
Kartik K. Agaram
9062eeb554 . 2021-05-29 21:45:33 -07:00
Kartik K. Agaram
10e41d00d8 . 2021-05-29 21:39:18 -07:00
Kartik K. Agaram
1eb74e2d5d shell: scrolling the trace 2021-05-29 20:52:57 -07:00
Kartik K. Agaram
9516dfa0b0 shell: skeleton for scrolling 2021-05-29 17:23:04 -07:00
Kartik K. Agaram
d85529f3fa cache visibility for all lines in trace
So far we were only doing so for the first few lines, just enough to render
one page's worth of lines. We'd have probably noticed if we collapsed some
lines after re-evaluating.
2021-05-29 17:13:06 -07:00
Kartik K. Agaram
fde296ca3c . 2021-05-29 17:03:22 -07:00
Kartik K. Agaram
58c801db0f . 2021-05-29 16:49:36 -07:00
Kartik K. Agaram
af46771821 . 2021-05-29 16:42:15 -07:00
Kartik K. Agaram
91ddc3a82d . 2021-05-29 16:41:47 -07:00
Kartik K. Agaram
c8b2424f45 shell: start implementing scrolling in the trace
I've been stymied for a week wondering how to reliably compute trace-line
identity. A trace can have multiple identical lines. Only some of them
may be visible at any point. How to remember which is which across re-evaluations?

There's no easy answer. I'm just going to keep things ad hoc. When you
re-evaluate, new lines can currently pop into visibility. However we guarantee
that just moving around the trace will be stable, thanks to the visible
bit being cached within each trace-line. Scrolling will be similar. Reevaluating
may cause the trace to be perturbed up or down. However, just scrolling
around will work reliably.
2021-05-29 16:37:32 -07:00
Kartik K. Agaram
4de6f80334 . 2021-05-29 16:25:38 -07:00
Kartik K. Agaram
9b131ce02b . 2021-05-29 16:22:08 -07:00
Kartik K. Agaram
7b84872380 shell: non-stream tokens are now small 2021-05-29 16:07:39 -07:00
Kartik K. Agaram
0bba6ccfc2 . 2021-05-29 16:04:30 -07:00
Kartik K. Agaram
aceb526b50 . 2021-05-29 16:01:50 -07:00
Kartik K. Agaram
c2e59bbf9d . 2021-05-29 16:00:59 -07:00
Kartik K. Agaram
6b212ed6e7 . 2021-05-29 15:54:41 -07:00
Kartik K. Agaram
d8f306c30c . 2021-05-29 15:53:31 -07:00
Kartik K. Agaram
2ad0a98f94 . 2021-05-29 15:53:21 -07:00
Kartik K. Agaram
56c621b6f1 shell: start reducing the waste in tokenize 2021-05-29 15:49:58 -07:00
Kartik K. Agaram
210553ac68 .
slightly improve colors
2021-05-23 22:53:54 -07:00
Kartik K. Agaram
bda55a3eec ctrl-s in trace: show entire current line 2021-05-23 22:47:40 -07:00
Kartik K. Agaram
f32e8035c7 . 2021-05-23 22:26:49 -07:00
Kartik K. Agaram
7fa0163941 disable ctrl-s when browsing trace
We're soon going to be dynamically rerunning the sandbox in other ways
when browsing the trace.
2021-05-23 22:18:51 -07:00
Kartik K. Agaram
d3103378c5 . 2021-05-23 22:17:05 -07:00
Kartik K. Agaram
d474128db1 shrink trace menu 2021-05-23 22:07:50 -07:00
Kartik K. Agaram
b2dd7e6a91 start truncating trace lines 2021-05-23 22:04:31 -07:00
Kartik K. Agaram
7a04c8104d shell: reduce trace depth in sandbox
We'll gradually make this more dynamic.
2021-05-22 10:28:21 -07:00
Kartik K. Agaram
6934f78e97 . 2021-05-22 09:30:11 -07:00
Kartik K. Agaram
64d3e8e2e0 . 2021-05-19 23:32:16 -07:00
Kartik K. Agaram
119e661f20 a second place with lousy storage management 2021-05-19 23:23:49 -07:00
Kartik K. Agaram
4b57c101b7 more robust print-cell
It is used to print to the trace, and we shouldn't crash the whole computer
just because the trace ran out of space.
2021-05-19 23:14:27 -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
f8c28e3a36 . 2021-05-19 17:30:25 -07:00
Kartik K. Agaram
831e2e0d64 . 2021-05-19 17:29:17 -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
9831a8cef9 shell: depth 0 as the check for errors 2021-05-19 01:21:02 -07:00
Kartik K. Agaram
3fc03a98e5 shell: start traces at depth 1 rather than 0
We're going to carve out depth 0 for errors.
2021-05-19 01:15:35 -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
c4475d83b7 shell: roll back a change to the 'when' macro
Introduced in commit 1adc904ef3 from a week ago, but it turns out brcircle
has been consistently broken ever since.
2021-05-15 12:43:35 -07:00
Kartik K. Agaram
183010779c A 'bowboard', a chessboard of rainbow circles
Compare with (chessboard screen 256)
2021-05-08 08:33:22 -07:00
Kartik K. Agaram
665b1e8f07 a full-circle rainbow 2021-05-08 07:58:56 -07:00
Kartik K. Agaram
1adc904ef3 new shell macro: do 2021-05-07 21:13:24 -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
c5f50f05b7 . 2021-05-07 12:46:41 -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
dd192dd52c . 2021-05-07 12:11:59 -07:00
Kartik K. Agaram
e42ae8219e clean up all definitions 2021-05-07 12:08:07 -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
d8298d1a2a clean up read_line 2021-05-07 11:37:48 -07:00
Kartik K. Agaram
91f76e6b22 clean up Bresenham line-drawing 2021-05-07 11:28:59 -07:00
Kartik K. Agaram
25eb9c580e . 2021-05-07 11:02:55 -07:00
Kartik K. Agaram
92fb55d50f no, we need hline1 for fill_rect 2021-05-07 10:14:51 -07:00
Kartik K. Agaram
c651bbeffc clean up hline and vline 2021-05-07 10:05:20 -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
7105b73fd3 give up on nested backquotes for now 2021-05-07 09:22:54 -07:00