Re:Terra: A low-level counterpart to Lua
by nickpsecurity on Tuesday December 01, 2015 @12:17PM
(#10657077)
"Having a proper hygienic macro system (instead of C's very limited string-replacement "macros" or C++ template hell) is a really helpful abstraction, and the compile-time stuff you can do can basically act as a build system."
Exactly. I long ago came to the conclusion that any modern systems language should have a hygienic, macro system to balance productivity/maintenance against performance. Just makes things so much easier. That morons can abuse it is no reason not to have it in the language as they abuse everything haha.
Re:Terra: A low-level counterpart to Lua
by shahbazac on Tuesday December 01, 2015 @01:14PM
(#10657516)
How is terra's performance? You sort of compared it to C++, can it actually be compared with C++ in terms of latency performance?
Very good. I didn't benchmark it myself, but the language is designed for high-performance computing, and the authors' PLDI paper [1] shows it is competitive. Given that at the lowest levels, Terra basically reimplements C, and both compile to LLVM IR, similar performance is unsurprising to me.
The main point that gives Terra an edge is that its macro system makes implementing and testing potential optimisations easier.
[1]: http://terralang.org/pldi071-devito.pdf § 6. Evaluation
So I got excited and planned to use it to make a game, but although it can import existing C libraries [1], it can't import global variables, constants, or macros that take arguments, which puts a whole lot of existing libraries just out of reach.
This doesn't seem to have stopped Leonard Ritter from using it for Nowhere anyway, though being a crazy genius, he seems to have written his whole environment from scratch. [2] [3]
[1]: http://terralang.org/api.html#c-backwards-compatibility [2]: http://blog.duangle.com/2015/01/conspire-programming-environ... [3]: https://bitbucket.org/duangle/nonelang/src