Commit Graph

99 Commits

Author SHA1 Message Date
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 8014210316 shell: support negative integer literals
We still don't support _any_ fractional literals, positive or negative.
2021-06-06 12:39:03 -07:00
Kartik K. Agaram c4cf38773f more space for definitions 2021-06-06 10:54:50 -07:00
Kartik K. Agaram 1f05bdcc34 conditionally display cursor in sandbox 2021-06-04 21:47:53 -07:00
Kartik K. Agaram 846664c4dd . 2021-06-04 20:15:11 -07:00
Kartik K. Agaram 6f7846ebc4 .
Menu shortcut for jumping to function definition.
2021-06-04 20:13:13 -07:00
Kartik K. Agaram f47051ae57 . 2021-06-04 20:08:29 -07:00
Kartik K. Agaram cd4d0ae5b6 .
Keep hotkeys stable when different elements are in focus.
2021-06-04 20:07:10 -07:00
Kartik K. Agaram 81b3f72fb8 . 2021-06-04 19:58:20 -07:00
Kartik K. Agaram 4bb826b40e . 2021-06-03 20:55:42 -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 bd49d5c35c shell: more stable trace when rerunning 2021-06-02 23:57:23 -07:00
Kartik K. Agaram ee536ff3e8 . 2021-05-31 15:18:25 -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 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 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 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 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 837926751a shell: add a lot of error-checking 2021-05-18 20:01:11 -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 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 6df53d463c back to macros; switch macroexpand to operate in place 2021-05-06 17:00:18 -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 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 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 bf4c19f053 shell: squeeze menu 2021-04-30 00:00:55 -07:00
Kartik K. Agaram 772b7b6585 adjust fake screen aspect ratio for verisimilitude 2021-04-29 23:38:37 -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 6503529627 white text everywhere by default 2021-04-29 16:27:43 -07:00
Kartik K. Agaram b860f108f7 adjust some colors and padding 2021-04-29 15:10:17 -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 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
Kartik K. Agaram ef8dc999ca . 2021-04-28 17:08:15 -07:00
Kartik K. Agaram 5b7f938733 start stashing and clearing sandbox after definitions 2021-04-28 13:55:10 -07:00
Kartik K. Agaram 55cde01edf shell: stream literals 2021-04-27 23:10:30 -07:00
Kartik K. Agaram 9e9e40c05a . 2021-04-27 23:04:20 -07:00
Kartik K. Agaram 409d26ca87 . 2021-04-27 23:03:23 -07:00