Oct 7, 2024
A text editor that supports doodling.

Ways I've previously seen text coexist with a canvas:

I'm instead using the game engine idea of a pivot. Any time I toggle into doodle mode I have to first pick a pivot from one of the characters on screen. All my drawings are relative to that pivot, and edits to text maintain pivots alongside.

Displacements to the pivot are preserved in font-derived units, so it looks "reasonable" as you resize the font.

Deleting a character deletes all drawings pivoted on it. (But there's undo.)

This took 200 lines, so not too much though it was more than I'd initially expected.

Inspired by this thread.

permalink

* *
Oct 6, 2024
Indicating how the notebook fills blanks

Blanks can be filled in either with the results of computation or with what a person typed in. Now we indicate such conflicts in two ways.

  • Blanks filled in from computations get a distinct look (the cyan background), separate from both hand-written (black on white) and computed, non-editable text (cyan on white)
  • If I manually edit a blank, its background changes, and any code that was overridden doesn't execute. Here are a couple of examples:


But perhaps the color choice is too strong:

permalink

* *
Oct 4, 2024
A notebook with tabs that live-update as you edit.

The sort of interaction I live for: someone wished something existed, and it gave me a great deal of pleasure to manifest it.

permalink

* *
Oct 2, 2024
This debug UI has been surprisingly handy over the last few days. I'm able to visualize a parse tree even after it's been flattened, just using color transparency. All I'm doing is painting all the rects that contain the mouse cursor. Since the color is transparent, it doesn't matter what order they're in. (The larger rects actually come later; they're fall-backs if a more fine-grained rect isn't found.)

permalink

* *
Sep 30, 2024
My notebook now synchronizes the results of computation into named blanks in prose.

Repo

permalink

* *
Sep 29, 2024
A little toy I spent too much time on, just because fractals are always such catnip for me.

audio/video; 2 minutes

The LÖVE app with all its source code if anyone wants to play with it.

permalink

* *
Sep 22, 2024
I spent several hours trying to debug my notebook app last night, getting increasingly frustrated and demoralized. Eventually I realized there's a bug in my parser. It's a drag having to redo something I thought I was done with.

This morning I went back and built a debug UI for the parser, and now it shows the bug at a glance. The parse tree in the background is for the line the mouse pointer is hovering on.

A window showing some lines of text containing various text and math expressions. The top line shows the line `a = (3)`. The mouse is hovering on it. The background of the window shows a translucent parse tree for this line: an operator containing '=' with 'a' on the left. But then, where one expects to see the subtree for '(3)' one instead sees a subtree called 'nil', with a left hand side of a single space, and a right hand side corresponding to the subtree for '(3)'.

I need to learn to switch gears more quickly from:

"This should be easy, I suck."

to:

"I'm having trouble with this, it must be hard."


One fun thing is the couple of lines in the middle there. I reached for a notebook to scribble some equations for myself, but then realized all I wanted was to be able to draw the fraction line horizontally -- and I'm sitting in a tool that can do that. Using the tool to debug the tool :boom: (At least until I have no tools because I broke my tools using my tools.)

permalink

* *
Sep 19, 2024
Adding styling to my notebook UI.

It looks like I care about always making the styling very transparent, so it's possible in principle to guess what characters one needs to type to copy the look of something one sees on screen. So the style directives will never be hidden.

permalink

* *
Sep 17, 2024
Very initial draft of a notebook UI.

There are 2 kinds of lines here:

  • Regular lines are prose, but you can also insert named blanks into them using the syntax [value|name], which renders vertically across 2 lines. You can't nest blanks within blanks. These lines can wrap, but a single blank can't wrap across multiple lines on screen.
  • Indented lines (though the indentation is currently subtle) are code. They can render fractions using the syntax (a/b) as I showed before. (Not sure I'll keep this in the long term.) You can nest fractions within fractions. These lines don't support wrapping.

Planned:

  • synchronizing blanks with the same name
  • using code in indented lines to compute derived names without values inline

Inspirations:

permalink

* *
Sep 15, 2024
I've implemented the Mandelbrot set several times before, but zooming manually into the Mandelbrot set on a touch screen is surprisingly delightful.

Get it from the Lua Carousel Devlog.

It takes only 20 lines of code to implement the core of the Mandelbrot set. But then it takes 20 lines to specify the palette. And 100 lines to adjust the viewport in response to touch events. And another 10 lines to render at lower precision while touches are in progress.

This does run into the limits of floating-point precision at some high level of zoom.

permalink

* *
archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)