lua-users home
lua-l archive

Crazy idea: compiling C to Lua

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Just had an interesting thought: could you write a compiler in Lua,
that compiles C into Lua bytecode or source code?
I think you'd need a C module (compiled to native code) that provides
Lua the ability to do some of the things C can do, such as call
syscalls and allocate raw memory blocks (char*s), but once you have
that framework in place, it could be possible to compile C programs
into Lua code, that would then only rely on Lua and that "framework"
module.
Or have I finally gone off the deep end?
-- 
Sent from my Game Boy.

AltStyle によって変換されたページ (->オリジナル) /