
Source code for Lua 5.3 - vmorgulis
http://www.lua.org/source/5.3/
======
fosk
When running Lua, always consider running it on the LuaJIT
([http://luajit.org/](http://luajit.org/)). It's extremely fast, portable and
lightweight JIT compiler for Lua, although it only supports Lua 5.1.

The performance improvements are incredible, and it allows you to write inline
C code thanks to the FFI library (declaring it like this
[https://github.com/Mashape/kong/blob/master/kong/plugins/fil...](https://github.com/Mashape/kong/blob/master/kong/plugins/file-
log/handler.lua#L21-L25), and invoking it like this
[https://github.com/Mashape/kong/blob/master/kong/plugins/fil...](https://github.com/Mashape/kong/blob/master/kong/plugins/file-
log/handler.lua#L53))

~~~
vbit
Seconded. LuaJIT FFI is just awesome. Check out the motivating examples:
[http://luajit.org/ext_ffi.html](http://luajit.org/ext_ffi.html)

BTW, does anyone have recent benchmarks comparing LuaJIT against new versions
of the Javascript JITs?

------
sspiff
What's the point of posting this? Pointing out how small and elegant a real
world language implementation can be?

~~~
scrollaway
I'm happy with anything that gives Lua more exposure. It's a pretty language
and it is _so damn small_ , fast and embeddable.

Too many developers are using Javascript in places where Lua would be a far
more appropriate option. Embedding, especially.

~~~
nly
Why is embedding Javascript inappropriate? Duktape has a similar codesize to
Lua 5.3

[http://duktape.org/index.html](http://duktape.org/index.html)

~~~
aleksi
In my opinion, Lua is better-designed language. JavaScript has horrible parts.

~~~
luchadorvader
Why do you say Lua is better designed? And are you comparing classic JS or ES6
JS? I like Lua but there are some things that just annoy me like indexing an
array with 1, smaller standard library, etc. I find JS implementation of
inheritance, objects, and prototyping better than Lua due to its simplicity.

~~~
ludamad
1\. Indexing an array with 1 is unfortunate but not a bad design decision in a
vacuum, eg for i=1,#size is a very easy to understand loop over valid array
indexes. I'll agree that it causes cognitive load in practice.

2\. JS has a somewhat broken notion of objects and Lua's implementation is far
cleaner while being as powerful. How do you use a JavaScript object as a
hashmap? The default try is a potential security hole.

------
hathym
Why not reimplement lua in lua?

~~~
catwell
It has been done, several times.

A popular version is
[http://yueliang.luaforge.net/](http://yueliang.luaforge.net/), although it
only supports old Luas (5.0 and 5.1).

