Replies: 2 comments 12 replies
|
@dezza What do you think? You seem to be well versed in this #12671 (comment) |
|
It is similar in that it simply(caveman) explained is a transport belt for events. But the similarities stop there cuz NeoVim has server! Vim has struct. NeoVim adopts libuv, but Vim retains the existing platform-handling code. I was extremely surprised (and happy) to see that the complexity did not escalate while refactoring. Basically what I did was tag multiple refs:
The thing is I was pleased to see that the PRs could keep modularity, they did not get interwined deeply.. The modular PRs are reviewable and not even slightly convoluted, its merely an abstraction. All mentioned above keys,term-esc,jobs/ch,autocmd remains functionally during conversion. So you keep adding PR's on top integrating each new part (eventually each GUI, which can be proven easy first). I have spent a lot of time on that rabbithole and I'm just about Gtk, which takes more time. But non-GUI vim seems straightforward. Whats great about that, is that the core gets more testable, I think it should start being polished like that and tag the refs. It would be nice if a vim10 branch/target was a common goal, because its an anniversary. The goal would be to progress and prove the most advanced endgoal transitions to gtk ASAP - so the thesis is proven. However, the most important thing is keeping that boundary of logical change refs one thing converted to event-core at a time and confirm no breakage. This is what I'm most positive about, because it really doesn't seem that complex - its basic wrapping around existing entrypoints and highly modular and not intertwined at all. There is no long period of next-branch is "broken" without feedback. The contributors should daily drive it to test it thoroughly between the iterations. The immediate benefit to a testable core and what possibilities it opens now with less risk of breakage is whats comforting given how quickly that is achieved. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently the way the GTK GUI is implemented in Vim causes a bunch of issues/bugs. This is because Vim runs GTK, and GTK is designed so that it is the one running everything. I think it may be possible to refactor so that we run the GTK4 interface code on one thread, then communicate both ways between the Vim thread, like a weird terminal emulator.
One issue is that it would not be possible to use some of the existing code fully (e.g. menus). There would have to be a way to synchronize the GTK internal view of menus and Vim's view of menus. I am guessing this is a big blocker to this. However some existing things will be made simpler, for example the channel feature uses GIO IO channels for the GTK GUI, if we separate the GTK code into a different thread, then that is unecessary (just use Vim's existing common channel code).
An internal socketpair could be used to communicate special escape sequences (for simple stuff, e.g. drawing, showing the tabline/scrollbar). Then for more complex things (menus, print dialog, ...), something like a
GAsyncQueuefrom GLib could be used to pass around objects/data structures in a thread safe manner.Performance will probably not be any different, however it may be easier to maintain in the future. I think if this is done, the GTK4 GUI should be ported first, then the GTK3/2 GUI after separately.
All reactions