Titan Lang .vs. Terra Lang

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Titan Lang .vs. Terra Lang

João Victor Oliveira Couto
Hi, good morning,
Recently I've seen two different languages built to work with lua, both of then are compiled languages and I want to know the difference between them.
Both have almost the same syntax (a little) and both can call C functions.
The link for both are below:
Thanks for the time
Reply | Threaded
Open this post in threaded view
|

Re: Titan Lang .vs. Terra Lang

Dennis Fischer
One difference would be that terra is heavily focused on meta-programming, and you can imagine it like taking C, trashing its preprocessor and replacing it with Lua. Basically, you write code that writes code. Titan, from what I've seen, is structured more like a regular programming language that exists alongside and outside of Lua.

From: [hidden email] <[hidden email]> on behalf of João Victor Oliveira Couto <[hidden email]>
Sent: 12 February 2019 20:56
To: Lua mailing list
Subject: Titan Lang .vs. Terra Lang
 
Hi, good morning,
Recently I've seen two different languages built to work with lua, both of then are compiled languages and I want to know the difference between them.
Both have almost the same syntax (a little) and both can call C functions.
The link for both are below:
Thanks for the time
Reply | Threaded
Open this post in threaded view
|

Re: Titan Lang .vs. Terra Lang

Hugo Musso Gualandi
In reply to this post by João Victor Oliveira Couto
The one line summary is that Titan is scripted in Lua while Terra is
metaprogrammed in Lua. In Titan, Lua acts as a scripting layer, calling
(and being called by) Titan at run time. Meanwhile, Terra uses Lua at
compilation time, as a powerful macro/template system.

Titan is specially designed to interface well with Lua at run-time. Its
type system is very similar to Lua's and it is garbage collected, just
like Lua. Lua values can directly be passed to Titan functions. The
motivation behind Titan is to make it easier to speed up Lua
applications code. Some simple Lua programs can be directly converted
to Titan by adding type annotations. In other cases, rewriting a Lua
module in Titan is much easier to do than rewriting it in C.

Terra, on the other hand, has a type system that is closer to C's than
to Lua's. At run-time, calling Terra from Lua is similar to calling C
from Lua. Terra uses a system similar to LuaJIT's FFI to automate the
conversion between Lua and Terra values, but obviously you cannot pass
a Lua table or function directly to Terra. You would need to use the
traditional Lua–C API for that. Since Terra has a much more "C-like"
semantics it is specially suited for high-performance computing. For
example, it has builtin support for SIMD operators and the
metaprogramming is very useful for implementing optimizations such as
loop tiling[1].

[1] https://en.wikipedia.org/wiki/Loop_nest_optimization


Reply | Threaded
Open this post in threaded view
|

Re: Titan Lang .vs. Terra Lang

Ryan Ford-2
Is there a community for Titan Lang anywhere? Discord/Slack/IRC or anything? Is Github the only place to follow the project? Same question for Terra. I *try* to follow both projects a bit.

On Tue, 12 Feb 2019 19:10:31 -0200
Hugo Musso Gualandi <[hidden email]> wrote:

> The one line summary is that Titan is scripted in Lua while Terra is
> metaprogrammed in Lua. In Titan, Lua acts as a scripting layer, calling
> (and being called by) Titan at run time. Meanwhile, Terra uses Lua at
> compilation time, as a powerful macro/template system.
>
> Titan is specially designed to interface well with Lua at run-time. Its
> type system is very similar to Lua's and it is garbage collected, just
> like Lua. Lua values can directly be passed to Titan functions. The
> motivation behind Titan is to make it easier to speed up Lua
> applications code. Some simple Lua programs can be directly converted
> to Titan by adding type annotations. In other cases, rewriting a Lua
> module in Titan is much easier to do than rewriting it in C.
>
> Terra, on the other hand, has a type system that is closer to C's than
> to Lua's. At run-time, calling Terra from Lua is similar to calling C
> from Lua. Terra uses a system similar to LuaJIT's FFI to automate the
> conversion between Lua and Terra values, but obviously you cannot pass
> a Lua table or function directly to Terra. You would need to use the
> traditional Lua–C API for that. Since Terra has a much more "C-like"
> semantics it is specially suited for high-performance computing. For
> example, it has builtin support for SIMD operators and the
> metaprogramming is very useful for implementing optimizations such as
> loop tiling[1].
>
> [1] https://en.wikipedia.org/wiki/Loop_nest_optimization
>
>