Sometimes I worry that software, because you can do this, also let's you do similarly bizarre things obfuscated under a layer of complexity.
Imagine a car company announcing they'd built a perfectly cuboidal car entirely out of (say) tungsten — it only does 3mph and is expensive but we value engineering time over performance!
An operating system inside a text editor inside an operating system maybe inside a vm inside another operating system. Wait I forgot nested virtualization.
Cool. Why, though? I mean, it's not like this project has any practical value anyway, but wouldn't it be actually easier and more efficient to actually implement a C compiler in VimScript? Or is the vimscript ELVM backend the actual end-goal here, and C-compiler at question is basically just a proof that it works?
Thanks, at first I thought someone had written it in vim script, then I inspected the README in detail and learned it's only transpiled from C to vim script, which is not particularly exciting or impressive compared to a human wielding such a degree of vim script fu.
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:
Funny 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
This 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:
The difference is, that with Vim script it will either happen unexpectedly or unexplicably, while in Elisp it will/might happen later, but will be in the realm of understandable things.
(TECO means Text Editor Charactor Oriented, a line editor that had a macro capability. EDLIN was a line editor for MS-DOS.)