Human Talks Paris, 12/02/2013
[1] J'avais prévenu...
~ 100 ko cœur + 100 ko stdlib, 4 ko RAM
1 cœur 64 bits, mai 2010 :(
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)
Angry Birds, Cry Engine 2 (Crysis), World of Warcraft, L.A. Noire, Baldur's Gate, Heroes of Might & Magic V...
VLC, Adobe Lightroom, Awesome WM (Kindle Touch), Redis, Luvit / LUV, nginx, nmap, wireshark, SnabbSwitch, NetBSD, Codea, Roblox...