Page 1 of 1

Terra, hybrid of Lua and C

Posted: Fri Dec 19, 2014 3:08 pm
by Kojack
A co-worker told me about this a while ago but I didn't look too deeply into it and I forgot. Then a tweet from Klaim last night got my attention (didn't realise I'd already heard of it until I told the same co-worker about it today).

Terra is a combination of Lua with a C compatible system level programming language.
The two are tightly integrated. Every Terra datatype, function and structure is a first class Lua type. Lua and Terra can call each other.
Lua remains a dynamically typed scripting language, while the Terra side is statically typed compiled language using LLVM.
Effectively, Lua is like a macro or template processor for the Terra language, you can use Lua to build Terra source code, compile it and call the result.
Performance of the Terra side is within 5% of the performance of raw C.

Pretty damn interesting.

Have a look at http://terralang.org for lots of examples (such as lua code that generates a terra compiled program based on a string of brainfuck).

Re: Terra, hybrid of Lua and C

Posted: Sat Dec 20, 2014 2:24 am
by Klaim
I didnt know this one, which tweet pointed to this? Or maybe it was not me XD

Anyway it's interesting indeed.

Re: Terra, hybrid of Lua and C

Posted: Sat Dec 20, 2014 3:42 am
by Kojack
Image

So retweet rather than tweet I guess, but I count them as the same thing. :)

Re: Terra, hybrid of Lua and C

Posted: Sat Dec 20, 2014 11:58 am
by Klaim
Ah yes I remember now, I started reading and have been interrupted so I forgot afterward XD