[llvm-dev] Entry for llvm.org/ProjectsWithLLVM - Terra programming language

Joshua Olson via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 30 13:34:10 PDT 2016


Terra: A low-level counterpart to Lua

By Zach DeVito (http://cs.stanford.edu/~zdevito)

Terra (http://terralang.org/) is a system programming language that is
embedded in and meta-programmed by Lua, which handles details like
conditional compilation, type systems, namespaces, and
templating/function specialization that are normally special
constructs in other languages. Terra code shares Lua's syntax and
control-flow constructs, and it can easily call Lua functions and vice
versa. Since the JIT compiler is available at runtime, libraries and
embedded domain specific languages can use it to dynamically generate
or auto-tune arbitrary high performance code with custom
optimizations.

Terra is backwards compatible with (and embeddable in) existing C code
and is likewise a small, monomorphic, statically-typed, compiled
language with manual memory management. There is also built-in support
for SIMD operations and other low-level features like non-temporal
writes and prefetches. Terra can optionally run independently from
LuaJIT and LLVM. In fact, if your final program doesn’t need Lua, you
can save Terra code into an object file, shared library, or
executable.


More information about the llvm-dev mailing list