3 ms·
What's really cool is, that on a system with a c-compiler and swig it is now possible (and trivial) to inline some C-code in a lua script, generate a swig wrapp
by phoyd 16y ago
What's really cool is, that on a system with a c-compiler and swig it is now possible (and trivial) to inline some C-code in a lua script, generate a swig wrapper from lua, compile it from lua, load it as a module into the lua interpreter and then export the defined functions automatically to bash!!
- silentbicycle 16y agoNothing against Lua (it's one of my favorite languages), but unless you're dealing with complex data structures, wouldn't it be more straightforward to just write a small pipe-style C program and skip the bash-to-Lua step entirely?
- diego_moita 16y agoForget swig. Have you seen luajit new ffi library? If you think Lua's C interface is simple, you're gonna be blown out of your mind with luajit's: local ffi = require("ffi") ffi.cdef[[ int printf(const char *fmt, ...); ]] ffi.C.printf("Hello %s!", "world")
- phoyd 16y agoOw, this is cool. Here's the mouth watering announcement: http://article.gmane.org/gmane.comp.lang.lua.general/74072 http://article.gmane.org/gmane.comp.lang.lua.general/74072