6 ms·
Love for LuaJIT
- whyenot 17y agoMike Pall's annoucement on Lua list: http://thread.gmane.org/gmane.comp.lang.lua.general/62316 http://thread.gmane.org/gmane.comp.lang.lua.general/62316
- mbrubeck 17y agoLuaJIT 2.0 is an amazing achievement. On the programming language shootout's "flawed benchmarks", LuaJIT outperforms almost every other dynamic language (including JavaScript V8, Python, Ruby 1.9, JRuby, VisualWorks Smalltalk, CPython, PLT Scheme), and is competetive on many benchmarks with highly-optimized language implementations like Sun's JVM, and GHC: http://shootout.alioth.debian.org/u32q/which-programming-languages-are-fastest.php?gpp=on&java=on&csharp=on&ghc=on&sbcl=on&luajit=on&hipe=on&v8=on&vw=on&mzscheme=on&lua=on&python=on&php=on&perl=on&ruby=on&calc=chart http://shootout.alioth.debian.org/u32q/which-programming-lan... Mike Pall wrote LuaJIT and now LuaJIT 2 as essentially solo efforts. Thanks to Google and the other sponsors for helping him continue!
- sandGorgon 17y agoit would be interesting to see LuaJIT as part of LuaTex. Super fast desktop publishing FTW !
- lsb 17y agoI was abusing a footnote package, sorting footnotes alphabetically per page, and that took about a second a page on my laptop, but for everything else disk seeks take the majority of TeX's time; once you LaTeX something, and cache the font files in memory, it usually takes under a second or two for anything under 50 pages.
- silentbicycle 17y agoIn my experience, the 1.x releases of LuaJIT have typically made whole programs (not just benchmarks) run 2-3+x faster than standard Lua. Without any other changes. :) I haven't tried LuaJIT 2 yet, but I'm eagerly waiting for it to get ported to amd64.
- joeyo 17y agoThe fact that luaJIT is written in assembler makes me wonder how practical an amd64 port. :-\
- mikemike 17y agoMost of the VM is written in C. Only the core of the interpreter is written in assembler (generates ~13K of machine code). And the port of the interpreter to x64 is already done, so it was certainly practical. Porting the rest of the VM and the JIT compiler is what takes most of the time.
- joeyo 17y agoThanks for the clarification!
- mikemike 17y agoFor an apples-to-apples comparison you'll want to look at the single-threaded performance: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=all http://shootout.alioth.debian.org/u32/benchmark.php?test=all...
- aaronblohowiak 17y agoSpoiler: LuaJit compares even better when comparing single-threaded performance. Edit: replaced "performs" with "compares", eliminating ambiguity around competitive performance vs clocktime performance
- mikemike 17y agoSpoiler: The Lua benchmark submissions are not parallelized.
- dchest 17y agoWe use Lua internally at Google Interesting! Anyone know details?
- yannis 17y agoJust a guess google power meter? http://www.google.org/powermeter/index.html http://www.google.org/powermeter/index.html
- whyenot 17y agoJoshua Haberman gives some details here: http://article.gmane.org/gmane.comp.lang.lua.general/62321 http://article.gmane.org/gmane.comp.lang.lua.general/62321 Our Lua usage isn't too widespread at the moment; it's really one infrastructure project in particular that uses Lua to allow user-defined functions to run within a tightly controlled container. Lua was the best choice, because of its low overhead, fast execution, and the ability to set limits on execution time. Unfortunately I cannot be more specific, since the project is not public.
- toisanji 17y agoit makes me wonder why languages like ruby are so slow.
- mbrubeck 17y agoRuby might just need a better implementation with more time spent on optimization. http://maglev.gemstone.com/ http://maglev.gemstone.com/ is going in this direction. But also, Lua was always designed with cleanness and simplicity of implementation in mind. Its developers have strong backgrounds in both theory and engineering, which you can see in their interview in the book Masterminds of Programming. They've been very conservative about the design of the language. In contrast, Ruby feels much messier and more "evolved" - look at its Yacc grammar[1], for example, compared to the grammar of JavaScript or Lua[2]. Even the Ruby lexer is full of weird edge cases. Much of MRI is like that, and for years it was the only "spec" for the language; now its decisions have been reverse-engineered and inherited by all other implementations. [1]: http://blog.nicksieger.com/articles/2006/10/27/visualization-of-rubys-grammar http://blog.nicksieger.com/articles/2006/10/27/visualization... [2]: http://www.lua.org/manual/5.1/manual.html#8 http://www.lua.org/manual/5.1/manual.html#8 [By the way, I've used Ruby for years and like it at lot, while I've written only a few lines of Lua code and like it but am not deeply familiar with it.]
- dchest 17y agoAlso, "The Evolution of Lua" — an interesting paper that shows how they came to this fast and somewhat elegant language: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72.3859&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72.... [PDF]
- silentbicycle 17y agoAlso good: "The Implementation of Lua 5.0" (http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/sblp2005.pdf http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/sblp2005.pdf). Past discussion: http://news.ycombinator.com/item?id=617278 http://news.ycombinator.com/item?id=617278 If you want to learn Lua, Ierusalimschy's _Programming in Lua_ (http://www.inf.puc-rio.br/~roberto/pil2/ http://www.inf.puc-rio.br/~roberto/pil2/) is by far the best book. Lua is one of my favorite languages. While it's good on its own, you'll get a lot more out of it if you're comfortable with C. Lua+C is an excellent combination.
- deleted 17y ago[deleted]
- kilowatt 17y agoIt's been on my todo list to take some time to grok luajit's internals for awhile. Awesome to see Google parting ways with some cash! This sort of makes me want to try to write a Python->Lua compiler.
- fortes 17y agoAnyone using Lua for web apps? What's the current state ofthe ecosystem? Anything good, stable, and easy to deploy?
- lh 17y agoThat's something I've also been wondering lately, since the Kepler and Orbit projects haven't seen activity for ages (at least according to their webpages). I found this Sinatra clone for Lua called Mercury (http://github.com/nrk/mercury http://github.com/nrk/mercury), but it lacks documentation and does not seem to be very mature at the moment.
- fortes 17y agoYeah, I've poked around a bit as well, but didn't find anything that seemed like it was getting traction. I was excited when I heard that mod_lua was going to be included with Apache by default [1] ... but I haven't really heard anything since then. [1] http://news.ycombinator.com/item?id=452396 http://news.ycombinator.com/item?id=452396
- mascarenhas 17y agoLuaForge's ftp server is broken since the big LuaForge crash a few months ago, so those pages are badly out of date. Browse http://github.com/keplerproject http://github.com/keplerproject for more recent information.
- jawngee 17y agoCan't wait for the x64 version.