Terra, hybrid of Lua and C

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Terra, hybrid of Lua and C

Post 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).
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Terra, hybrid of Lua and C

Post by Klaim »

I didnt know this one, which tweet pointed to this? Or maybe it was not me XD

Anyway it's interesting indeed.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Terra, hybrid of Lua and C

Post by Kojack »

Image

So retweet rather than tweet I guess, but I count them as the same thing. :)
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Terra, hybrid of Lua and C

Post by Klaim »

Ah yes I remember now, I started reading and have been interrupted so I forgot afterward XD
Post Reply