4 ms·
Terra seemed promising when I ran across it a month ago. Does anyone know if it's possible to use LuaJIT's ffi module while writing Terra code? What I mean is,
by laarc 11y ago
Terra seemed promising when I ran across it a month ago. Does anyone know if it's possible to use LuaJIT's ffi module while writing Terra code?
What I mean is, there is a large body of existing code that I'd like to run alongside Terra. But if the choice is Terra xor LuaJIT, this becomes difficult.
- an_ko 11y agoYou might be looking for http://terralang.org/api.html http://terralang.org/api.html § Managing Terra Values from Lua. Quoting: > We provide wrappers around LuaJIT’s FFI API that allow you to allocate and manipulate Terra objects directly from Lua.
- corysama 11y agoYou can use Lua, Terra or both at runtime. The Lua part is LuaJIT including the ffi. The Terra part is LLVM and can link directly to C (maybe C++?). Lua can be used as a metaprogramming system to produce a static Terra .o or exe. Or Lua can be used as a runtime that can JIT and invoke Terra functions on the fly.