Frame-Based Editing [pdf]
This is pretty incredible work wrapped in an unassuming name. It basically presents an entirely new way to interact with any programming language. You could make an emacs mode that worked this way, for example.<p>I could see this being one of the fundamental ways of overcoming Lisp bias. Lisp still isn&#x27;t mainstream. Clojure was a nice attempt, but it fell short. You can find companies that use Clojure, but it&#x27;s not the lingua franca of any domain (except perhaps text editors).<p>If you were to expose a way to write Lisp without dealing with any parens at all, it might have a chance of sparking the interest of younger programers long enough to seduce them to Lisp&#x27;s other benefits: when you write in Lisp, you&#x27;re writing in the abstract syntax tree normally generated by other languages. This allows you to write macros, which transform the tree in arbitrary ways. It&#x27;s trivial to write a program to analyze your entire codebase in arbitrary ways (what are the most popular function calls? what&#x27;s my dependency graph look like? which functions are unreferenced?) which is normally a herculean effort in other languages.<p>And it all comes down to syntax. `(if a (b) (or c d))` is so utterly <i>foreign</i> to most programmers compared to `if (a) { return b(); } else { return c || d; }` that it&#x27;s nearly impossible to overcome the inertia long enough to persuade them that the tradeoff in readability is worth the power you get.<p>I think this work could be helpful here. When you throw a newcomer in front of a Lisp editor and say &quot;Write a program,&quot; what goes through their minds? &quot;How do I write an if statement?&quot; &quot;How do I call a function?&quot; &quot;How do I set a variable?&quot; &quot;How do I loop while a condition is true?&quot; All of these are abstract concepts, not specific to any language, let alone Lisp. That&#x27;d let them avoid dealing with parens altogether. Then you can introduce the idea of a macro, which just combines new ways of using existing concepts.<p>Regarding color: I&#x27;ve often wished for colored quasiquotation. `(foo `(bar `(,baz))) would be more useful if your editor displayed the background color differently for each level of quasiquation. It would also de-mystify statements like (fn (x) `(define-macro foo (y) `(define ,y ,&#x27;,x))) which can otherwise be incredibly difficult to reason about. (Thankfully nested quasiquotation is rare, but suffice to say I wish editors used color more effectively rather than stylistically.)<p>Sadly, emacs is one of the only editors flexible enough to implement the concepts presented in this paper, and the intersection between emacs users and novice programmers is about as large as the intersection between hackers and MBAs. But you can flip it around: emacs <i>is</i> flexible enough. That means you can ship a custom preconfigured emacs designed specifically for Lisp hacking, set up to mimic Atom&#x2F;Coda&#x2F;Sublime&#x2F;whatever.