lua-users home
lua-l archive

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

Classes are the most common way to define APIs, i.e. to make software components interoperable (at least in theory: in practice, many libraries aren't as reusable as they pretend to be, because reusablility is genuinly hard). So indeed, that's a place where consensual conventions to follow are most important.

Lua has always chosen not to endorse any convention; this explains its most striking strengths as well as its most crippling weaknesses, and the lack of a *standard* class model certainly is one of the worst instances of this issue. That's the untold issue of many mailing list frustrations, which go like:

- "Hello, I'm $NEWBIE, I want to do $FOOBAR in Lua"
- "You  encode it in a compact way, like $THIS, or like $THAT"
- "Yes but what's the standard way?"
- "There's no standard, pick your favored approach. We believe in metamechanisms and user choices".

Then $NEWBIE walks away, frustrated that his request hasn't been understood, let alone satisfied: he wanted an officially sanctioned way to do $FOOBAR, the genuine one best way, the one that would free him from low level programming considerations (as defined by Perlis: "A programming language is low level when its programs require attention to the irrelevant").

A language is as much of a social entity as a technical one. A technically dull language that gathers considerable library-writing and -sharing forces, such as Java, is superior to an extremely neat language with little established conventions to reassure people, not enough libraries, insufficient interoperability between the existing ones, or portability issues. Being semantically cleaner and marginally faster than, say, Python, is no match against the lack of an established social environment, with conventions, comprehensive code base, *standard* ways to grow that base, no need to ask oneself preposterous questions such as "what OO model will I pick for my XML parser?", etc.

Lua seems to have chosen to assume its non-social nature, and strives to be the best generic language to put over YOUR set of libs and conventions. That's a niche, but a coveted one, and Lua does an excellent job at occupying it.

The regular efforts to build a platform (language + social features such as larger *official* std lib) around Lua systematically fail. Some of the reasons might be:

- The Lua team never saw fit to publicly endorse any of these initiatives. Again, this is all about social issues, not technology, and some sort of official seal of approval is just mandatory.

- Lua has no killer feature strong enough to justify switching from Python, or some other wannabe-Python language.

- All attempts have been undertaken while largely underestimating the required effort, or under the false assumption that the technical part of the challenge what the trickiest one.

-- Fabien.