Live data from Hacker News

Ki Editor - an editor that operates on the AST

ki-editor.org

101–110 of 154 posts

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

#101
The problem with editors is that each one has a huge cognitive load for minimal benefit. I can't imagine learning this one just to be able to move blocks around easier.

At this point you can just let your IDE's AI refactor any code by just telling it what you want to do.

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

#102

The problem with editors is that each one has a huge cognitive load for minimal benefit. I can't imagine learning this one just to be able to move blocks around easier. At this point you can just let your IDE's AI refactor any code by just telling it what you want to do.

True, but muscle memory and a couple keyboard shortcuts (or heck, even using the mouse to select and drag the block) is always going to be faster then describing the changes you want and reviewing the output, at least for simple stuff.

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

#103

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.

> It can also be quite possible to invent structures which are valid but have no valid path to creating them.

I'm curious if you have an example of such a structure?

Pedantically: if, for every valid tree, there exists a bidirectional path to the empty root node, there's always at least one path between all given pairs of valid trees ... albeit one that no developer would ever take.

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

#104

Vim-like (terminal and VSCode extension) that prioritizes syntax-based navigation. Comparison to Vim and Helix: https://ki-editor.org/docs/comparison#user-content-fn-1

That comparison table is strange and sometimes wrong. Neovim for example detects and updates external file changes by default. And the coherence of the keybindings in Ki is "Great" bit vim/helix: > As you can see, there's no single logical categorization for these keymaps, they are either lowercase-uppercase, normal-alt, left-right bracket, or outright unexplainable. Word, End, Back, Change Word and even Change Inner…

Re. incoherence of vim's keybindings, I partially agree.

Most of the times, shift means "bigger", and only in a few places it means "invert".

Examples of "bigger" are all the motions involving words vs. WORDS, where WORDS are a broader interpretation of words; "V" is like "v" but by lines, thus in larger chunks; "C", "D", "Y" do the same as their unshifted counterparts, but extended to the end of line; etc.

Examples of shift meaning "invert" are fewer, and all sound irrational to me:

With x/X and o/O, the shift inverts the direction left/right or above/below, but we don't have for example i/I to insert to the left/right of the cursor, and H is not the opposite of h, J is not the opposite of j, etc.

With n/N, shift inverts next and previous. Why not n/p? I know, I know: p was already taken for paste, but still...

Finally, t/T/f/F are completely mixed up. In my mental model, t/f sound like to/from and I'd rather use them to move forward/backward till (not including) a char, while T/F would be the "bigger" variants which include the destination char.

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

#105

There was some Show HN some weeks ago on VCS/diff that operates on AST instead of lines/chars, anyone remembers its name?

There was Weave which just uses git for VCS and tree-sitter for conflicts. Gritzko is on-thread with his Beagle system, and I'm here too for BABLR ; )

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

#107

Earlier quoted context omitted.

Mine are: Cmd+Shift+V - Stacked clipboard, you can start typing to search or hit a number to choose what to paste (keeps everything you've copied/cut inside jetbrains for a while) Cmd+Shift+E - Recent locations, you can start typing to search - shows little buffers of where you've been recently Cmd+Shift+A - Action tab of the command palette - fuzzy search for any command (really the only shortcut you need, other tha…

Hero! I had not done my homework/have not been aware, but these all look fantastic! The stacked clipboard is something I periodically mentally complain about (Why is clipboard on every OS/tool I've used single item?) I will add one that are possibly more well-known: - ctrl + shift + F: Find text in any file - ctrl + N: Find types (structs, classes etc) - ctrl + shift + N: Find any file by name or path

I use shift+shift and type for all three of these.

Although i do use cmd+shift+r for global replace

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

#108
post #40
post #15

I made the vscode integration for this. I feel bad that I haven’t contributed much since, it’s a really cool project. IMO it’s important to try to innovate in the foundational tools of our craft (editors, languages, tooling, OS, etc) which Ki does.

This one? https://marketplace.visualstudio.com/items?itemName=ki-edito...

Yeah that’s it. Bundles the editor binary with the extension so you don’t have to install it separately.

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

#109

I didn't fully understand until I saw the examples > First-class syntactic modification > Notice the comma between the current and the next node is also deleted. > Notice how comma is added automatically. This is awesome! And I bet it arguably requires less logic to do so as well. Cool stuff. Now I'm wondering how much effort it would be to get a ki integration (or at least an AST-first rewrite) in Zed

I wrote the vscode extension for Ki. It would almost certainly be usable with Zed since it talks with the editor over a websocket. Check out the code in the Ki repo.
Post reply on HN