You should check out Lua

Pierre Chapuis, Moodstocks

You should check out

Lua

Human Talks Paris, 2013-02-12

Who's that guy?

Pierre Chapuis, Moodstocks

Slides: http://is.gd/luaen (CC BY 3.0)

Warning

trollface

Lu- what?

[1] You have been warned...

Lightweight?

~ 100kB core + 100kB stdlib, 4kB RAM

200kB

Simple?

Lua is much simpler than JS. This means you can make a simple interpreter that runs fast enough to be balanced with respect to the trace-JITted code.

Brendan Eich

LuaJIT: fast!

bench

1 64 bits core, may 2010 :(

No libraries? :(

no libraries

LuaJIT: FFI

      
local ffi = require("ffi")
ffi.cdef[[
unsigned long compressBound(unsigned long sourceLen);
int compress2(uint8_t *dest, unsigned long *destLen,
    const uint8_t *source, unsigned long sourceLen, int level);
]]
local zlib = ffi.load("z")

local compress = function(txt)
  local n = zlib.compressBound(#txt)
  local buf = ffi.new("uint8_t[?]", n)
  local buflen = ffi.new("unsigned long[1]", n)
  assert(zlib.compress2(buf, buflen, txt, #txt, 9) == 0)
  return ffi.string(buf, buflen[0])
end

local txt = string.rep("abcd", 1000)
local c = compress(txt)
      
    

Used in games

Angry Birds, Cry Engine 2 (Crysis), World of Warcraft, L.A. Noire, Baldur's Gate, Heroes of Might & Magic V...

tropico

Used in games

monkey island

Used on mobile

Other uses

VLC, Adobe Lightroom, Awesome WM (Kindle Touch), Redis, Luvit / LUV, nginx, nmap, wireshark, SnabbSwitch, NetBSD, Codea, Roblox...

Other uses

milkymist

Other uses

eluabrain

Going further

books

Who was that, again?

Pierre Chapuis, Moodstocks

Slides: http://is.gd/luaen (CC BY 3.0)