Home

Awesome

Fructure: A structured interaction engine in Racket

Screenshot

<img src="screenshots/menu-1.png" alt="alt text" width="400" height="282" />

Updated July 2019 : Installation instructions & mini-guide below

CLICK HERE for a video demo from RacketCon 2019

Fructure at RacketCon 2019.My talk (from the livestream).Slides: Real version. Extended unedited version.

Fructure is a prototype structure editor, which can currently be used to write & edit small programs in a small subset of scheme/racket. This is a personal project where I'm playing with ideas in editing, programming languages, and interaction design.

Note: now that this is getting some traffic I wanted to put up a disclaimer that some of the code is currently in a bit of a state: I've commented out some things and hacked up some others to smoothen the demo. My immediate plans are - after taking a post-racketcon break and aside from general cleanup - to unhackify the way transforms currently work, properly re-instate variadic parameters for binding forms, and do some profiling and address the current sluggishness.

I wrote a bit about my then-current direction in September 2018, just before beginning my current implementation attempt. I've completed most of what I talk about there, with varying levels of success: Fructure 1 of 2 Fructure 2 of 2. There will soon be some slightly more up-to-date notes via my racketcon slides. For more updates cyberfollow @twitter and @elsewhere. Here's an ongoing dev screenshot dump; check out the chronological overview:

fig 4: family history Screenshot

Installation Instructions

Basically, you need to install racket, a couple libraries, and a font if you don't want thing to look screwy.

MacOS:

  1. brew install racket --cask
  2. brew tap homebrew/cask-fonts && brew install font-iosevka --cask
  3. raco pkg install memoize
  4. raco pkg install rackjure
  5. git clone https://github.com/disconcision/fructure.git

Linux, Windows: (under construction)

TO RUN:

  1. cd fructure
  2. racket src/fructure.rkt

FAQ: Q: Is it suppose to be this slow? A: It's open source.

Fructure Primer

STEP 0: What to do if you're stuck / Speedrun instructions

  1. How to win: There are modes, but pressing ESC enough times should always get you to the base mode. From there, press SPACE to enter command mode. From here, PRESS "q" then RIGHT-ARROW to quit.
  2. Check the terminal for silent crashes (aka 'bonus' victory conditions)

STEP 1: mini tutorial

Fructure starts in NAV(igation) mode. The selector (red) encloses a hole (yellow).

NAV keybindings

A transform (red) maps the source (the hole) to (->) the target (selection (outlined in red) in menu (also outlined in red))

TRANSFORM keybindings

NAV keybindings (continued)

These keys (almost) suffice to build/delete arbitrary syntax, though not terribly conveniently. Build a tiny program this way. I say almost because you can't (yet, owing to a bug) input new identifiers in this way. Doing so (currently) requires being in the menu and pressing RIGHT on a lambda or define (see next step).

STEP 2:

Approximating standard text-entry

NAV keybindings

TRANSFORM keybindings

STEP 3:

Abstract copy/paste

NAV keybindings

TRANSFORM keybindings

STEP 4:

Simple settings scrubber

NAV keybindings

TRANSFORM keybindings

COMMAND keybindings

BOITE DIABOLIQUE: housing the 19 forbidden keybindings

EXPERIMENTAL & FICTIONAL keybindings: lies at best, trouble at worst

NAV

Screenshots

Structured insertion via walking the grammar:

Screenshot

Screenshot

Navigation mode

Screenshot

Copy/Paste via Metavariables

Screenshot

...

Screenshot Screenshot Screenshot Screenshot