4 ms·
Reconciling Abstraction with High Performance: A MetaOCaml Approach
- ufo 8y agoThose interested in metaprogramming might also want to check out Terra, a low-level system programming language that is embedded and meta-programmed in Lua: http://terralang.org http://terralang.org. Unlike MetaOcaml, the low level language used for running the algorithms is different from the high-level language used to meta-program it. The low-level terra has a type system and semantics that is much closer to C (including pointers and many different integer types), while Lua is a straightforward dynamic language with a very simple type system. I wonder how statically typed Ocaml compares to dynamically typed Lua for the metaprogramming bits of the system.
- eslaught 8y agoTerra's pretty awesome. I used it to build a parallel/distributed programming language which we've been using to match or exceed the performance hand-tuned MPI / C++ code. http://regent-lang.org/ http://regent-lang.org/
- rixed 8y agoWhat I find astounding with meta ocaml is that the compiler guarantees that your program will not generate a program [that will not generate a program]* that will not compile. How does Terra fares in this regard ?
- eslaught 8y agoAs you may have expected, Terra doesn't approach this from a type safety perspective. The generated code is of course type checked, but the metaprogram is not. Instead the goals are productivity and performance. And along those axes I have to say it does remarkably well. I've built or been involved in building a number of compilers, I've never seen any other system that has made it as quick and painless to build a system, and get competitive performance[1] out of the gate. [1]: And just to be clear, when I say competitive, I don't mean with C. I mean with hand-tuned assembly and/or vector intrinsics. I regularly get performance with Regent that you simply can't get in a C compiler without writing vector intrinsics by hand.
- panic 8y agoThe "tagless-final" DSL style used here is cool in its own right. The author has a page about it here: http://okmij.org/ftp/tagless-final/index.html http://okmij.org/ftp/tagless-final/index.html
- tompark 8y agoIt used to be a free download until June 11, but they've extended that period to June 23.