about summary refs log tree commit diff stats
path: root/shell/global.mu
Commit message (Collapse)AuthorAgeFilesLines
* shell: fleshing out the 'standard library'Kartik K. Agaram2021-06-061-1/+1
| | | | | | Based loosely on Arc's arc.arc: http://arclanguage.org https://github.com/arclanguage/anarki/blob/official/arc.arc
* refresh edited definitions on ctrl-sKartik K. Agaram2021-06-051-0/+41
|
* start editing function definitionsKartik K. Agaram2021-06-041-1/+11
|
* .Kartik K. Agaram2021-06-041-0/+24
| | | | Menu when cursor is within a function.
* select function to render firstKartik K. Agaram2021-06-041-0/+10
|
* always render functions starting at the cursorKartik K. Agaram2021-06-041-2/+4
| | | | For now we just never render definitions above it. That will improve.
* record the definition the cursor is currently atKartik K. Agaram2021-06-041-1/+10
|
* conditionally display cursor on function sideKartik K. Agaram2021-06-041-3/+4
| | | | | Always shows at top-most function. Can't actually do any editing yet.
* .Kartik K. Agaram2021-06-041-1/+1
|
* rename the definition primitive to 'def'Kartik K. Agaram2021-06-041-4/+4
|
* .Kartik K. Agaram2021-06-031-0/+3
|
* starting to support function editingKartik K. Agaram2021-06-031-0/+3
|
* .Kartik K. Agaram2021-06-031-1597/+1
|
* .Kartik K. Agaram2021-06-031-5/+5
|
* .Kartik Agaram2021-05-311-3/+5
| | | | | Until we get scrolling on functions, it's a little cleaner to draw the primitives on top.
* shell: raise errors when loading code on bootKartik K. Agaram2021-05-301-13/+13
|
* bugfix: unbound variables were not raising errorKartik K. Agaram2021-05-301-2/+2
| | | | | Since we switched error trace semantics from a designated label to a designated depth (commit 9831a8cef9 on May 19).
* some boot-time heartbeat messagesKartik K. Agaram2021-05-071-1/+11
| | | | This will help us with some common debug scenarios.
* clean up Bresenham line-drawingKartik K. Agaram2021-05-071-0/+32
|
* .Kartik K. Agaram2021-05-071-6/+6
|
* starting to implement first macrosKartik K. Agaram2021-05-071-0/+6
| | | | | | | | | | | | | | | 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
* more paranoia in shell/globals.muKartik K. Agaram2021-05-061-0/+48
|
* shell: macroexpand outermost callKartik K. Agaram2021-05-061-0/+22
|
* cleaner rendering of fake screens and keyboardsKartik K. Agaram2021-05-011-1/+1
| | | | | | 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?
* .Kartik K. Agaram2021-05-011-1/+1
| | | | Clean up trace colors.
* move color scheme closer to Solarized darkKartik K. Agaram2021-05-011-32/+32
| | | | | | | | | | | | | 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
* shell: allow 'def' to overwriteKartik K. Agaram2021-04-291-13/+6
|
* render definitions in 2 columnsKartik K. Agaram2021-04-291-9/+28
|
* tweak colors for definitionsKartik K. Agaram2021-04-291-1/+1
|
* render in a narrow columnKartik K. Agaram2021-04-291-1/+1
|
* adjust some colors and paddingKartik K. Agaram2021-04-291-8/+10
|
* bugfix: initialize gap buffers before using themKartik K. Agaram2021-04-281-1/+4
| | | | | | | 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.
* fix renderingKartik K. Agaram2021-04-281-1/+1
|
* shell: load/store from/to disk with indentKartik K. Agaram2021-04-281-25/+65
| | | | | Once I came up with the right approach, this worked on the first try once I got the types and registers to line up!
* start rendering definitions with indentationKartik K. Agaram2021-04-281-12/+6
|
* start stashing and clearing sandbox after definitionsKartik K. Agaram2021-04-281-0/+58
|
* shell: primitive 'not'Kartik K. Agaram2021-04-251-4/+45
|
* .Kartik K. Agaram2021-04-251-2/+2
|
* .Kartik K. Agaram2021-04-251-56/+56
|
* .Kartik K. Agaram2021-04-251-1/+2
| | | | Show all builtins now that we have more space.
* .Kartik Agaram2021-04-241-12/+0
| | | | Get rid of my experiment adding Game of Life to the shell.
* clean up with the final bugfixKartik K. Agaram2021-04-221-1/+0
|
* snapshotKartik K. Agaram2021-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It took me _way_ too long to realize that I'm not checking for errors within the loop, and that will cause it to manifest as an infinite loop as inner evaluations fail to run. Debugging notes, for posterity: printing one row of a chessboard pattern over fake screen (chessboard screen 4 0 0 15) gets stuck in an infinite loop halfway through debug pattern during infinite loop: VWEX. It's still in the loop but it's not executing the body raw (fill_rect screen 16 0 20 4 15) works fine same number of calls to fill_rect work fine replacing calls to fill_rect with pixel inside chessboard2 works fine at the point of the infinite loop it's repeatedly going through the hline loop -- BUT it never executes the check of the loop (< lo hi) with lo=20, hi=20. Something is returning 1, but it's not inside < stream optimization is not implicated simple test case with a single loop ( (globals . ( (foo . (fn () (screen i n) (while (< i n) (pixel screen 4 4 i) (pixel screen 5 4 i) (pixel screen 6 4 i) (pixel screen 7 4 i) (set i (+ i 1))))) )) (sandbox . (foo screen 0 100)) ) simpler (if you reset cursor position before every print): ( (globals . ( (foo . (fn () (screen i n) (while (< i n) (print screen i) (set i (+ i 1))))) )) (sandbox . (foo screen 0 210)) ) I now believe it has nothing to do with the check. The check always works. Sometimes no body is evaluated. And so the set has no effect.
* shell: refuse to 'def' duplicate namesKartik K. Agaram2021-04-211-1/+45
|
* shell: separate 'def' from 'set'Kartik K. Agaram2021-04-211-0/+25
| | | | | 'def' creates new bindings (only in globals) 'set' only modifies existing bindings (either in env or globals)
* .Kartik K. Agaram2021-04-171-0/+13
|
* loosening a few more buffersKartik K. Agaram2021-04-171-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)) )
* new primitives: abs, sgnKartik K. Agaram2021-04-161-1/+100
|
* open question: animations in the fake screenKartik K. Agaram2021-04-151-0/+38
| | | | Right now we just render the state of the screen at the end of an evaluation.
* .Kartik K. Agaram2021-04-151-17/+17
|