4 ms·
Lua.vm.js
- otikik 13y ago<3 <3 <3
- acron0 13y agoI have no immediate use for this but goddamnit, it's cool.
- goldfeld 13y agoThe immediate use for some might be setting up a tutorial to teach Lua in the browser[1]. However I wonder how these guys were doing it[2]. [1]: http://kripken.github.io/lua.vm.js/repl.html http://kripken.github.io/lua.vm.js/repl.html [2]: http://repl.it/ http://repl.it/
- manuletroll 13y agoDoes anyone know of a good "compile to js" lua implementation ?
- justincormack 13y agoThats actually difficult, eg Lua has coroutines, a function can be a hash table key and other incompatibilities. There are some but they are fairly limited by this. This is the main implementation https://github.com/mherkender/lua.js https://github.com/mherkender/lua.js
- justincormack 13y agoWould be interesting to compare performance to the other ways of getting Lua to run in the browser, which include writing a Lua bytecode interpreter in JS, converting Lua to JS, and code generation from bytecode. https://github.com/creationix/brozula https://github.com/creationix/brozula https://github.com/mherkender/lua.js https://github.com/mherkender/lua.js (and others, I had a list somewhere) Quite a few companies are using Lua->JS as a way of doing write once run cross platform games eg we had this talk at London Lua http://www.londonlua.org/luajavascript/index.html http://www.londonlua.org/luajavascript/index.html
- bru 13y ago>Score: 130 >binarytrees 46.051 seconds Without any frame of reference, those values are meaningless. However there is one I can evaluate: >1.58 MFLOPS Given I have an i7-2600 and its flops on benchmarks[1] (FPU Flops score: 8500.09 MFlops), that tells me something I could have guessed: performance is 3 orders of magnitude worse than native high performing code. Still, in order for this comparison to be complete, I'll have to - try this benchmark in Firefox with OdinMonkey, the new and very promising JS engine[2] - run a similar benchmark with "native" LUA edit: results obtained on W7 SP1 with 16GO RAM and Chrome 27. 1: http://www.maxxpi.net/results/show.php?ID=c3x2c5w6d7b7 http://www.maxxpi.net/results/show.php?ID=c3x2c5w6d7b7 2: did you know the logo was awesome? https://wiki.mozilla.org/File:Odinmonkey800.jpg https://wiki.mozilla.org/File:Odinmonkey800.jpg
- evilpie 13y agoJohn Howard is very cool. He already created the JägerMonkey and IonMonkey logo for us. We print them on shirts, cards and posters. http://monkeyink.com/ink/blog/archives/2011/01/jagermonkey_ima.php#.UcQ_HTizCR0 http://monkeyink.com/ink/blog/archives/2011/01/jagermonkey_i... http://monkeyink.com/ink/blog/archives/2012/02/its_ion_monkey.php#.UcQ_RjizCR0 http://monkeyink.com/ink/blog/archives/2012/02/its_ion_monke...
- networked 13y ago>Without any frame of reference, those values are meaningless. How about we compile some results right here? Below is what I get on an AMD Phenom II X4 965 PC with 8 GB RAM running Linux Mint 13 Maya, kernel version 3.2.0-48-generic x86_64. — Lua.vm.js in Firefox 21.0 Score: 115 binarytrees 56.978 seconds scimark 1.79 MFLOPS startup 0.431 seconds — Native Lua 5.2.2 ~> lua scimark.lua FFT 14.65 [1024] SOR 30.41 [100] MC 9.32 SPARSE 19.32 [1000, 5000] LU 23.70 [100] SciMark 19.48 [small problem sizes] ~> time lua binarytrees.lua 14.72 stretch tree of depth 15 check: -1 53974 trees of depth 4 check: -53974 13493 trees of depth 6 check: -13492 3373 trees of depth 8 check: -3372 843 trees of depth 10 check: -842 210 trees of depth 12 check: -210 52 trees of depth 14 check: -52 long lived tree of depth 14 check: -1 lua binarytrees.lua 14.72 5,99s user 0,01s system 99% cpu 6,001 total — Geekbench-2.4.3-Linux on the same computer http://browser.primatelabs.com/geekbench2/2076712 http://browser.primatelabs.com/geekbench2/2076712 (the page includes detailed PC specifications) Edit: redid the native benchmarks with Lua 5.2.2. ----- Edit 2: The same set of benchmarks gives the following results on a ThinkPad X61s laptop with a Core 2 Duo L7500 CPU and 4 GB RAM running Linux Mint 13 Maya, kernel version 3.5.0-32-generic x86_64: — Lua.vm.js in Firefox 21.0 Score: 59 binarytrees 117.675 seconds scimark 0.95 MFLOPS startup 0.822 seconds — Native Lua 5.2.2 ~> lua scimark.lua FFT 6.55 [1024] SOR 15.36 [100] MC 4.11 SPARSE 10.24 [1000, 5000] LU 12.40 [100] SciMark 8.73 [small problem sizes] ~> time lua binarytrees.lua 14.72 stretch tree of depth 15 check: -1 53974 trees of depth 4 check: -53974 13493 trees of depth 6 check: -13492 3373 trees of depth 8 check: -3372 843 trees of depth 10 check: -842 210 trees of depth 12 check: -210 52 trees of depth 14 check: -52 long lived tree of depth 14 check: -1 lua binarytrees.lua 14.72 9,63s user 0,04s system 99% cpu 9,713 total — Geekbench-2.4.3-Linux http://browser.primatelabs.com/geekbench2/2077111 http://browser.primatelabs.com/geekbench2/2077111
- rajahafify 13y agoWhen people blog about don't use default bootstrap template, I often take it with a grain of salt. Now i'm absolutely positive.