Commit Graph

8151 Commits

Author SHA1 Message Date
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
Kartik K. Agaram d0e2d093f7 cleaner rendering of fake screens and keyboards
I don't understand why a second line in the keyboard is visible now where
it wasn't before. That whole aspect has unclear desires. What exactly do
I want to happen on newlines?
2021-05-01 16:12:49 -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 c426cc0327 .
Clean up trace colors.
2021-05-01 15:49:48 -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 Agaram e3290a6c1a support color comparison in the palette doc
It's intended to be used with a browser's inspector.
2021-05-01 09:37:14 -07:00
Kartik K. Agaram bf4c19f053 shell: squeeze menu 2021-04-30 00:00:55 -07:00
Kartik K. Agaram 3385febc11 shell: allow 'def' to overwrite 2021-04-29 23:53:28 -07:00
Kartik K. Agaram d46c4b06b2 shell: comments 2021-04-29 23:48:36 -07:00
Kartik K. Agaram 24883b04f5 . 2021-04-29 23:43:17 -07:00
Kartik K. Agaram 772b7b6585 adjust fake screen aspect ratio for verisimilitude 2021-04-29 23:38:37 -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 24222b1735 make pixel borders of screen clear 2021-04-29 20:35:50 -07:00
Kartik K. Agaram 26eae87d3f make matching parens pop again 2021-04-29 16:47:26 -07:00
Kartik K. Agaram c811754807 render definitions in 2 columns 2021-04-29 16:43:40 -07:00
Kartik K. Agaram 6503529627 white text everywhere by default 2021-04-29 16:27:43 -07:00
Kartik K. Agaram 5124feb31e tweak colors for definitions 2021-04-29 16:14:47 -07:00
Kartik K. Agaram e13fd3e0a1 render in a narrow column 2021-04-29 16:11:23 -07:00
Kartik K. Agaram 05879d4f99 load large definitions 2021-04-29 16:10:30 -07:00
Kartik K. Agaram b860f108f7 adjust some colors and padding 2021-04-29 15:10:17 -07:00
Kartik K. Agaram 4541bfa59b extremely threadbare null-pointer protection
This protects us from reading null arrays, but not null structs.
It also doesn't protect us from writes to address 0 itself.

It is also incredibly unsafe. According to https://wiki.osdev.org/Memory_Map_(x86),
address 0 contains the real-mode IVT. Am I sure it'll never ever get used
after I switch to protected mode? I really need a page table, something
minimal to protect the first 4KB of physical memory or something.

I wonder what other languages/OSs do to protect against really large struct
definitions.
2021-04-28 22:22:55 -07:00
Kartik K. Agaram dcb6a21a91 bugfix: initialize gap buffers before using them
I keep running into one hole in Mu's memory-safety since dropping the Linux
dependency: null pointers no longer error when dereferenced. Here the problem
manifests as aliasing: lots of gap buffers share the same exact data near
address 0, because it was never initialized.
2021-04-28 22:03:58 -07:00
Kartik K. Agaram 7fa356abef fix rendering 2021-04-28 17:54:02 -07:00
Kartik K. Agaram b9c59a5f5b shell: load/store from/to disk with indent
Once I came up with the right approach, this worked on the first try once
I got the types and registers to line up!
2021-04-28 17:49:55 -07:00