Commit Graph

8446 Commits

Author SHA1 Message Date
Kartik K. Agaram
bca7f834c3 . 2021-06-15 21:40:40 -07:00
Kartik Agaram
614d0ecff4 . 2021-06-15 20:56:41 -07:00
Kartik Agaram
10687ed8bb . 2021-06-15 20:50:55 -07:00
Kartik Agaram
6515bace46 . 2021-06-15 20:41:34 -07:00
Kartik K. Agaram
b28899fe37 .
Support newlines. Looks like we pasted the input from the browser window
during the pairing session.
2021-06-15 20:38:53 -07:00
Kartik K. Agaram
03e6248c14 example program by Sumeet Agarwal
https://adventofcode.com/2017/day/1
https://archive.org/details/2021-06-02-akkartik-sumeet
2021-06-15 20:38:45 -07:00
Kartik Agaram
3a3fe4addb shell: better screenshot 2021-06-15 15:54:56 -07:00
Kartik K. Agaram
6280749410 always print black pixels when rendering screens
This is an old 'optimization' that turns out to not actually matter.
2021-06-15 15:37:37 -07:00
Kartik Agaram
3c70328b25 . 2021-06-15 14:57:55 -07:00
Kartik Agaram
0138b000a1 shell: improve docs 2021-06-15 14:48:52 -07:00
Kartik Agaram
88378503c4 . 2021-06-15 14:46:27 -07:00
Kartik K. Agaram
bc21fe0baf document responsiveness trade-off 2021-06-15 13:02:15 -07:00
Kartik K. Agaram
2bf7cb83ba do more work per fake-screen refresh
Refreshing the fake screen is still a heavyweight operation. Double-buffering
makes it less obvious but doesn't actually reduce the amount of work. We
need to ensure that we do enough work between refreshes to make them economic.
2021-06-15 12:36:38 -07:00
Kartik K. Agaram
8068b8450f more precisely track count of calls to eval
Before I only separately counted calls at each stack depth. I don't remember
if that seemed good enough or was just an oversight.
2021-06-15 12:28:52 -07:00
Kartik K. Agaram
c2c6f4c7ab flickerlessly render fake screens in environment
Font rendering now happens off the real screen, which provides the effect
of double-buffering.

Apps can now also use convert-graphemes-to-pixels for more traditional
double-buffering.
2021-06-15 10:33:18 -07:00
Kartik K. Agaram
b9fea69687 . 2021-06-15 08:59:36 -07:00
Kartik K. Agaram
f99cd767a4 periodic run of misc_checks
I should really stop using /disp8 jumps at the top-level given how inconvenient
it is to check for overly large offsets.
2021-06-12 22:34:22 -07:00
Kartik K. Agaram
0511b9fd11 helper to render fonts outside video RAM, take 2 2021-06-12 22:22:54 -07:00
Kartik K. Agaram
bda6982ba1 fix a bounds check
This should have gotten cleaned up during commit e0f6dd5240 (Mar 23).
2021-06-12 21:58:31 -07:00
Kartik K. Agaram
242b83ed46 roll back previous commit
These helpers don't actually help render to buffers with geometries different
from video RAM.
2021-06-12 21:41:50 -07:00
Kartik K. Agaram
b78bff9307 extract a helper to render fonts outside video RAM 2021-06-12 21:41:02 -07:00
Kartik K. Agaram
0dda332ce3 .
Roll back to commit 70919b45f0. Recent commits add lots of extra function
args for dubious benefit.
2021-06-12 21:11:22 -07:00
Kartik K. Agaram
82fdf176c1 snapshot
Looks like what's slowing down screen rendering is in fact _font_ rendering.
2021-06-12 21:11:03 -07:00
Kartik K. Agaram
85bcf050e7 . 2021-06-12 17:50:30 -07:00
Kartik K. Agaram
9b5b3bccd1 trying to eliminate flicker when rendering screen
Two interesting things:
- We don't really need double-buffering for rendering the screen on the
  sandbox as a progress indicator. Everything else is untouched, and render-screen
  should be doing that as well.

- Rendering just pixels of the fake screen is buttery smooth. It's the
  _graphemes_ that are slowing things down. Even though there's so many
  fewer of them!

