Tylr: Demo of tile-based editing, a new kind of structure editing
twitter.com
twitter.com
I'm also excited by the fact that from their website the CRDT for local-first collaborative editing and Jupyter like alternative are also in the pipeline [2].
For those who are interested in the history of structure editor you can check the venerable Tioga editor in Xerox's Cedar programming environment [3],[4].
[1]http://worrydream.com/LearnableProgramming/
[3]http://www.bitsavers.org/pdf/xerox/parc/cedar/Cedar_7.0/07_T...
Hazel is a live functional programming environment that is able to typecheck, manipulate, and even run incomplete programs, i.e. programs with holes. There are no meaningless editor states.
let y = f(2, 3)
And I add a start parenthesis like this: let y = f((2, 3)
There is no longer a valid tree and it is not obvious at that point where, I, the end-user, want the parenthesis construct to end. let y = f()(2, 3)
but there should be a different command to do (`alt-(` in paredit) let y = f((2, 3))
There should of course also be "slurp" and "barf" commands to add or remove items from the parentheses if you do the wrong thing first (or want to wrap multiple things in the parentheses) let y = f(()2, 3)
Which possibly wouldn't parse.I did, and after typing in the left-parens inside the already existing left-parens, tylr gave me a right-parens in the "backpack", the space above where I was typing, and then didn't let me move outside of the enclosing parens pair (ie, I had to "put down" the matching right-parens to either enclose the 2, or the 2,3 pair). If instead I put in the left-parens before the already existing one, tylr automatically added the right-parens after the existing right-parens (which makes sense, it's the only legal place for the left-parens I just added to be matched).
But again, you could just try it out.
It might help to think of restructuring mode, the mode automatically entered upon constructing `(`, as a transactional editing mode in which you specify your AST-to-AST transformation.
http://danmidwood.com/content/2014/11/21/animated-paredit.ht...
I’m honestly waiting for a tree-sitter (or LSP) based paredit-mode to show up, so that I can use it for all modes and languages, and not just LISP.
(1) In tylr you move the parenthesis itself, rather than making the parenthesized term slurp/barf its neighbors. This may seem like a minor difference for simple operations like this but I think it's an important primitive UI metaphor that makes the editing experience feel more direct/linear/text-like rather than you having to translate your editing goal into operations on the AST.
(2) tylr generalizes beyond S-expressions to infix operator sequences and other multi-sorted syntactic forms (eg it understands you shouldn't be able to move expression forms in patterns).
(3) tylr generalizes beyond parenthesis moving to near-arbitrary range selection moving, eg I could make the selection (specified by the square brackets)
`( 1 + 2[) * (]3 + 4 )`
and directly move it over to give
`( 1[) * (]_ + 2 + 3 + 4 )`
(where tylr has inserted a hole `_` to keep things well-formed)
The UI looks very nice and minimalistic though, I really like it.