lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Fri, 13 Sep 2013 11:57:50 -0400
"D. Matt Placek" <> wrote:

> The "no batteries included" philosophy does divide the lua /
> (python,perl,ruby,etc) camps, and the no batteries included camp is
> probably just smaller.  

I don't think the problem is the disinclusion of the batteries. The
problem is this:

* Do batteries exist for a particular job?
* Where to get the batteries I need for a particular job?
* Will the batteries work?
* Will the batteries conflict with my other batteries?

> I work with embedded systems and I like not
> having a huge standard library that I have to distribute or try to
> trim down, or worry about figuring out what I need to add to my
> images when I add a package.  I love ruby too, but once you have a
> large set of batteries included packages, the problem is that
> everybody starts using them.  If I want to add a simple package it
> may require installing five other packages it depends on.  

As a former Perl programmer, I know exactly what you mean. I'll never
forget one time at a client site, to get some stupid piece of "other
people's" software to deploy, I had to install some Perl packages from
CPAN, and doing so messed up their Red Hat installation. What a damn

> And
> batteries included is often overkill.  If I want to parse XML, I may
> just need a simple function to turn some subset of XML into lua
> tables.  I don't need a default package that exposes every nook and
> cranny of XML to my scripting language and gives me 5 different
> paradigms to choose from.

I know what you mean, but XML's a very bad example. Unless you do a
phenomenal amount of coding, any home-brew XML tweaker will depend on
the spacing and line breaking of the input XML, and that's a horrible
mess. I know, I've done it many times.

> The fantastic thing about lua is that it's so easy to connect with
> C/C++ that I don't really care whether it comes with batteries.  If
> there's a library that has a C/C++ API I write a quick class to
> provide the functionality, have the class bound automatically into
> lua and boom, I have what I need in lua.  

You really, really, REALLY need to document exactly how you make these
Lua wrappers for C libraries, publish it publicly, and let the Lua
website link to it.

That being said, my impression has always been that C at least (I hate
C++) doesn't have the wealth of libraries that Perl and Python do.

The other thing is, I get a little spooked when I need to use a library
that needs C compilation, not so much when I make the library, but when
it's someone else's library.

> I don't have to worry about
> integrating some 3rd party package into my build and distribution
> with whatever dependencies the developer of the package thought were
> reasonable to have.

Yeah, when I write stuff that will be used by others, I try to stay
away from 3rd party stuff that they'll need to install on an unknown
environment. If I'm going to use a third party lib, it's for something
I really can't do myself, like parsing HTML.



Steve Litt                *
Troubleshooting Training  *  Human Performance