On 05/02/15 16:52, Frank Shearar wrote:
On 5 February 2015 at 15:35, Levente Uzonyi <leves@elte.hu> wrote:
Rebuilding the whole AST after every keystroke is possible, but keeping it real-time is a bit challenging.
I would love to see an editor, which works on the AST directly - aka it maps the source code to AST nodes, and just updates the smallest possible subtree at each keystroke. Implementing such editor has it's challenges ofc, like typing a single character can invalidate the whole code, but the editor should keep the AST somehow in that case too.
C#'s Roslyn does this: http://blogs.msdn.com/b/ericlippert/archive/2012/06/08/persistence-facades-a...
This is an interesting approach. Their problem is not just updating the AST after every keystroke but keeping usable performance when doing code rewriting/refactoring. My first Macintosh, a SE/30 with a 16 MHz 68030, was able to do this with Think Pascal (by Mel Conway) 25 years ago. On my next machine, a 25 MHz 68040LC was fast enough... Stephan