LuaJIT 2.0.3
luajit.org
luajit.org
As far as I could tell, 100% of the AAA titles that use it that I tested (3 in total) did not. And in profiling, Lua was actually consuming a lot of CPU relatively.
That confuses me given how easy it is to use LuaJIT over the reference, and how vital performance in these environments is.
Games, contrary to the beliefs of dense hiring managers, disconnected producers, and even designers, are performance critical applications -- achieving a mere 30 FPS and > XX+ms input latency on hardware 5 years in the future in the enthusiast category, on the order of $4000+, is an absolute failure. Every gamer I've ever met (thousands, thousands upon thousands, hundreds that I know well) is extremely sensitive to performance. Performance is king. If a game looks a little shitty but runs AMAZING, it is better than a game that looks AMAZING but runs a little shitty. Hell, it's even better than a game that looks WTFAMAZING and runs pretty well. We only start caring about the looks, typically, when performance is sufficient. So if we can dial the game's graphics up while maintaining performance, we get happy. Enthusiasts love it when they can dial all the way to max settings and still play the game at 60+ fps and unnoticeable input lag. So running your render loop and lua on the same thread (a WTF in itself) and not using LuaJIT is a huge WTF.
Similar to how much it has taken them to move from Assembly to C and C++.
However, vanilla Lua is pretty fast to begin with. Additionally, the types of optimization you do with vanilla Lua are the opposite kind you do with LuaJIT and vice versa. Generally you need to decide early in the project which you want to go with because it impacts how you write code. And it isn't always guaranteed that LuaJIT will be faster. And since game engine cores are written in C/C++, this optimization works against LuaJIT.
Ultimately, games need to stay within their fps budget. If Lua is high on the CPU, but the game is still in budget, nobody really cares. And CPU profiling doesn't always tell the whole story since many things can be GPU bound. It could very well be that the game is already GPU bound so getting more CPU back won't help.
We use it internally to map some of the functions in our library to OpenGL.
Just because it's not the latest release of Lua, it does not make it less Lua language. Yes, bytecode generated by lua reference implementation can't be loaded by luajit (or maybe things have changed since), but that's just like saying Microsoft C++ libs can't be used by MINGW.
I use it, my favorite language by far (after trying about all of them).
>What are the applications you are using it for ?
Game development.
>I know it is used a bit in the gaming industry for scripting purposes
Not just scripting anymore. There are multiple production grade game engines where you write all the code in Lua(JIT). This variant is big in the mobile/casual sector of the industry. Corona [1] seems to be the current market leader there. There is also an open source game engine - LÖVE [2] - where you use Lua(JIT) for everything. However it is more of a hobby/enthusiast thing. It is much simpler, and very few commercial games are based on it. In contrast, Corona is widely used for commercial projects.
If you know a better way of using async i/o in Lua, I'm all ears.
- all unit tests going forward are written in lua/moonscript[2]
- Lua will be embedded in neovim, and vimscript plugins will be compiled on-the-fly to Lua. Yes, this is really happening[3].
Promise to upvote :)
http://blog.cloudflare.com/pushing-nginx-to-its-limit-with-l...
I use it in games: http://infon.dividuum.de/
As a backend language in a geo game service: http://geolua.com/
And as the controlling language for a raspberry PI software: http://info-beamer.org/
Lua is pretty awesome. Fast, simple to include and expressive enough for my needs.
I just finished using it to build realtime stat tracking and a websockets server to display that data to web clients[2][3]. Additionally I've done some work with custom processing in a reverse proxy and handing case-insensitive URLs.
Overall I've found it very comfortable to use and fast, but a little more barebones than something like python. In my use cases, the speed and low overhead has been more than worth it.
[1] https://github.com/agentzh
[3] https://github.com/wbond/sublime.wbond.net/tree/master/realt...
I wrote a tool at work to do packet analysis in Wireshark which has a Lua API. I've written a couple of simple games using the Love2D framework. I once wrote an IRC bot using luasocket. I started to write a debugger which was an amalgam of C and Lua, but I've since abandoned that project (not because of Lua, but because I lacked the free time and the patience to support more than one object file format).
I also experimented with using Lua as a target for a Clojure-like Lisp dialect. The compiler is itself written in Lisp and compiles itself to Lua. I've written an Asteroids clone and some toys in Lisp and compiled them into Lua.
It's a very fun language to program in. The reference implementation is also small enough that you can reasonably expect to know its ins and outs in about a week. The C API is really nice; it makes embedding in C a breeze. LuaJIT itself has the best FFI I've ever seen: you can practically #include a C header file in your Lua and it just works.
With the advent of LuaJIT 2, I've used it standalone for analyzing many many millions of messages per day in real-time, then feeding resultant datasets to other more batteries-included environments which aren't near as fast (e.g. Python, Matlab) or to datastores like Redis and Mysql
I also use OpenResty for web applications (risk management apps, charting, and other visualizations), often pulling from those same datastores. OpenResty is a joy to work with and is crazy fast.
I make heavy use of the FFI both for library bindings (including system calls) and general C structure use. The messages mentioned above are represented as C-structures and are efficiently processed by LuaJIT. I find myself often writing Lua scripts to do networking programs rather than C. Check out `ljsyscall`.
Dealing with memory has definitely been a stumbling point, but once I built enough scaffolding to deal with it (including using jemalloc), it has been clear sailing. Now I store millions of objects taking many GB of memory without significant GC pressure using FFI-based HashMaps and Vectors.
Also understanding how to keep the code in the JIT (versus the interpreter) has taken some artistry -- e.g. examinging the output of -jv and -jdump.
Although this thread is about LuaJIT 2.0.3 release, I use the LuaJIT 2.1 branch which has many enhancements; I especially appreciate the string improvements and trace stitching.
But beyond normalization, there is building books (be they level-1, 2, or 3), maintaining state, and extracting information from that. Random example (i.e. not a real query I've done): emit all the trade executions on any venue that happen within the first two depth levels of NASDAQ.
LuaJIT could do the hard crunching, like regression analysis, quite well, and there are some interesting projects like GSL-shell... but Matlab and numpy/matplotlib are quite expressive and more complete environments.
I've been eyeing SnabbSwitch for a while -- I use OpenOnload extensively, so appreciate what you are doing.
----------
I've found LuaLaTeX to be quite stable already and used it to compile my PhD thesis.
Adobe is using it for some of their products. Lightroom was the first and its usage is extensive.
http://thesoftwarelife.blogspot.com/2008/11/lightroom-and-lu...
http://www.lua.org/wshop05/Hamburg.pdf
Wikipedia is now using it as their multimedia scripting language.
http://www.meetup.com/wikimedia-tech/events/106078042/?actio...
http://www.youtube.com/watch?v=PrhzAtC8fCc
Verisign uses it for High Availability Databases and also apparently DNS Advanced Traffic Management
http://bluedino.net/luapix/LuaWorkshopJuly2008-rev3.ppt
https://www.youtube.com/watch?v=XeP7d_jBPyA
You can now write NetBSD kernel modules in Lua.
This may be a valid technical concern for certain products (plugins), but not a real limitation for others. And so far it's been mostly on OSX.
By the way, it is worth pointing out that Mike Pall (LuaJIT's author) has said that the current Lua garbage collector is not designed to handle such big heaps efficiently anyway.
The one I've run into is using extremely large strings (hundreds of megabytes per string). I've encountered cases where LuaJIT runs out of memory, but standard Lua works fine (and is quite fast).
So while Mike Pall may correct about the behavior of the GC, the implication that this means LuaJIT's addressing limitations aren't a problem in practice is not correct.
Given LuaJIT's limitations (not just this, but also the more fundamental issue of portability), the defacto forking of the language is worrying...
See luatex.org.