Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ethan (3163)

ethan
  reversethis-{ed. ... rap.nov.olissat}

Being a 25-year old chap living in the western-most town of Germany. Stuying communication and information science and being a huge fan of XS-related things.

Journal of ethan (3163)

Tuesday June 15, 2004
02:10 AM

Lua

[ #19254 ]

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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Just our of curiosity and never having heard of Lua [lua.org] before I checked it out on the scriptometer [sourceforge.net], mentioned [perl.org] by Gnat [perl.org] on use.perl.

    It actually does quite well, with an overall score of 90 compared to Perl's 149
    • It actually does quite well, with an overall score of 90 compared to Perl's 149

      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::Lua again when things didn't work at all in the beginning. But then I saw that Lua appears to be quite performant for some
  • The first time I heard about Lua was when I participated in the redaction of The Year In Scripting Languages 2002 [vendian.org]. Lots of links there. It looks like a not well-known language but with a small and dynamic community.
    • This is probably due to the niche it fills. There appears to be no Lua newsgroup, only one mailinglist to which I had to subscribe to get some help yesterday. The list is active and the replies I got were prompt and competent.

      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