Open ctsrc opened 3 weeks ago
Hi! First, I'll point you to Nyaovim, which may satisfy your needs as-is. The wasm use case is something I'm interested in exploring for a few ideas I have in mind:
I'm not totally sure that WebGPU is the best platform for Neovim in the browser, given that the DOM is available with rich font support and text rendering. My thought is to split Neophyte into smaller crates that could support different applications. Splitting out the Neovim UI state synchronization from the rendering would make it a lot easier to build GUIs for new platforms like the web. Did you have a particular advantage in mind for running Neovim under wasm that isn't possible with the current GUI offerings?
Two of the the underlying libraries used for the GUI of neophyte,
winit
andwgpu
, support compiling to WebAssembly and using WebGPU in the browser.I imagine there would be some challenges with running neophyte in the browser still. In particular with how the neophyte GUI would communicate with neovim. Ideally there would be a wasm build of neovim that one could run right there inside of the browser process, so that no remote neovim process on a server has to be spun up or connected to, as that comes with its own set of challenges like limiting resources that users consume when running many neovim processes for many users and authentication and authorization and storing files for the user on the server and all that.
I tried to look for any existing WASM builds of neovim. I found a forum thread and a link from there to an in browser version:
But I don't think the person that made that open sourced their work to make that WASM build. The copy of neovim they have on their Github profile does not include any WASM work that I can immediately see, and they never specifically mentioned any Github repo for the WASM version in that original thread above.
Although it could also be that all or most of what is already needed for running neovim is already upstream in the source repo of neovim itself? (cc @naruaway if you are open to sharing any details about how you compiled neovim to WASM for your website?)
Another related thing I found was a piece of software that connects a locally running neovim from the computer of the user to their web browser.
That one works by having one plugin for neovim that the user installs on their machine, and one extension for Firefox that the user installs in their browser. That kind of setup seems interesting too, even if it limits a bit what one can do (because then for example you would not be able to use it on say an iPad, and you wouldn't be able to use it if you are using a different browser than Firefox on your computer either).
Either way, I'm interested to know in terms of neophyte itself: