Vim.wasm: Vim Ported to WebAssembly
github.com
Vim.wasm: Vim Ported to WebAssembly
1–10 of 17 posts
Re: Vim.wasm: Vim Ported to WebAssembly
#2Emterpreter was added to emscripten to workaround the problem in the browser runtime that you can't execute long-running blocking functions from within the browser loop. Emterpreter essentially allows to yield and continue from the middle of C code, however it's intended to only run as little code as possible like this (for instance only in the outer event-loop of an application), and call into asm.js or wasm code, where the actual work should happen.
Again, whether this vim demo works like this is speculation on my side, based on the relative sizes of the .wasm and emterpretify.data file sizes :)
Re: Vim.wasm: Vim Ported to WebAssembly
#3Re: Vim.wasm: Vim Ported to WebAssembly
#4Re: Vim.wasm: Vim Ported to WebAssembly
#5Oh great, soon I won't even know how to exit my browser anymore :)
Re: Vim.wasm: Vim Ported to WebAssembly
#6There are a few things that don't seem to work, e.g. `ciw`.
Re: Vim.wasm: Vim Ported to WebAssembly
#7Re: Vim.wasm: Vim Ported to WebAssembly
#8With that said, does anyone have insight in how porting something like this works? Are there terminal emulator libraries already for WASM or did they need to make their own?
Vim is an interesting case because unlike terminal programs that run in sequence, vim needs to redraw any part of the screen at any time. It strikes me as being more complicated.
I noticed there are some terminal libraries in there but they have modifications and I don't know enough to know if those are standard or the author needed to invent something.
Re: Vim.wasm: Vim Ported to WebAssembly
#9I'll admit up front to being a wasm cynic, but what exactly is the point of having a text editor trapped in a browser sandbox?
It's probably not a huge benefit, but in the same way you can often SSH into somewhere open up Vim make a change and then leave, I can see it being a nice 'clipboard' for my web text. It's not a lot different just to switching to Vim running on your desktop, but I often keep Vim in a separate virtual desktop. I could then also potentially optimise by browser Vim for formatting Markdown / JSON.
It also shows some of the lovely flexibility of Vim.