3 ms·
> Terra is a language that can also do that, and uses Lua as the metaprogramming language. Types are just Lua values. But then Terra doesn’t do that. Lua does.
by avgcorrection 4y ago
> Terra is a language that can also do that, and uses Lua as the metaprogramming language. Types are just Lua values.
But then Terra doesn’t do that. Lua does. But not to itself, so it’s not really about passing around types as first-class values any more than metaprogramming Java in Python would elevate Java types to being first-class values.
- brabel 4y agoTerra programs are kind of embedded in Lua, you can't separate the two. So to be very precise: Terra has metaprogramming done via Lua at compile-time, with Terra types being Lua values you can pass around, transform, return etc. in the metaprogramming "layer" of the Terra program. In Zig, you do the metaprogramming in Zig itself, but you're also limited somewhat as you can only use the comptime "layer" of the program. In my mind, it's very similar.