You are viewing archived messages.
Go here to search the history.

Mariano Guerra 2023-05-02 10:32:03

Structured Editing for All: Deriving Usable Structured Editors From Grammars

Structured editing can show benefits in learnability, tool building, and editing efficiency in programming.

However, creating a usable structured editor is laborious and demanding, typically requiring tool builders to manually create or adjust editing interactions.

We present Sandblocks, a system that allows users to automatically generate structured editors for every language with a formal grammar available.

Our system's input reconciliation process acts on arbitrary syntax trees to provides consistent interactions across our generated editors.

Our editors' editing experience is designed to be familiar to users from textual editing but, compared to previous work, requires no manual annotation in the grammars.

Jarno Montonen 2023-05-02 19:20:37

Very interesting. I actually contemplated on building support for importing ANTLR grammars into my structure editor generator, but ultimately decided against it at this point. Found the paper and couple additional videos from here:

Have to read the paper later. Couldn't find any references for code generation for now, so I wonder if this is just a prototype that generates the editor which is able to create and modify internal AST, but is not able to read or write textual code of the said language. Integrating with textual codebases would be an obvious requirement for any real world use and something I investigated quite a bit. Reading is of course easy because you can use an existing parser for the language, but unfortunately 'unparser generators' aren't really a thing so you'll have to implement one. It'll be an extra hurdle if you want your structure editor to only make minimal changes to the textual code and not randomly change formatting etc, so that you wouldn't render git diffs useless.

Jarno Montonen 2023-05-03 18:40:03

Read most of the paper. Good read. The Introduction and Related Work sections should be of interest to anyone looking for an introduction to the field of structure editors, the results of their user study should be of interest to anyone working on a structure editor (usability). Rest of it is implementation details of their approach which is quite parsing heavy. In my approach literally the only parsing is .NET double.Parse() πŸ˜„

Jason Morris 2023-05-04 15:04:55

I wonder if it's too harsh to say that this is not a structured editor, it's a text editor that also visualizes structure. It feels to me like one of the advantages of a structured editor is that you can't make syntactically incorrect statements, in the same way that a text editor doesn't allow you to insert non-text data.

Shubhadeep Roychowdhury 2023-05-02 18:02:47

Mojo – a new programming language for AI developers

Ivan Reese 2023-05-02 19:04:31

This is the new language by Chris Lattner, the main person behind Swift, LLVM, and clang. Seems he's active in the HN discussion about Mojo, so if you have any pressing questions maybe risk a visit to orangeland.

Corey Montella 2023-05-02 20:18:31

Looks interesting! It has a lot in common with Mech.

Corey Montella 2023-05-02 20:20:12

So if you have a file named hello.mojo (or hello.πŸ”₯ β€”yes, the file extension can be an emoji!), just type mojo hello.mojo :

Corey Montella 2023-05-02 20:20:33

lol I think I'm going to have to add a robot emoji for mech files...

Christopher Galtenberg 2023-05-06 14:31:01

"There it was β€” functional programming ex nihilo... Nobody would ever again wonder what good it was to allow functions to call themselves. And it was all so clear one could go home and build it oneself without any instruction book."