lua-users home
lua-l archive

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

On Wednesday 12 January 2011 12:36:18 Fabien wrote:
> On Wed, Jan 12, 2011 at 10:37 AM, Steve Litt 
> > I wrote the entirety of the Lua version of UMENU and the Lua EMDL to
> > UMENU converter using obj.method(args).
> That's another instance of the problem under the recurring "we want a
> blessed stdlib" rants: the problem isn't that you did something unidiomatic
> in Lua, it is that you did it in good faith. You couldn't identify an
> established normal way of doing common stuff in Lua.


Before we spend too much time mourning the way I used closures, we should 
remember that 1) It worked well, and 2) It didn't appear complex, messy, and 
it didn't appear to leave nooks and crannies in which bugs can hide out.
> Compare this to Python: in Python, you can do bad stuff: abuse lambdas, use
> loops where list comprehensions would do, go to ridiculous lengths to
> reimplement the wheel, etc. But if you do it, the community's reaction to
> your code would be an emphatic "yuk!", 

True, but Python's a different type of language, in my opinion, and please 
keep in mind I have less than a month's use of Lua, so please take my opinion 
with a grain of salt.

The way I see it is when you have a language in which all complex data is 
represented by tables of key/value pairs, the EXPECTATION is that you're going 
to find your own way to do things. IMHO that's the beauty of Lua.

Before proceeding, a little about Perl's "many ways to do it" philosophy, and 
why it's different from Lua. I have 15 years of Perl experience, yet there's 
still a lot of Perl I just can't read. Perl tries to "fix" wierd programming 
practices, and if it only sort of works, so what? Lua's different: The 
language itself isn't nearly as loosey-goosey as Perl, it just has a Swiss-
Army-Knife called Table.

Hey, Python's great. Python's indentation sensitive scoping is SUCH a great 
idea, making everything you write readable and eliminating brace placement 
arguments forever. But with Python, and Ruby, and most other languages, you 
must learn SO MUCH syntax to effectively program over a wide variety of 
problem domains. Are you going to use a dictionary, or a list, or an object, 
or...  With Lua, you have these tools called tables, metatables, closures, 
iterators, and probably ten more I don't know about. You think of the data 
structures you need, and then use the Lua tools to make those data structures.

The reason I like Lua is it's not Python (or Perl or Ruby or C). Lua gives me 
a small number of building blocks with which I can quickly build a program to 
do any batch process or CLI app, and if I ever discover a good and quick-
programming GUI library, whole applications.



Steve Litt
Recession Relief Package