lua-users home
lua-l archive

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


Hi,

thanks for the feedback.

Alexander Gladysh, 04.09.2010 11:54:
On Fri, Sep 3, 2010 at 13:24, Stefan Behnel wrote:
I changed that paragraph to the following, hoping that it makes it
clearer what I actually meant to say.

"""
However, Lua code is harder to write than Python code as language and
runtime lack many of the batteries that Python includes. Lua is not commonly
used as primary language for large applications, but it provides a perfect
backup language when raw speed is required and the edit-compile-run cycles
of binary extension modules are too heavy and too static for agile
development.
"""

This is not the "absolute truth". You should at least add "in my
opinion" to this paragraph.

1. "Lua code is harder to write than Python code as language". This is
really a matter of personal preference. I, personally, believe that
Python is harder — its syntax is not designed half as well as Lua's.

Hmm, the way I'd put it, it's certainly more pragmatic than Lua and less minimalistic.


But that is my opinion, nothing more.

Sure, why not. It's /my/ personal experience that Python can be learned and used productively within hours for an experiences programmer and within a couple of days by a programming newbee. IMHO, that qualifies it as a well designed and easy language. YMMV, as usual.

Lua, for what it provides natively, is also simple enough to be learned in little time. But I doubt, for example, that a newbee would understand object oriented programming in Lua within a day, whereas it comes along as a pretty natural (and, again, pragmatic) language feature in Python.


2. [...] if you'd said something along the lines
that "Lua ecosystem is heavily underdeveloped when compared to
Pythons", this would be the truth.

3. [...] when compared to Python, in general (not mine) practice, Lua is
definitely less used as a primary language and more as a secondary
scripting language.

Ok, I'll consider that.


4. "[Lua] provides a perfect backup language when raw speed is
required and the edit-compile-run cycles of binary extension modules
are too heavy and too static for agile development." Now that is,
probably, the truth (however this is not the everything that Lua is,
far from it).

It's what a Python developer would see of Lua and be interested in, though. Apparently, LuaJIT can be as fast as well optimised C or even Fortran for computational code, which is a place where the normal Python runtime has deficiencies (well, there's NumPy/SciPy/Cython with all its extremely optimised number crunching stuff, but I just mean pure, algorithmic Python code here). So Lupa makes LuaJIT an option in exactly the niche I describe above.

When you have the Python ecosystem available (which you may not have in tiny embedded systems, but *when* you have it), there's really not much else to gain from switching to Lua, except for tight algorithmic code in exactly the case that you cannot or do not want to afford a static compilation step for your software. It's still a bit tricky to sell even that to Python developers, as Cython code (i.e. C code generated from Python code) is a lot more portable than LuaJIT, doesn't suffer from the language gap and allows faster data access to the Python runtime than Lupa would. So, if you allow for static compilation of your own code, you'll have it a lot easier with Cython than with Lupa+LuaJIT. Unless there is some existing Lua code that you can readily use, that is, but even then, you'll at least need some kind of data mapping glue code.

OTOH, I've had comments on Lupa from Python developers who clearly stated that even though they had heard about Lua(JIT) before, it was the appearance of Lupa on their radar that made them take a closer look at Lua the language. So there seems to be at least /some/ interest in Lua(JIT) on the Python side, and Lupa, young as it is, might be able to channel that. It certainly lowers the entry level.


P.S. I apologize if I may sound harsh or impolite somewhere in my
letter, this is not intended. I also not trying to put words in your
mouth, merely trying to understand what I (personally) feel wrong with
your post and how to make it look more objective.

No harm taken. Those were very well-founded comments.

What about this paragraph then:

"""
However, the Lua ecosystem lacks many of the batteries that Python readily includes, either directly in its standard library or as third party packages. This makes real-world Lua applications harder to write than equivalent Python applications. Lua is therefore not commonly used as primary language for large applications, but it makes for a fast, high-level and resource-friendly backup language inside of Python when raw speed is required and the edit-compile-run cycle of binary extension modules is too heavy and too static for agile development or hot-deployment.
"""

I think that makes it clear what Lua and Lupa provide for Python developers, hopefully without hurting the "Lua community ego" too much. ;)

Stefan