Posts

Showing posts with the label compiler

HLVM on the ray tracer language comparison

Image
We recently completed a translation of our famous ray tracer language comparison to HLVM . The translation is equivalent to the most highly optimized implementations written in other languages and this allows us to compare HLVM with a variety of competing languages for the first time. The results are astonishing. Running the benchmark with the default settings (level=9, n=5 to render 87,381 spheres at 512×512) on 32-bit x86 gives the following times for different languages: These results show that HLVM already provides competitive performance for a non-trivial benchmark. HLVM took 6.7s whereas C++ (compiled with g++ 4.3.3) took only 4.3s and Haskell (compiled with GHC 6.12) took 13.9s. However, cranking up the level parameter to 12 in order to increase the complexity of the scene, rendering a whopping 5,592,405 spheres, we find that HLVM blows away the other garbage collected languages and is even able to keep up with C++: This remarkable result is a consequence of HLVM's space-ef...

Problems with fslex and fsyacc

Back in 2004, we wrote a mini Mathematica implementation in OCaml in only four days. For fun, we decided to port this OCaml program to F#. Incredibly, porting just the lexer and parser from OCaml to F# has taken longer than it took us to write the entire original OCaml code! The reason is simply that OCaml has an incredibly powerful and mature suite of compiler tools for generating lexers and parsers whereas F# does not. Given that our original OCaml lexer and parser for Mathematica source code were written using ocamllex and ocamlyacc , it seemed obvious to translate the code into fslex and fsyacc . However, there are some serious problems with the F# versions of these tools: Incomplete : the F# tools were only ever intended for the F# compiler itself and not for wider use. Consequently, features are missing, e.g. in the regular expression implementation in  fslex . Unintegrated : there are Visual Studio support for these tools and, consequently, development is cumbersome compar...

HLVM's first front-end

Alp Mestan has begun work on the first front-end for HLVM. This project has many important goals: Provide a high-level language that HLVM developers can write test code, benchmarks and garbage collectors in. Serve as a tutorial for the people porting existing compilers such as Moscow ML, NekoML and PolyML to HLVM. Track new features as they are added to HLVM, such as closures, parametric polymorphism, parallelism and so on. Alp intends to apply to Jane St. Capital to fund a summer project that will port the entire OCaml compiler to HLVM.