satine.org

by Charles Ying

Connect The Dots: iPhone Graphics, OS X, LLVM, ARM, and Ruby?

February 1st, 2007

I’d like to connect the dots between Apple’s iPhone Graphics, OS X, LLVM and the ARM architecture, and what it means for compilers, interpreters, high-performance embedded software systems, specifically in graphics and bytecode engines.

We’ll start with what the heck LLVM does, and go from there.

  • LLVM is a fascinating compiler system that optimizes code at many stages, from compile-time to run-time optimizations; e.g., your code is optimized while it’s still running!
  • Apple uses LLVM to optimize OS X’s OpenGL pipeline to emulate older video hardware features and accelerate modern hardware.
  • Apple is integrating LLVM with GCC and supporting OS X’s executable file format. Chris Lattner posted about it here.
  • Apple has also contributed ARM backend enhancements to LLVM that would allow a ARM version for portions of a OpenGL graphics pipeline, and subsequently, Core Animation.
It means that any type of performance critical code that’s “interpreted” or “pipelined”, like OpenGL pipelines and JavaScript engines, can be effectively JITed automatically through run-time optimizations via LLVM.

Let’s see: Simple JavaScript engine, with automatic JIT compiler vs. manually coded JIT VM and compiler… hmmm….

This also has interesting implications for high-level languages like Ruby. Could a LLVM-Ruby provide the performance of YARV without the complexity of a manual JIT compiler and VM? I know that Python’s looking at it

Plus you’d get a JIT embedded ARM mobile processor port of Ruby for nearly free. And if that’s true for Ruby… why not for all the important bits of OS X?

Ahh, so that’s how iPhone runs Mac OS X

Technorati Tags: , , , , , ,

5 Responses to “Connect The Dots: iPhone Graphics, OS X, LLVM, ARM, and Ruby?”

  1. roger Says:

    LLVM would be nice for Ruby–Rubinius might be attempting something maybe like that. Note that Python’s current implementation is more of a “using an internal JIT’ in the form of psyco, which works well for them. We can hope something like it for ruby some day :) -=R

  2. satine.org » Dashing Xcode Says:

    […] from Sweden thinks that Apple is working on a new language. I said something similar in 2007, but a lot has happened in 3 […]

  3. Gracie Hayes Says:

    the demand for embedded software these days are getting higher and higher.`,;

  4. Jayden Scott Says:

    embedded software is a more simplified and application specific version of PC Softwares~::

  5. Halogen Cooker  Says:

    embedded softwares are mostly used on application specific integrated circuits:”.