Lua is amazing. I've used it to reimplement an API served by Python and it was consistently twice as fast i.e. half the time to serve a request compared to the Python framework in basically the same code.
What did you use as the web server / process manager? Was it embedded lua in nginx (maybe lapis as the web framework?) or otherwise? Please share more.
If you're looking for a fun hobby project, you might check out this project, which is a Lua-based web server. It includes a graphical Lua debugger with a browser-based UI, powered by the Lua-based web server.
As anyone experience with adding new types to Lua ? I mean, in a fundamental type, not just simulating them with regular Lua features. For example, adding a 128 bit float number ?
Unless you have a job where you can choose your own tech stack or are otherwise self-employed are there really non-game development jobs that use Lua? I like the language and have used it for scripting games before but have never seen a single job posting for that skill set. I even have it on my resume and I'm fairly certain no one has ever noticed.
A lot of things have lua bindings and a lua interface. But once you stop being your own boss, your control over which interfaces and bindings to use shrinks drastically.
I believe the question was more: What fields/industries are actually USING the lua interface by default? Where would being able to say "I am very experienced with lua scripting" be a particularly strong asset.
Any place that uses OpenResty (https://openresty.org/en/) is bound to use Lua not just as scripting aid but as a language to actually build applications. Cloudflare is famously using it, along with I believe Taobao who first supported its development.
>"Any place that uses OpenResty (https://openresty.org/en/) is bound to use Lua not just as scripting aid but as a language to actually build applications."
This is not true at all. Where I work we use OpenResty in places for a WAF but we don't touch Lua for anything else. You don't need to know much Lua for this.
Using something as an embedded language is a little different than building standalone systems/infrastructure projects with something.
Lua is a small general tool used in bunch of fields and industries, the question about who does what by default tell us nothing.
I agree that in any organization if the choice of use a tool is not in your hands you are forced to use something else well, that don't have anything to relate with lua or with any other programming language.
That's a people problem you accepted when hired, but can move to other happy place that used lua or python, or ... etc (=
I worked with the Chicago office of a large trading software company that used Lua. It was part of the initial tech stack because the CTO (they were a start up that got acquired) played World of Warcraft. Now they still use it. Only time I ever ran into in an industry I wasnt expecting though.
"Lupa is a very fast and thin wrapper around Lua or LuaJIT."
"It complements Python very well. Lua is a language as dynamic as Python, but LuaJIT compiles it to very fast machine code, sometimes faster than many statically compiled languages for computational code. The language runtime is very small and carefully designed for embedding. The complete binary module of Lupa, including a statically linked LuaJIT2 runtime, only weighs some 700KB on a 64 bit machine. With standard Lua 5.1, it’s less than 400KB."
Which leads to the question why there is no proper JIT implementation of Python. It's so widely used that you would expect someone coming up with one eventually. Or are language features so different that they don't allow an implementation similar to LuaJIT or Julia?
Lua is indeed a pretty nice language for some use-cases and it's nice to see this example. It would also be great to see a comparison to Numba which is a Python JIT particularly suited for fast numerical computing with Python: http://numba.pydata.org
Numba provides speed-ups over NumPy and Python and does so in way very easy for Python programmers to use with decorators on Python functions. Numba can be used to easily build new "ufuncs" which are NumPy's universal functions and it has multiple interfaces for programming the GPU directly from Python for even higher performance.
32 comments
[ 1.8 ms ] story [ 81.0 ms ] threadhttp://www.sailorproject.org/
http://github.com/bhk/tooltree
See 'documentation' -> 'monoglot' -> 'Introduction'
A lot of things have lua bindings and a lua interface. But once you stop being your own boss, your control over which interfaces and bindings to use shrinks drastically.
I believe the question was more: What fields/industries are actually USING the lua interface by default? Where would being able to say "I am very experienced with lua scripting" be a particularly strong asset.
This is not true at all. Where I work we use OpenResty in places for a WAF but we don't touch Lua for anything else. You don't need to know much Lua for this.
Using something as an embedded language is a little different than building standalone systems/infrastructure projects with something.
I agree that in any organization if the choice of use a tool is not in your hands you are forced to use something else well, that don't have anything to relate with lua or with any other programming language.
That's a people problem you accepted when hired, but can move to other happy place that used lua or python, or ... etc (=
The real gains come from Mike Pall's amazing JIT implementation, not the language itself.
Stock Lua is also much faster than Python.
"It complements Python very well. Lua is a language as dynamic as Python, but LuaJIT compiles it to very fast machine code, sometimes faster than many statically compiled languages for computational code. The language runtime is very small and carefully designed for embedding. The complete binary module of Lupa, including a statically linked LuaJIT2 runtime, only weighs some 700KB on a 64 bit machine. With standard Lua 5.1, it’s less than 400KB."
https://pypi.python.org/pypi/lupa
I believe it is a lot harder to make a Python jitter. And it would never be as fast as a Lua jitter.
Pyston is the only CPython JIT currently however
Numba provides speed-ups over NumPy and Python and does so in way very easy for Python programmers to use with decorators on Python functions. Numba can be used to easily build new "ufuncs" which are NumPy's universal functions and it has multiple interfaces for programming the GPU directly from Python for even higher performance.