<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>Terracrypt</title><id>https://www.terracrypt.net/feeds/tags/scheme.xml</id><subtitle>Tag: scheme</subtitle><updated>2026-03-01T20:46:16Z</updated><link href="https://www.terracrypt.net/feeds/tags/scheme.xml" rel="self" /><link href="https://www.terracrypt.net" /><entry><title>Smalltalk and capabilities: a vision of a road not taken for desktop computing (and beyond?)</title><id>https://www.terracrypt.net/posts/smalltalk-ocap.html</id><author><name>Jonathan Frederickson</name><email>jonathan@terracrypt.net</email></author><updated>2024-10-27T23:13:00Z</updated><link href="https://www.terracrypt.net/posts/smalltalk-ocap.html" rel="alternate" /><content type="html">&lt;p&gt;&lt;em&gt;This is my submission for the Malleable Systems Collective's &lt;a href=&quot;https://forum.malleable.systems/t/challenge-problem-fearless-extensibility/205&quot;&gt;&amp;quot;Fearless extensibility&amp;quot; challenge problem&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;I've had a brainworm for the last few years that's been bugging me. Way back in &lt;a href=&quot;./free-software-is-not-enough-on-practical-user-freedom.html&quot;&gt;this blog post&lt;/a&gt;, I linked a video that demoed an early Smalltalk system. The most mind-blowing thing about that demo for me was that, on those early systems, you could make connections between and thus compose different graphical widgets.&lt;/p&gt;&lt;p&gt;I recommend watching the video to really see it in action, but it looked like this:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;../images/smalltalk-bouncing2.png&quot; alt=&quot;Screenshot of an early Smalltalk system showing off its abilty to make connections between widgets. There is a widget showing an animation of a bouncing ball, and an editor widget below it editing a specific frame of that animation.&quot; /&gt;&lt;/p&gt;&lt;p&gt;At this point in the demo, Alan Kay is using a picture editor widget to edit a specific frame of a bouncing ball animation. These aren't applications in the sense that we'd think of them today; they're separate pieces of software that are nonetheless working together.&lt;/p&gt;&lt;p&gt;This really underscored to me that the conventional UI wisdom I was familiar with (that command lines are composable and GUIs are not) wasn't the whole story. It would be more accurate to say that &lt;em&gt;today's&lt;/em&gt; GUIs are not composable, but GUIs in general certainly can be - it's just a different point in the design space!&lt;/p&gt;&lt;p&gt;Of course, this Smalltalk system was designed in the 70s for a very different computing landscape than the one we have today. Notably, at the time, you wouldn't have been running much software that wasn't written by either you or the computer vendor. The commercial software industry wasn't really a thing yet! Contrast that with the computers of today, where there's a very good chance that &lt;em&gt;most&lt;/em&gt; of the software you're running isn't from Microsoft, or Apple, or whoever made your computer. And similarly, computers back then weren't used for nearly as many sensitive tasks as they are today; you wouldn't have been doing online banking from your Alto. In today's world, you might not want just any software you download to be able to modify anything else on your system in such a deep way.&lt;/p&gt;&lt;p&gt;There's a philosophy aiming to address this that I've been interested in for the last few years called the object-capability security model. If you're unfamiliar with the concept, I recommend reading &lt;a href=&quot;http://habitatchronicles.com/2017/05/what-are-capabilities/&quot;&gt;What Are Capabilities&lt;/a&gt; by Chip Morningstar for a solid introduction. Something that comes up repeatedly in capability discussions is that ideally, capability transfer should happen via unambiguous user intent. The above blog post provides an example:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Imagine that when Word starts running it has no access at all to anything that’s access controlled – no files, peripheral devices, networks, nothing. When you double click the file icon or pick from the open file dialog, instead of giving Word a pathname string, the operating system itself opens the file and gives Word a handle to it (that is, it gives Word basically the same thing it would have given Word in response to the Open File API call when doing things the old way). Now Word has access to your document, but that’s all. It can’t send your file to Macedonia, because it doesn’t have access to the network – you didn’t give it that, you just gave it the document. It can’t delete or encrypt any of your other files, because it wasn’t given access to any of them either. It can mess up the one file you told it to edit, but it’s just the one file, and if it did that you’d stop using Word and not suffer any further damage. And notice that the user experience – your experience – is exactly the same as it was before. You didn’t have to answer any “mother may I?” security questions or put up with any of the other annoying stuff that people normally associate with security. In this world, that handle to the open file is an example of what we call a “capability”.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;It strikes me that the inter-object Alto demo could be done in a capability-secure way! During the demo, we see a painter object and an animation object, and Alan Kay &amp;quot;draws a line&amp;quot; between the two objects. He inspects each object's properties to see what's available on each, and in the box in between the two objects, he establishes a link between the painter's &lt;code&gt;picture&lt;/code&gt; and the animation's &lt;code&gt;currentFrame&lt;/code&gt;. This feels compatible with a capability system!&lt;/p&gt;&lt;p&gt;One way that I can think of that this might work: the interface outside of each object is part of a more trusted system UI, which has references to each object it manages. By default, each visible object in this system need not have references to any other object, but the system UI (having references to both) can pass references between them. When you draw a line between objects and pass the &lt;code&gt;currentFrame&lt;/code&gt; to the painter's &lt;code&gt;picture&lt;/code&gt; (which happens outside the context of any particular object), the system UI would send the painter a reference to a part of the animation object.&lt;/p&gt;&lt;p&gt;By building a system like this, we might gain a few things:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Objects could be instantiated from untrusted authors with minimal authority by default. Until the user connects the new object to another, it need not be able to communicate with other objects in the system.&lt;/li&gt;&lt;li&gt;We'd regain the ability to deeply compose graphical software, &lt;em&gt;even though&lt;/em&gt; the user may not fully trust the developer of the software they're using.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;But, a few open questions that I have:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Could you model things like network access as just more objects in the system while making the UX reasonably straightforward? Maybe drawing a line to a network icon lets you do this?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;You may want the UI to be able to &amp;quot;minimize&amp;quot; connections between objects to avoid clutter.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Would some sort of structural editor in the &amp;quot;in-between&amp;quot; box be helpful for users? A blank text box is intimidating, but if the UI shows you what can go where with a menu (maybe &lt;a href=&quot;https://github.com/disconcision/fructure&quot;&gt;Fructure&lt;/a&gt;-style?) it might help ease people into this.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;There's a lot I don't know about how Smalltalk is implemented, and I'm sure there are a lot of details that would need to be worked out to implement something like this. But I think it's a path that could work, and it's something I'd like to see. :)&lt;/p&gt;</content></entry><entry><title>Visual structural editing for Guix (and Schemes in general)</title><id>https://www.terracrypt.net/posts/visual-structural-editing-for-guix-and-schemes-in-general.html</id><author><name>Jonathan Frederickson</name><email>jonathan@terracrypt.net</email></author><updated>2024-09-21T10:38:00Z</updated><link href="https://www.terracrypt.net/posts/visual-structural-editing-for-guix-and-schemes-in-general.html" rel="alternate" /><content type="html">&lt;p&gt;I've been noodling on structural editing for a while now. I'm fully bought into Lisps myself, but most of my friends and coworkers are skeptical, and I think a lot of their skepticism has to do (as usual) with all the parens. One of the points I make frequently is that with Lisp code being written as a nested data structure, the textual representation is just one of many possible representations. But it can be hard to get across what that means without concrete examples.&lt;/p&gt;&lt;p&gt;A few years back, I ran across &lt;a href=&quot;https://github.com/disconcision/fructure&quot;&gt;Fructure&lt;/a&gt; for Racket. To this day, it's still the structural editor with the most appealing visual display to me. But Fructure itself has a few drawbacks for my purposes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It's specifically targeting Racket. Racket is a wonderful Scheme, but I'm a Guix and Goblins user as well, and I would ideally like whichever editor I use to work with any Scheme, not just one.&lt;/li&gt;&lt;li&gt;It was a prototype, and its creator has mostly moved onto other projects.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In addition to these, I've been wanting a way to make Guix configuration as easy and painless as possible for new users. Having a sort of &amp;quot;command palette&amp;quot; available seems like it might be a good way to accomplish this.&lt;/p&gt;&lt;p&gt;So recently, I did a quick initial sketch of what such a system might look like:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;../images/structural-scheme.png&quot; alt=&quot;Pencil mockup of a structural s-expression editor for Schemes, showing a Guix operating-system record. There is an expression palette that can be used to search for expressions and drag them into the structural editor.&quot; /&gt;&lt;/p&gt;&lt;p&gt;I have a few initial use cases in mind:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Guix configuration, as particularly mentioned. Guix data structures (like &lt;code&gt;operating-system&lt;/code&gt;
or &lt;code&gt;file-system&lt;/code&gt;) are written as Guix-specific record types, so there may be some metadata about expected values in each embedded in them that you can tap into somehow.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://dustycloud.org/tmp/interfaces.html&quot;&gt;Content-addressed interfaces&lt;/a&gt; from the Spritely folks. This can make it more clear which methods are available to use on a remote Goblins object, and tying that into a visual command palette seems like it could be very nice.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Obviously given the fact that there are two styles of very different interfaces here, this has to involve some sort of runtime checking. And we probably can't entirely infer which to use based solely on the source code, so there's probably some per-project editor configuration needed for this to work. But... I think this might be doable.&lt;/p&gt;&lt;p&gt;I need to look into this some more, but a good starting point might be the &lt;a href=&quot;https://nrepl.org/nrepl/usage/misc.html&quot;&gt;nREPL protocol&lt;/a&gt;. It seems pretty extensible, and already has support for symbol lookups and such. But need to look into this all some more!&lt;/p&gt;</content></entry></feed>