LWN.net Logo

The H Speed Guide to Lua (The H)

The H Speed Guide to Lua (The H)

Posted Apr 18, 2012 13:46 UTC (Wed) by plundra (subscriber, #51099)
In reply to: The H Speed Guide to Lua (The H) by Cyberax
Parent article: The H Speed Guide to Lua (The H)

> And it shows. I maintain a set of Asterisk dialplans in Lua and doing anything moderately complex requires inventing my own language.
Could you elaborate on that? What's your definition of moderately complex?

I've got (what I think is) a small dialplan in AEL now, but I'm looking into pbx_lua which seems nicer at least.
Since it's not parsed into that original dialplan-syntax (which AEL is) for example. "Hello World" and a for-loop in LUA didn't put me off yet, but that's also the extent of my testing so far.


(Log in to post comments)

The H Speed Guide to Lua (The H)

Posted Apr 18, 2012 16:28 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

>Could you elaborate on that? What's your definition of moderately complex?

About 5000 lines of code.

>I've got (what I think is) a small dialplan in AEL now, but I'm looking into pbx_lua which seems nicer at least.

It's hard to find anything that's worse than AEL, actually :)

The H Speed Guide to Lua (The H)

Posted Apr 21, 2012 4:15 UTC (Sat) by sitaram (subscriber, #5959) [Link]

I liked a lot of things about lua, but walked away when I realised it had "os.getenv()" but not "os.putenv()".

I don't know how frugal they want to be but that was a tad too frugal for me.

The H Speed Guide to Lua (The H)

Posted Apr 26, 2012 17:27 UTC (Thu) by nix (subscriber, #2304) [Link]

A whole bunch of OSes don't have a C-layer putenv() that a Lua putenv could be implemented in terms of, including even recentish Solaris releases. Not having it is hardly an indictment.

The H Speed Guide to Lua (The H)

Posted Apr 27, 2012 10:29 UTC (Fri) by sitaram (subscriber, #5959) [Link]

Actually, saying "too frugal for me" is hardly an "indictment" :-)

The H Speed Guide to Lua (The H)

Posted Apr 27, 2012 15:41 UTC (Fri) by nix (subscriber, #2304) [Link]

What's really annoying to me is another piece of frugality: no regex library, but instead a *new* domain-specific regex-like language with less power and gratuitously different syntax, just because the implementation is a bit smaller (not even very much smaller than some modern regex implementations). Sure, a regex module is available, but other packages will generally prefer to use 'patterns' instead, because they're built in.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds