[haiku-development] Re: LLVM

  • From: David Flemström <david.flemstrom@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2009 21:24:38 +0200

On Wednesday 14 October 2009 21:09:06 André Braga wrote:
> IMO for the time being the strength of LLVM is in providing
> the tools for building compilers and runtimes for dynamic languages,
> and not so much as a replacement of GCC for the sake of replacing it.

What could give Haiku an interesting cutting edge compared to other operating 
systems would be to provide a cross-platform architecture-agnostic binary 
format using LLVM for its backend.

LLVM in its current state provides a complete byte code specification and that 
byte code is on such a low level that it easily beats the CLI or the JVM 
measuring raw performance, if a good compiler was used to produce the byte 
code. It would be theoretically possible to then invent a binary format that 
uses LLVM byte code, that would run almost as fast as native code on all 
platforms without modifications.

One can dream, right?

This has already been done for JVM/CLI compatibility via VMKit, by the way, 
but creating a binary format that is ELF-ish and that performs well and 
interacts with native libraries easily could be problematic.

Other related posts: