8cc.vim: Pure Vim script C Compiler

(github.com)

60 points | by JNRowe 2 days ago

2 comments

  • INTPenis 2 days ago
    It looks like they're just taking the entire eightcc compiler and stuffed into vim buffer memory.
    • rhysd 2 days ago
      No. It is a C compiler compiled to Vim script. So it is actually a C compiler written in Vim script.
      • munificent 2 days ago
        I think a more accurate way to describe it is that it's a C compiler written in C and then automatically transpiled to VimScript.

        No human hand-authored this giant pile of VimScript: https://raw.githubusercontent.com/rhysd/8cc.vim/master/autol...

      • flohofwoe 2 days 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/autol...

        • actionfromafar 2 days ago
          Time for JIT-compiled vimscript, I guess? Why should Javascript have all the fun.
        • aghastnj 2 days ago
          There'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...
        • svlasov 2 days ago
          I wonder how much faster it would be if it was written in Vim9 script.
  • flying_sheep 2 days ago
    I'd love to use vim to compile vim lolz