[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Inling C/Fortran in Lua
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 3 Jul 2009 14:04:53 +0200
Of course, luatcc does this already, but does not free you from having
to write the binding code, such as would be generated by tolua++.
Inling performance-critical code can be an effective trick:
Now the question is, is it worth pursuing this for Lua? tolua++ works
rather nicely, but you have to maintain a separate .c/.cpp file and
hand-roll the .pkg file (the cleaned header). So, for
proof-of-concept, I'd build on tolua++. After the first compile, a
quick dependency check means that the inlined code need not be
recompiled. One has to make sure that the .so/.dll is loadable from
the same location as the original Lua file, etc.
I've been generally thinking about Lua and High-Performance Computing.
A library like this, plus MPI bindings, and one has a means to write
very effective parallelized programs in a nicer language than FORTRAN.
Actually, modern FORTRAN is a good companion to Lua in this context,
since it's cleaner and faster than C, especially for things like bulk
array operations and complex arithmetic.