Get the latest tech news

Itchio and coroutines (using OpenResty and Lua/Lapis) (2016)


itch.io is a website for hosting indie games, its implementation is unique because it’s written entirely in Lua ( MoonScript ). It runs inside of an nginx distribution called OpenResty . It uses coroutines for all asynchronous operations like d...

(no temporary arrays, or exceptions) Prototypical inheritance is implemented in a smart way — there are no reserved hash table keys to change functionality. Now that Node.js has brought server side JavaScript to the masses, a common task for a web developer is to run a few queries that are dependent on one another, then return the result. Every time Lua code triggers a network operation, control is yielded back to Nginx where it can resume any coroutines that have IO ready for reading.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of lua

lua

Photo of Coroutines

Coroutines

Photo of lapis

lapis

Related news:

News photo

LSON: JSON with binary in 260 lines of public domain Lua

News photo

Lapis: A Web Framework for Lua

News photo

LunarML – The Standard ML compiler that produces Lua/JavaScript