[LLVMdev] Thinking about "whacky" backends

Csaba Raduly rcsaba at gmail.com
Fri Jun 3 02:08:12 PDT 2011


On Wed, Jun 1, 2011 at 2:30 AM, Joachim Durchholz  wrote:
> I've been tossing around some ideas about high-level backends.
>
> Say, have LLVM emit Perl code.
>
> Sounds whacky but isn't. It's good for the first bootstrapping phase in
> environments where you don't have a C compiler, where you don't have a
> cross-compiled binary for download, but you can execute Perl.
> It also makes a great inspect-the-sources-with-an-editor stage for
> aspiring compiler writers.
>
> Or emit JVM bytecode, or maybe for the upcoming Parrot VM that the Perl
> community is building.
>
> The questions I'm having is:
> 1. Is this really a useful approach?
> 2. How much work would such a backend be?

Have you looked at  Emscripten? (https://github.com/kripken/emscripten)

"Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode -
which can be generated from C/C++, using llvm-gcc or clang, or any
other language that can be converted into LLVM - and compiles that
into JavaScript, which can be run on the web (or anywhere else
JavaScript can run)."

You may be able to estimate the amount of work needed based on the
development effort required by Emscripten.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds



More information about the llvm-dev mailing list