A few days ago I had the bright idea of writing an Inline module, just because I was curious how that would work. I chose a language that came to my mind quite spontaneously, partly because I remembered vaguely that it was a language meant to be embedded into other applications.
What I've seen so far of Lua is extremely impressive. The language is extremely clean and, despite offering only a handful of features and concept, very powerful. Some interesting things have been integrated into it quite well, such as coroutines and closures. The latter makes it feel a bit like a functional programming language with the very nice touch of an imperative syntax. It's even object-oriented.
Its C API is a bit confusing for me as of now. That is probably because I haven't yet written a single program in this language. But the Inline stuff already works quite well for some of the basic Lua/Perl types. The nice thing about Lua is that its types map quite well onto Perl. It knows about functions as a data type so a little bit of currying looks like this:
function foo (a)
return function (b) return a * b end
end
io.write( foo(5)(3) )
Very neat! I have already some ideas how the inlined Lua functions can return Lua closures back to Perl as in
use Inline Lua;
print foo(5)->(3);
__END__
__Lua__
function foo (a)
return function (b) return a * b end
end
Lua on the Scriptometer (Score:2)
It actually does quite well, with an overall score of 90 compared to Perl's 149
Re:Lua on the Scriptometer (Score:2)
Yes, I also noticed this on the scriptometer. And one has to keep in mind that Lua is not even meant as a standalone language. It is intended to be fleshed out with customly defined C functions to provide additional functionality.
This comparison [iolanguage.com] made me stick to Lua. I was on the edge of dropping
Inline::Luaagain when things didn't work at all in the beginning. But then I saw that Lua appears to be quite performant for someLua in 2002 (Score:2)
Re:Lua in 2002 (Score:2)
I haven't yet grokked the 'social structure' of this list but it appears that Lua's developers are there, too. It's odd in that both the people using Lua as a programming language and those more concerned with embedding Lua (and thus focussing on Lua's C API) can be found on the same