Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MoonScript compiled to JavaScript with Emscripten

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 codemirror2
Octocat-spinner-32 examples
Octocat-spinner-32 img
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Makefile
Octocat-spinner-32 client.js
Octocat-spinner-32 index.html
Octocat-spinner-32 moonscript.js
Octocat-spinner-32 proxy.php
Octocat-spinner-32 schema.sql
Octocat-spinner-32 snippet.php
Octocat-spinner-32 style.css
Octocat-spinner-32 worker_head.js

MoonScript for JavaScript

This is a version of MoonScript that has been compiled to JavaScript using Emscripten.


The Lua source code of MoonScript is concatenated into a single file which is converted to a header using xxd. This is included a C file along with Lua and LPeg which are then compiled into LLVM bitcode. Finally the entire thing is linked and fed into Emscripten to create a JavaScript file.

The JavaScript is compressed with the Closure Compiler. The file itself takes a long time to load, especially on Chrome, so it is loaded in as a web worker.

A simple HTML page creates the worker to provide an web interface for compiling and running MoonScript.

Check it out at

Something went wrong with that request. Please try again.