4 ms·
I wonder how much faster a manually written C compiler in Vim script would be. The current code is essentially assembly instructions running as Vim script, thi
by flohofwoe 2y ago
I wonder how much faster a manually written C compiler in Vim script would be.
The current code is essentially assembly instructions running as Vim script, this gotta be incredibly slow, probably not much faster than an x86 emulator written in Vim script:
https://raw.githubusercontent.com/rhysd/8cc.vim/master/autoload/eightcc/backend.vim https://raw.githubusercontent.com/rhysd/8cc.vim/master/autol...
- svlasov 2y agoI wonder how much faster it would be if it was written in Vim9 script.
- aghastnj 2y agoThere's only one way to find out, bubba! You're gonna have to write an x86 emulator in vimscript for us, and tell us how it compares...
- actionfromafar 2y agoTime for JIT-compiled vimscript, I guess? Why should Javascript have all the fun.
- augusto-moura 2y agoFunny because neovim supports LuaJIT for it's lua init files by default. I wonder if there would be a way to compile vimscript to lua and have it everything inside the lua IR. Probably very hard, given the DSL nature of vimscript
- setopt 2y agoVim9script is already compiled (which is why it’s much faster), so there’s no need to go via Lua if you’re on ”normal” Vim :)
- aktau 2y agoThis was tried by ZyX-I when the Neovim project was started. AFAIK they managed to create an alternative parser for Vimscript, but the transpiler was never finished (or productionized?), I think due to incompatibilities that are hard to avoid. Some relevant issues: - https://github.com/neovim/neovim/issues/170 https://github.com/neovim/neovim/issues/170 - https://github.com/neovim/neovim/issues/387 https://github.com/neovim/neovim/issues/387 - https://github.com/neovim/neovim/issues/392 https://github.com/neovim/neovim/issues/392 - https://github.com/neovim/neovim/issues/801 https://github.com/neovim/neovim/issues/801