What is it?

Fengari (Moon in greek) is the Lua VM written in JavaScript. It uses JavaScript's garbage collector so that interoperability with the DOM is non-leaky.

It comes with a simple module, that renders any interaction with JavaScript and the DOM transparent:

local js = require "js" local window = js.global window:alert( "Hello from Fengari!" ) local js = require "js" local window = js.global window:alert("Hello from Fengari!") Try it: local js = require "js" local window = js.global local document = window.document print ( "Document's title: " .. document.title) local js = require "js" local window = js.global local document = window.document print("Document's title: " .. document.title) Try it:

Lua in the browser means you can use coroutines to write beautiful asynchronous code: