by Zach DeVito
A statically-typed, high-performance low-level counterpart to Lua.

Terra is a new low-level system programming language that is designed to interoperate seamlessly with the Lua programming language.

Like C, Terra is a simple, statically-typed, compiled language with manual memory management. But unlike C, it is designed from the beginning to interoperate with Lua. Terra functions are first-class Lua values created using the terra keyword. When needed they are JIT-compiled to machine code.

You can use Terra and Lua as a scripting-language with high-performance extension, an embedded JIT-compiler for building languages, or a stand-alone low-level language.

terra sort2(a : int, b : int) : {int,int} --the return type is optional
    if a < b then   
        return a, b
    else
        return b, a
    end
end

terra doit()
    var a,b = sort2(4,3) --now a == 3, b == 4
end

doit()
Information updated 06/07/13
View Comments