Commit Graph

8124 Commits

Author SHA1 Message Date
Kartik K. Agaram 888b4cd8ea always check for null in 'index' instructions 2021-05-07 21:04:45 -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 e74050ade4 always check for null in 'get' instructions 2021-05-07 18:25:43 -07:00
Kartik K. Agaram 540fd66473 a little bit more information when lookup fails
Basically this should never, ever happen until I start reclaiming heap
memory. I believe the only reason it happens is unprotected writes to address
0 or thereabouts.
2021-05-07 15:28:17 -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
Kartik K. Agaram f791cd9da9 macros almost done
Just one case left: macros within unquote.
2021-05-06 22:09:30 -07:00
Kartik K. Agaram 57fd40d500 some more cases 2021-05-06 21:41:03 -07:00
Kartik K. Agaram a1cfadc749 first passing test for macroexpand
In the process I spent a long time tracking down a stray TODO in 108write.subx
that I thought would abort but didn't since the switch to baremetal.

Then after I reintroduced that assertion I had to go track down a bunch
of buffer sizes. Stream sizes continue to be a huge mess.
2021-05-06 21:38:02 -07:00
Kartik K. Agaram f882130c86 . 2021-05-06 20:02:18 -07:00
Kartik K. Agaram 7c8ad5a419 more paranoia in shell/globals.mu 2021-05-06 19:38:54 -07:00
Kartik K. Agaram edae464db5 shell: macroexpand outermost call 2021-05-06 18:13:27 -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 6df53d463c back to macros; switch macroexpand to operate in place 2021-05-06 17:00:18 -07:00
Kartik K. Agaram a54c6f2ee7 belatedly migrate stale example definitions
Also bare-bones syntax highlighting for .limg files. Doesn't work when
.limg file is first file opened with Vim.
2021-05-06 16:42:08 -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 9156823c5d shell: start implementing macros 2021-05-04 19:49:21 -07:00
Kartik K. Agaram 7465fbb19f . 2021-05-04 19:46:49 -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 8482d5d7b4 . 2021-05-03 20:39:49 -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 93f1bee02c reading and printing backquotes and unquotes 2021-05-03 12:02:12 -07:00
Kartik K. Agaram 71a04056a8 printing quoted expressions 2021-05-02 22:31:19 -07:00
Kartik K. Agaram 27691024c4 . 2021-05-02 22:25:47 -07:00
Kartik Agaram c6343de7b0 . 2021-05-02 00:00:54 -07:00
Kartik Agaram f0e146fc7b . 2021-05-01 23:52:28 -07:00
Kartik K. Agaram f3fe2ac195 tool: compute nearby colors in default palette 2021-05-01 23:41:24 -07:00
Kartik K. Agaram 673025b346 primitive: convert r/g/b to h/s/l 2021-05-01 22:14:08 -07:00
Kartik K. Agaram 2c0539e6fa primitive: read r/g/b for color 2021-05-01 21:11:40 -07:00
Kartik K. Agaram 83847e9f0a .
Clean up menus.
2021-05-01 16:20:44 -07:00