lua-users home
lua-l archive

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


I want to be able to, in lua, write assembly code, which the library
then assembles, registers with the lua vm, which I can then call
into.

I've never used it myself and I don't know if a Lua binding exists for
it, but maybe the GNU Lightning project could be useful to you?

GNU lightning is a library that generates assembly language code at
run-time; it is very fast, making it ideal for Just-In-Time
compilers, and it abstracts over the target CPU, as it exposes to the
clients a standardized RISC instruction set inspired by the MIPS and
SPARC chips.

For more information: http://www.gnu.org/software/lightning/

Alternatively, there's a binding to TCC (Tiny C Compiler) available for
Lua at http://luatcc.luaforge.net/ and according to
http://bellard.org/tcc/tcc-doc.html#SEC10 TCC includes an assembler.

 - Peter Odding