As a result, drawing the fake screen less frequently in `evaluate` doesn't
actually help with flicker. Even though it'll make the debug cycle shorter.
So my current plan is to attack flicker in isolation before I mess with
the render frequency.

In this commit I optimized away the cursor handling. Still doesn't seem
to be helping. In fact it actually seems _worse_.
2021-06-12 17:40:53 -07:00
Kartik K. Agaram
286819685e eliminate some implicit writes to real screen 2021-06-12 16:24:27 -07:00
Kartik K. Agaram
70919b45f0 .
Rename cells containing screens to screen vars because of the ambiguity
that each grapheme in fake screens is represented by a type screen-cell.
While we're at it, we also analogously rename keyboard vars.
2021-06-12 15:16:50 -07:00
Kartik K. Agaram
4bd1785c86 shell: larger fake screen 2021-06-12 10:46:28 -07:00
Kartik Agaram
662e6b7177 . 2021-06-11 23:02:12 -07:00
Kartik K. Agaram
d4968adbc9 . 2021-06-11 23:00:00 -07:00
Kartik K. Agaram
af2e837787 try to abolish NULL from primitives 2021-06-11 22:48:14 -07:00
Kartik K. Agaram
952fb9a677 car/cdr of nil is now nil 2021-06-11 21:46:59 -07:00
Kartik K. Agaram
0dc4f9c62b hacky bugfix: support floats in nth
Needed because we don't yet have a primitive in the shell to truncate/round
non-integers to integers.

Before:
  (nth (/ 31 10)    # we don't have float literals yet
       '(1 2 3 4))
  => NULL

..with an unpleasant abort likely later on.

Really the correct thing to do is ensure none of my primitives ever returns
NULL. Start with car/cdr.
2021-06-11 21:36:12 -07:00
Kartik K. Agaram
3191861242 better name 2021-06-11 20:11:16 -07:00
Kartik K. Agaram
ef29fcdc91 cancel pending test
After all that, I'm not sure this is the desired behavior. If a function
defines multiple bindings, we shouldn't rename all their keys. So how to
choose?

Perhaps it's not so bad to have "symlinks" in this "file system". To unlink
two bindings you now need to define one of them in the sandbox.

All the refactoring is still useful, though.
2021-06-11 19:33:08 -07:00
Kartik K. Agaram
cbf3de0f08 back to the pending test
I'm ready again to take on commit 6169ec59c after lots of refactoring.
2021-06-11 19:26:20 -07:00
Kartik K. Agaram
040b60bc6e .
Save a single trace to potentially multiple globals just like a gap buffer
(if say we have a single let binding defining multiple functions).

I don't have a strong use for this yet, but it seems cleaner. Maybe it's
redundant or wrong.
2021-06-11 19:17:08 -07:00
Kartik K. Agaram
6f64f5d3b6 . 2021-06-11 18:20:47 -07:00
Kartik K. Agaram
8257825468 . 2021-06-11 18:20:30 -07:00
Kartik K. Agaram
c1e5ddfa54 . 2021-06-11 18:20:25 -07:00
Kartik K. Agaram
18c8e8c82f . 2021-06-11 17:54:04 -07:00
Kartik K. Agaram
4de136fb85 . 2021-06-11 17:50:34 -07:00
Kartik K. Agaram
177fa96a93 . 2021-06-11 17:48:12 -07:00
Kartik K. Agaram
c6e3bce981 . 2021-06-11 17:37:28 -07:00
Kartik K. Agaram
14f00ab369 . 2021-06-11 17:34:45 -07:00
Kartik K. Agaram
6cc2cd6cb5 . 2021-06-11 17:32:22 -07:00
Kartik K. Agaram
d5ae556a0c . 2021-06-11 17:31:29 -07:00
Kartik K. Agaram
9487b2dde7 . 2021-06-11 17:19:48 -07:00
Kartik K. Agaram
f8c5b63cb9 . 2021-06-11 17:17:13 -07:00
Kartik K. Agaram
c29a10ac37 .
Inline a function by patching a few variable names. I don't even have to
worry about `return` statements if there's a single call and it's in tail
position in the caller.
2021-06-11 15:37:03 -07:00