Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Why has Python been backed by google and become so rapidly popular and Lua has not?

Do you know why Lua has stayed in background?

share|improve this question
20  
Yes. I do know why Lua is stuck in the background. It's a secret conspiracy. But I can't say more, or they'll kill me. – S.Lott Apr 8 '11 at 21:55
1  
@S.Lott: You've said too much already! – Steve Evers Apr 11 '11 at 13:14
Lua likes to pretend arrays and dictionaries are the same thing, and has a length getter that can not only return wrong results, but nondeterministic results. I don't know what Googles reasons are, but this is enough reason for me to dislike it. – Steve314 Aug 8 '11 at 7:47

3 Answers

up vote 3 down vote accepted

I really love Lua, but it does have some real limitations, and as others have mentioned they derive mostly from Lua's origins as a configuration file language and then later as an embedded scripting language.

Because of the goal to keep Lua small, there exists only a very tiny standard library, that has only bare bones functionality.

This has lead to an unfortunate culture in Lua circles where Lua developers like to re-implement the functionality offered by many other language's standard libraries themselves rather than working collectively on a universally accepted set of core libraries.

Things like multi-threading, regular expressions, platform independent file access methods, and even bit operations (until 5.2) ere all "not included" since they would make Lua much larger and slower. Sure you can get libraries do so these things - but then those have independent maintainers and quality levels.

Don't get me wrong. I love Lua for the same reasons I have just listed.

share|improve this answer

Simple : Lua have more "niche" objectives than Python.

Python is thought to be useful as a general programming language. So, it's useful in a lot of cases. It covers many well known types of application but doesn't enter directly into competition with other languages that might be targeted at specific constraints, but the simplicity of it's syntax.

Lua is totally targeted to be an embedded scripting language. It's initial purpose, even if it's used in other contexts currently, like build systems; is to be embedded in software and to allow easy implementation of domain-specific script functions and structures. It's so minimalist that it can even be used on really constrained hardware (I used Lua on NintendoDS), it's lightweight, easy to use, FAST, and is such a minimalist language but thought to be extended that a lot of dialect (importing paradigms like object-orientation) are available. It's so portable (ANSI C) that you can use it on any embedded hardware with decent amount of memory for modern embedded software (if I remember well the default lua vm is around 400ko and will almost never grow if you don't loop creating objects...).

So, Lua is initially used in context where you need to embed a scripting language for your application.

Python is used for...almost anything that doesn't require a more niche language (you can make quite performant games using Python, but some kind of performance-heavy games really require to avoid such system).

It's simply that Python is used in more contexts than Lua. As far as I know, other than Android (that provide Java and native language support), Google isn't an embedded software company so they don't really need Lua everywhere, while Python is useful for anything they do (web, build system, communication, web and web).

Python is used in a lot of games for embedded scripting too, but it's heavy and slower than Lua. The syntax of Python makes it more appropriate for big games that rely a lot on scripted information in their game structure (not sure I'm clear there but just think that if you need a "real complete language" for scripting, embedding Python might be a good idea, if the performance is fine for you). Python was not made to be embedded, so that's fine. An equivalent of Python that is targeted at being embedded in C++ is Falcon.

For extreme comparison, some languages that target embedding and try to have more complete syntax than the minimalist Lua, and compete on performance : ChaiScript, AngelScript, Io...

By the way, I've seen new build systems like PreMake or Bam use Lua as the build file language. The idea is that it's lightweight and well known from game developers (build systems in game developpement is a major problem). So maybe that's another domain where Lua might be more appreciated. It's certainly more user-friendly than CMake syntax....

share|improve this answer
3  
I think Lua's target as an embedded language is probably a major contributor. But even still, I believe "popularity" of a language has less to with the actual design or capability of the language itself and more a matter of "right time, right place" (see PHP, for example). – Dean Harding Apr 8 '11 at 22:38
Well I think that a language targetted at specific purpose naturally appeal to specific users, making it's audience more restraint than any general-purpose language. Having a less audiance than general-purpose languages directly impact the number of people that will ever talk about it. Other than that, specific targets means specific features. Therefore, it's not good for every situation. Here for example lua alone is not a very good gui-programming language. It requires some additions to be really useful. – Klaim Apr 8 '11 at 22:43
That said, I fully agree: if php wasn't used for such a widely used field as web-site developpement, it wouldn't be everywhere now. – Klaim Apr 8 '11 at 22:48
Lua is mainly used as embedded language but it is a general purpose programming language, for instance you can make CGI script with mod_lua. I could change my question to why lua stayed as an embedded language? – Ubiquité Apr 8 '11 at 23:01
Because it's it's origin. You can use it as a general purpose language yes, as you can use php too for general purpose. You can also use Perl to do the same. But their origins makes their orientations. Again, their initial purpose makes them less useful than other languages for general purpose languages. Lua lack some feature language to be easy to use with GUI system for examples, like object orientation (that you can add easily, but it's not native). Make sure you see the difference between a language originally made for specific purpose and a general one. They all have constraints anyway. – Klaim Apr 10 '11 at 11:35

What about the origine of the language?

Lua is born at Rio de Janiero, Brazil, when Python is appear directly in USA. When a language conquers the US, the entier world look at it, but a language created outside of US need for efforts to spread around the world.

share|improve this answer
6  
Not necessarily. Ruby is spreading just fine, despite having been created in Japan. – quanticle Apr 11 '11 at 13:20
2  
@quanticle: Ruby was considered a fringe language, even David Hannson said it himself. Ruby became popular at an alarming rate after Rails was created and spread throughout the US. Ubiquité's point still stands because he mentioned that a language needs efforts to spread. Ruby's effort would be Rails in this case, which caught up really well in the US starting with 37signals. – chiurox Apr 11 '11 at 14:02
8  
Actually, Python started out life at CWI in the Netherlands. – Dean Harding Apr 11 '11 at 14:55
1  
People download these things from the same internet. We generally don't know or care what country it came from. Ruby took time to catch on because it's based on a horrible language (Perl) and a less familiar language (Smalltalk). Smalltalk is a fringe language from the US, so being American doesn't automatically mean success. – Steve314 Aug 8 '11 at 7:58
1  
I'm not saying "being American mean success", I'm just saying that it's easier to succeed for an American language. – Ubiquité Aug 8 '11 at 19:54
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.