[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why Lua is not more popular
- From: Sean Conner <sean@...>
- Date: Mon, 16 Sep 2013 19:57:42 -0400
It was thus said that the Great Dan Tull once stated:
> > The idea of binding generators has always struck me as a squishy
> > way to get something to work now, which will be a problem ...
> I think of the half dozen or so Adobe products using Lua, a couple
> of teams have tried using binding generators and none of them
> were satisfied enough with the results to take that course.
>
> What I tend to find is that bindings aren't all that hard and often
> the API you want to expose to Lua isn't the one you'd get if you
> exhaustively/mechanically translated it anyway.
Another thing I've found (by doing Lua bindings by hand) is that a
mechanical approach really doesn't make for good Lua bindings. Such a
mechanial approach to syslog() would end up with:
syslog(5,string.format("The foo is %s",status))
Or ...
LOG_NOTICE = 5
syslog(LOG_NOTICE,string.format("The foo is %s",status))
Or
syslog("LOG_NOTICE",string.format("The foo is %s",status))
Doing it by hand, I did [1]:
syslog('notice',"The foo is %s",status)
which is MUCH nicer (IMHO) than other syslog() interfaces for Lua I've seen.
-spc
[1] https://github.com/spc476/lua-conmanorg/blob/master/src/syslog.c