2 ms·
Indeed, I suspect in the beginning, you would want to convert the tree back and forth between text and structure, so that you can edit parts of it in text. Edit
by audunw 12y ago
Indeed, I suspect in the beginning, you would want to convert the tree back and forth between text and structure, so that you can edit parts of it in text. Editing text is a bit like working with a scratch pad, you're jotting down ideas. But once you're down with a block or function, you want it to be correct.
The structure would then be for the editor to give you instant feedback on the syntax and semantics, for navigation, and for refactoring.
In a way, the most advanced text editors and IDEs already do something much like this, but it feels like they are still closer to a text editor than a pure structure editor.
The point is also that the editor is working on the exact same structure as the compiler, so the compiler can give you instant feedback on things you actually have to compile the code to find out. You could have dummy inputs to your function for instance, and instantly see what all the variables evaluate to, how long it takes for the function to execute, and how much space it takes.
- agumonkey 12y agoMaybe it's CISC vs RISC all over again. That said I don't want to serialize subtree into linear strings to be able to insert/delete a few things. It's information loss to me. I envision something like subtree derivations to "fork" the current code block into a new one and substitute some tokens (not strings). Basically interactive tree rewrite. Derive tests on the fly, add some visual cues (diffs, types, errors). Be creative, use a layout abstraction like DOM or even higher to experiment freely.