Live data from Hacker News

Ki Editor - an editor that operates on the AST

ki-editor.org

91–100 of 154 posts

Re: Ki Editor - an editor that operates on the AST

#91
post #77

How does this work in the many cases where in-progress edits result in an unparseable structure?

I assume it uses an error tolerant parser, same as most language servers.

Ex: https://github.com/microsoft/tolerant-php-parser/blob/main/d...

Re: Ki Editor - an editor that operates on the AST

#92
post #51

The "First-class syntactic selection" reminds me of my most used shortcut(s) in Jetbrains IDEs: the Expand / Shrink Selection. Ctrl + W Ctrl + Shift + W https://www.jetbrains.com/help/idea/working-with-source-code... It really changed my perspective on interacting with the 'text' of a file. VS Code, Zed, etc. have similar operations, but in my experience they expand and shrink too coarsely.

Yes, Java IDEs have had these since sometime in the 2000s.

It’s still some time in the 2000s and will be for the next 974 years

Re: Ki Editor - an editor that operates on the AST

#93

Many years ago, I created an editor operating on syntax trees that I think is more "hard-core" than this - that is, only tree-oriented operations are done. There is no parsing of text, since entering plain text, rather than a tree, is impossible. Hence, there can be no syntactically invalid programs. The challenge is getting this to be a useable way of entering programs. I think I made progress on this, but the feasi…

If you want to relive it then simh¹ with mame² might be an option. There appears to be some support for VT11³, along with docs⁴ to use as a starting point.

No, I'm not claiming to have read all one hundred pages already. However, from what I have read I'd love to see a functional demo.

¹ https://simh.trailing-edge.com/

² https://www.mamedev.org/

³ https://github.com/simh/simh/blob/master/PDP11/pdp11_vt.c

https://wiki.mamedev.org/index.php/MAME_and_SIMH

Re: Ki Editor - an editor that operates on the AST

#95
post #85

Many years ago, I created an editor operating on syntax trees that I think is more "hard-core" than this - that is, only tree-oriented operations are done. There is no parsing of text, since entering plain text, rather than a tree, is impossible. Hence, there can be no syntactically invalid programs. The challenge is getting this to be a useable way of entering programs. I think I made progress on this, but the feasi…

Pantograph[0] seems to be a more recent attempt to implement the same idea. It is still not a general editor but generalizing it to ranges of tree selections looks promising [0]: https://pantographeditor.github.io/Pantograph/

There are more examples in https://github.com/yairchu/awesome-structure-editors

Re: Ki Editor - an editor that operates on the AST

#96

Many years ago, I created an editor operating on syntax trees that I think is more "hard-core" than this - that is, only tree-oriented operations are done. There is no parsing of text, since entering plain text, rather than a tree, is impossible. Hence, there can be no syntactically invalid programs. The challenge is getting this to be a useable way of entering programs. I think I made progress on this, but the feasi…

> The challenge is getting this to be a useable way of entering programs. Well exactly. When the path between Program A and Program B can only be valid programs, you are going to end up with either a much longer, less intuitive path, or deleting everything and starting again. It can also be quite possible to invent structures which are valid but have no valid path to creating them.

Well, I think most common transformations work reasonably well. One usually doesn't want to do things completely contrary to the AST, such as convert "while aAnd it's certainly possible to create any valid AST in the editor I describe. The set of valid trees is extended to those with "holes" in places, which one fills in when entering a program, and it's always possible to do this.

The challenge is one of finding an intuitive user interface, not whether it's possible at all. One issue is that infix notation is unnatural for entering trees (prefix is more natural).

Re: Ki Editor - an editor that operates on the AST

#97

As always emacs has it already https://github.com/mickeynp/combobulate

Yeah and using combobulate feels so natural, I just wish it was easier to add support for other languages. In addition to the navigation, and simple edits (e.g. M-k kills node) you have Searching/editing/etc. using tree-sitter queries directly within emacs, possibly replacing other uses of external tree-sitter based tools.

It makes editing supported languages almost as pleasant as editing Lisp.

With how well the integration already work in existing editors, I'm curious how the UX can be improved further by an editor made specifically with AST editing in mind.

Re: Ki Editor - an editor that operates on the AST

#98

The "First-class syntactic selection" reminds me of my most used shortcut(s) in Jetbrains IDEs: the Expand / Shrink Selection. Ctrl + W Ctrl + Shift + W https://www.jetbrains.com/help/idea/working-with-source-code... It really changed my perspective on interacting with the 'text' of a file. VS Code, Zed, etc. have similar operations, but in my experience they expand and shrink too coarsely.

Mathematica is the earliest thing I am aware of with this feature where it was Alt+. to expand selection in their notebook interface starting in the early 90s. But the thing I miss most that I still can't shake the muscle memory of after almost a decade of not using much Mathematica, is that single/double/triple/n-click scaled this way as well. So double-click selected a whole word (as in all editors), triple-click s…

Ctrl-Space in TeXmacs, where the document is an actual tree (http://texmacs.org)

Re: Ki Editor - an editor that operates on the AST

#99

Earlier quoted context omitted.

Not even close.

How is it not? Scripting language? Check! Custom commands? Check! Windows management? Check! Build tools integration and error-based navigation? Check! File manager? Check!

Operating system? Check or not? :D

Re: Ki Editor - an editor that operates on the AST

#100

Earlier quoted context omitted.

How is it not? Scripting language? Check! Custom commands? Check! Windows management? Check! Build tools integration and error-based navigation? Check! File manager? Check!

Operating system? Check or not? :D

Vim has stopped before that particular threshold. But if ever Neovim get a GUI version, I believe the community will soon have its own Gnus, Eww, and EMMS.
Post reply on HN