Programmable Ink Lab Notes
title
Crosscut Extension Design Jam • Alex's Notes
dated
Feb 2023
author
Alex Warth

Part of the Crosscut Extension Design Jam

A Model of “Well-Formed” Circuits in Crosscut

Crosscut (as described in the essay) allows users to construct circuits that are not well-behaved. As an example, following circuit has a “variable” that is wired into both of the inputs of an “add” node:

This is problematic because the backwards computation wants to change the left operand and leave the top operand alone — but in this case, they’re the same thing! And so the evaluator misbehaves when the user changes the output of the “add”.

I spent some time thinking about how we might formalize some rules that can be used to determine whether a Crosscut circuit is “well-formed”. If we run these rules every time the user makes (or attempts to make) a new connection w/ meta ink, we can prevent offending connections from being made. That way only well-behaved circuits will be constructed.

I made pretty good progress on these checks, and I’m confident that we could finish them in a reasonable amount of time (maybe 1 week’s time?) if we decide that they’re important. IMO this would definitely be worth it if we wanted to make a more usable (shippable?) version of Crosscut. But we also have lots of ideas that involve changing the evaluation model / semantics of the language, and the resulting language would need a different set of well-formedness checks.

On Degrees of Freedom, Transforms, and Wadler’s “Views”

@James Lindenbaum noted that relaxation-based systems (like the experiments that we worked on as part of the Rectoverse project) have some problems that result in a poor UX. Namely,

Van Overveld’s take on relaxation has better performance, but it may not be better enough for us. It also makes implementing new types of constraints more difficult — you have to do some calculus, and sometimes it gets pretty tricky.

I spent some time thinking about how we might solve these problems, and I came up with an idea that I’m excited about.

TODO(@Alessandro Warth): write this down more coherently.

Processing the Results of Spatial Queries

Right now Crosscut has very limited support for spatial queries. (Other than the “count” thing, I can’t think of anything.) But there are lots of things that would be useful to support:

I’m sure we could new operators to do these kinds of things. But how do we specify what to do with each “match” in a spatial query? Can we make it feel nice to use, and not too programming-like?

As an example, consider the way concrete ink is used to write words in the Crosscut essay:

Suppose I want to apply a 3D-like style to everything that’s written in this way, in a certain region of the canvas:

Hiding Parts of a Model in a Reusable Component

When I was working through some of my thoughts on the “3D styling” problem described above, I drew the following circuit:

The specifics of how I’m using the port, etc. are not quite right. But the main idea is that I’m taking a point as an argument, and I’m creating another point that’s offset by 1 unit to the right, and 1 unit to the top, and drawing a line between the two points.

While it’s OK to use property selectors for this purpose, it would have been nicer to simply add (1, 1) to the original point — this could be done with a single “add” operator, since Crosscut’s operators are polymorphic. However, had I added that point to my circuit, it would have shown up at each application of this “function” which is not what I want.

@Marcel Goethals said that he explored a hiding mechanism in Habitat, but it didn’t feel great to use. I’d like to understand that better, and see if what we can do about it.

Other Interesting Ideas to Explore

Useful Examples

These are some examples that have been useful as a “proving ground” for new ideas: