Writing Rune Programs

Mon, August 24, 2020
Adding Runes to Rune surfaces.

Today, in my wizard tower, I began forging a framework for creating Rune editors. It's in the early stages, but here are some interactive demos to get the idea across.

Here's an editor where you can add just two identifiers to the Rune surface (by clicking their images above the surface). You can remove them by right clicking.



Of course, Runes aren't very useful without parentheses. So here's an editor that lets you add those. You remove them too by right clicking.



(parentheses)

In the words of Alan Kay: Lisp isn't a language; It's a building material.

I fully agree. However, one thing that makes building with Lispy materials much more pleasant is having parenthesis-aware editing tools. This true for text-based coding as well as Rune-based coding.

Some minimal features I'll be needing for my own sanity:

  • Add an open paren and get a matching close paren for free.
  • Highlight an open paren and the close paren also gets highlighted
  • Be able to do "structured editing": cut everything between two parens, highlight everything between two parens, drag everything that's highlighted, etc.

And finally, just so you know, I won't be employing a "toolbar" paradigm like you see in these demos. The toolbar gets more and more unweildy the more identifiers there are in a language. Plus, clicking on an image in the toolbar doesn't let you specify where you actually want the Rune to go.

For those of you who want to experience some of these UI frustrations for yourselves, try writing a simple program with the below editor. For example, try writing this:

(define C
  (if (and #t #f)
      (build A)
      (build B)))

Make a mental note of everything that annoys you. Now you know what I'll be working on in the coming days :)

"Hello, World"
()


My hope is to have a passable Rune-editing experience by the end of the week. It doesn't have to be perfect -- just passable. That way, I can pull these interfaces into Unreal and write some real spells!

- Stephen R. Foster


P.S. Please consider supporting us on Patreon. We can't do this without you!