
Lua Bash: Run Lua as a Bash loadable - chalst
http://freshmeat.net/projects/luabash/
======
patrickg
I like seeing more and more software extensible by Lua, which is a very decent
language. My very favorite is LuaTeX (luatex.org), where you can access all
ugly TeX internals from Lua and even create a complete typesetting system
without using the rather complicated TeX language, which is based on macro
expansion. I am not so sure if I'd use Lua Bash, for bash has always been
"good enough" for me.

~~~
chalst
Oh, hi Patrick.

The reason Rene Rebe wrote luabash initially was to speed up certain shell
scripts without drastic rewriting of existing code, efficiency being the main
justification for dynamic loadables (which came from ksh) in the first place.

The code here is simple, and I enjoyed reading it: it lit a few lights for me
about how to use Bash loadables.

------
phoyd
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!!

~~~
diego_moita
Forget 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
Ow, this is cool. Here's the mouth watering announcement:

<http://article.gmane.org/gmane.comp.lang.lua.general/74072>

