Search code examples
v8

Is it possible to use TurboFan as the backend for your programming language?


Can the v8's code generating backend be used in a third party programming language, in a way similar to LLVM is used? Is it "general enough" for that, can you even separate the backend from the v8?

I found this, but it does not help to answer my question:

https://github.com/v8/v8/wiki/TurboFan


Solution

  • V8 developer here. No, V8's compiler is not designed to be used as a stand-alone compiler. It is closely intertwined with the rest of the V8 runtime system, and very much tailored towards JavaScript.

    Of course, many of the concepts in Turbofan are applicable to other compilers/languages too. If you have a couple of person-years of engineering time available, you could totally extend (or fork and adapt) it to support one or more other languages. But that would be a lot of work.