lua-users home
lua-l archive

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


> Does anybody on the list have any experience hooking Lua up to Fortran?

I did that, but it was more than ten years ago. And of course it
depends on the specifics of your Fortran compiler (how it interfaces
with C). All I remember is that it was not too difficult :)


> Of course, this means that you need to write C wrappers for your
> Fortran functions.

Not necessarilly. Maybe you can write the wrappers in Fortran.

For instance, LuaInterface (a binding between Lua and C#) uses this
approach. Since the resulting C# functions all have the same signature
(lua_State* -> int), it then uses one single C function to wrap
them. Each C wrapper is a closure over that single function with the C#
function as an upvalue.

-- Roberto