Are you using something (e.g. LLVM) for code generation?
Can you generate binaries that are independent of the Lua runtime?
Are you using something (e.g. LLVM) for code generation?
Can you generate binaries that are independent of the Lua runtime?
Terra is designed for high performance numerical computing. As you mentioned, it has no garbage collector, uses C-like datatypes and its executables are completely detached from the Lua runtime.
Pallene, on the other hand, is all about being able to seamlessly interoperate with Lua at run-time. It is possible to directly manipulate Lua tables and functions from a Pallene program. From the point of view of Lua, Pallene modules can be loaded as a C extension module would, except that Pallene is designed to integrate even better with Lua (sharing its garbage collector and having better C API performance).
As the other commenter pointed out, we are currently compiling down to C. However, it is possible that we could switch to LLVM IR in the future.
I like the idea of having a scripting language like Lua, but the clarity of a typed, compiled, non-GC language instead of C or the templates of C++. Terra ticks those boxes. The mix of Lua and Terra seems to be very flexible too from my early explorations. Is Pallene within an order of magnitude of the speed of Terra given no special tricks are needed to pull off a task. Are there any "bad" things Terra does that Pallene keeps within the better side of Lua. I guess I am asking if Pallene is a better fit for a dual-language system based on Lua than Terra other than maximum numerical computing performance. Thanks!
[1] ziglang.org
[2] https://extemporelang.github.io/Pallene uses garbage collection, and shares the Lua garbage collector. The idea is to make as easy as possible to call Pallene from Lua and Lua from Pallene. Meanwhile, Terra only uses Lua at compilation time for metaprogramming and template building. At runtime, if you want to call Lua from Terra (or vice versa) you need to use the C API, just like you would do with C.
I wouldn't really try to compare the performance of Pallene with Terra. They are two very different languages, doing different things.
If I were just interested in numeric computing (arrays as well), I am assuming without benchmarking Terra and Pallene that Terra would win by an order of magnitude, no? Thanks again!
The bigger issue is that as soon as you call from Terra back to Lua you've made a circular dependency, and so you can't then dump an object file and have it be entirely free of the Lua VM. This for me happens to be one of the big selling points of Terra, because I know that I can write as much code as I want and (usually) can still come out with clean object files to link into any old project on the other side.
I definitely get the appeal of a system which is intended to integrate with the same VM. If it weren't for some of the constraints of my current project, I'd definitely be thinking about it, so I'm glad that people are putting effort into exploring both approaches.