[haiku-development] Re: LLVM

  • From: André Braga <meianoite@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Wed, 14 Oct 2009 19:02:11 -0300

Em 14/10/2009, às 16:24, David Flemström <david.flemstrom@xxxxxxxxx> escreveu:

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.

Which is an idea I've been floating around this list for a year or so now ;)

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.

Yeah, that gets me quite excited too :D

One can dream, right?

The beauty of it is that this is real technology, available and deployable right now, and already been used for OpenCL. And I strongly suspect that Apple will deploy it on OS X 10.7 to seamlessly target multiple CPUs, GPUs and assorted coprocessors. Grand Central Dispatch Extreme if you will.

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.

On OS X the loader can handle LLVM bitcode files and link them seamlessly with Mach-O binaries at load time, and IIRC the converse is also true. It's quite probable that this work has already been done for ELF as well.


Other related posts: