lua-users home
lua-l archive

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

Exactly, I want to write x86 assembly code, not Lua VM assembly code.

As for why not C ? C is fine, but I'd prefer to not write out a *.c
file, call gcc, compile it to a *.so, and load it back in -- just
something self contained.

The standard 90/10 rule is to write 90 % of the code in lua, the 10%
compute intensive part in C++/C. I'd prefer to write that 10% in
assembly ... but using lua as a macro langauge for generating said


On Tue, Jan 4, 2011 at 12:43 PM, Sean Conner <> wrote:
> It was thus said that the Great beo wulf once stated:
>> Note: I don't want LuaJit
>> I'm on x86_64 , ubuntu linux.
>> 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.
>  Can I safely assume you mean x86 assembly code and not the Lua VM
> "assembly code"?  Also, can you give more details?  Are you talking about
> something like:
> function = assemble [[
> somename:       push    ebp
>                mov     ebp,esp
>                sub     esp,#somespace
>                mov     eax,[ebp+incoming]
>                ...
>                ret
> ]]
> (pardon the Assembly---it's been quite a while since I last worked in it)
>> The goal here -- if I can do this, then I don't need to write most of
>> my code in C++ and then do all this bridging -- I can even write the
>> compute intensive parts in lua.
>  I can see wanting to skip C++, but what's wrong with C?
>  -spc (Just asking)