lua-users home
lua-l archive

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



On Nov 8, 2011 4:13 AM, "Miles Bader" <miles@gnu.org> wrote:
>
> Peter Drahoš <drahosp@gmail.com> writes:
> > I don't think it is. Also alien has issues when compiled with MinGW I
> > would consider to move to LuaFFI (modeled after luajit2 ffi api) [1].
>
> LuaFFI isn't portable though; is alien?

What do you mean by portable? I thought it was impossible in ANSI C to write Lisp's apply--that is, call an arbitrary function with an arbitrary list of arguments. The signature must be known at compile-time.[1] Now that I think of it, ANSI C has no runtime type information anyway so it is impossible to even describe the argument list.

It might be reasonable to say "libffi is on every platform I care about portability to" but that's different.

Jay

[1]: For i386 people and those who remember when memory was faster than CPUs: many modern ABIs' function calling conventions do not look at all like "push args as if they were a struct" or even "put the first couple args in registers if they are int-sized, otherwise push." For starters, if you have floating point registers you want to keep args there. I really enjoyed reading the MIPS NUBI proposal; it talks about the history of the ABIs on the platform and what tradeoffs might be.