Lua vs PHP / Python / JSP / etc

I am about to start my next web development project and wanted to hear about the benefits of Lua in the web development space.

How Lua compares with PHP / Python / JSP / etc. for web development?

Any reason Lua would be a bad choice for web application language and others?

+7
python php web-applications lua
source share
6 answers

In short:

  • Lua gives you a smaller, simpler system that can be understood as a whole , but it is in a much smaller ecosystem ; Kepler is all that you get, and you may have to build some of your own things. I find it easy and fun (I heavily use the Lua bindings on the Expat and Lua Object Model parsers , which are part of Kepler), but others may prefer to use what everyone else uses.

  • PHP started out as a macroprocessor than a language, and although it has improved over the years when people say "X really got a lot better," I tend to be wary of X. I find PHP offputting, but there is for web development huge ecosystem .

  • Python is a good language, but much more than Lua, and in the throes of a serious revision (transition from 2.5 to 3.x). Again you get a great ecosystem ; The problem with Python is that the language and system are too large for any person to understand . I do not like to be in this situation if I do not need it.

  • Ruby is a slightly cleaner language, and the large Rails ecosystem is a winner . Ruby is less complex than Python, but more complex than Lua. Rails is a little beast.

This is related to this question:

  • Would you better understand all the software in your system, even if you need to build a lot of things yourself?

  • Or do you have many things that are already created for you, even if you do not understand how each part works?

If you want to understand everything, Lua is your game. If you want many things to be already created for you, I can not advise you how to choose among PHP / Python / JSP / Rails, etc.

Learn more about Lua and Python. Which language is better to use, Lua or Python?

+19
source share

Using Lua for web development is quite rare ... you can do it, but it will be a lot longer than using a language that has matured as a web development language (PHP) or has good web libraries (like python / ruby / Etc.) If you go with Lua, it means that you can end up "recreating the wheel" for something that can be easily accessed in mature web languages.

The best question is: what does Lua offer, what do you need, what is not offered in other languages ​​that you specify? Or do you want to help Lua become a better web development platform by creating a Lua MVC framework like Rails for Ruby?

+7
source share

The Kepler project is probably the most famous starting point for developing web applications in Lua. They have a mailing list , in the archives of which there will be many discussions of the merits of various approaches.

The Kepler site itself is built within the framework of a CMS called Sputnik , written almost entirely in Lua and based on the Kepler project.

A typical approach with Lua is to use a language suitable for interacting with various system components to implement these interfaces, as well as to use Lua for business logic and glue. Kepler provides libraries written primarily in C that provide access to file systems, databases, and the network to Lua code. It also provides a certain level of API for interacting with a web server with implementations for Apache, any server that supports CGI, and Xavante, which is a complete web server, implemented mainly in Lua.

+4
source share

I'm a little late ... but I wanted to drop another language: haXe

why?

  • haXe is an open source language managed by a fairly small but active community

  • haXe is an independent platform language ... goals:

    • flash player 6-8 and 9-10 bytecode or ActionScript 3 source code
    • JavaScript source code
    • PHP source code
    • NekoVM bytecode or Neko source code (NekoVM is a lightweight and extensible virtual machine suitable for both server development and desktop applications).
    • C ++ source code
    • Android Java source code is currently working on

    this means that as a web developer you can write both rich clients and servers in one language ... the same code can later be used for desktop / mobile applications

  • haXe is a very expressive and powerful language in which:
    • first-class functions (anonymous functions and methods that are the same in haXe) and closures, as well as enumerations with parameters (like algebraic types) that allow you to use functional approaches
    • a good type system, including generics, structural subtyping, etc ... to simplify its use, the compiler has a very useful type inference that ensures that the code is strongly typed but saves you a lot of redundancy (the type of the variable is initialized, return type of function by type of return expressions) ...
    • cross-platform API, including everything from dynamic arrays to reflection / introspection and a remote package that allows you to send entire objects from the client to the server, from one platform to another ...
    • consistent and radical design of the language ... of course, it has several drawbacks, but this is mainly due to the fact that it is aimed at a variety of platforms ...
  • girls love it and it will make you real rich ...: D

The biggest drawback in haXe is that it allows untyped coding due to the specific execution of the untyped code platform ... when it is well printed (which doesn’t work very much with haXe), the code will be executed the same on all platforms ... if no, the result depends on the execution time of the platform itself ...

to put it a few words: this is a great language that allows you to navigate many platforms ... it is young, it is growing, and you can participate ...

Greetz

back2dos

+3
source share

As for the Lua web frameworks, there is also LuCI . It is mainly used for small embedded systems. We are just starting a project using it, so I can not comment on it too much now. We just make some simple configuration screens, similar to what is already presented as examples, so I'm sure this will be enough for our needs.

+1
source share

If this is only a language, then I agree with Norman. If a web development framework is important to you, then you need to consider Ruby because RoR is a very mature framework. I love Python, but it seems that there are many possibilities for choice, none of them are dominant. CherryPy, Django, Pylons, web2py, Zope 2, Zope 3, etc. One of the important indicators for me is that there are more market tasks on the market than any other (language, framework).

+1
source share

All Articles