lua-users home
lua-l archive

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

On Aug 13, 2005, at 19:29, Chris Marrin wrote:

It requires that anyone using any package has to understand the rules of that package.


That does not bode well for wide adoption of Lua and its very nice array of supporting packages.

Well, perhaps. It depend of what you are looking for. Lua imposes very few, if any, "policies" to speak of. It's more of a "do-it-yourself" type of environment.

Seems like it would be better if require did some checks to ensure that rules were being followed. For instance, it could prevent the package being loaded from putting things into the global table. And it could throw an error if the return value was not a table.


On the other hand, Lua seems to be very much against imposing any kind of policies anywhere. As mentioned somewhere in "Programming in Lua":

"Lua gives you the power, you build the mechanisms"

While nice sounding as a mission statement, the above philosophy would also explain the paucity of reusable Lua code. There is just not enough common ground to build any reusable corpus given that no one can/want/need to agree on a minimum set of standard policies which would make it possible in the first place.

This is not necessarily a bad thing in and by itself... but it's most definitively something to get use to as this approach greatly differs from most other language environments which offer not only a programming language but an entire set of rules and regulations as well as libraries covering everything and the kitchen sink.


PA, Onnay Equitursay