You might be looking for 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.
Re:Terra: A low-level counterpart to Lua
by corysama on Tuesday December 01, 2015 @11:49AM
(#10656807)
You 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.
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.