/lua-to-x86-compiler-js

Lua to x86 compiler in JavaScript

Primary LanguageJavaScript

Lua to x86 compiler in JavaScript

Ever wanted to know how compilers work? This is a good way to learn about what happens under the hood of a compiler.

This project implements a Lua to x86 assembly compiler in JavaScript. It uses a hand-rolled lexer, a recursive-descent parser, and emits x86 assembly. The result is a compiler for a small subset of Lua to basic x86 assembly.

Screen Shot 2016-04-08 at 10.44.36

What You'll Need

  • Browser Developer Tools (Firefox’s 3D view is especially handy)

How It Works

To understand the code, start in lex.js.

Getting Help

You can see other example projects on our Community Projects page. And if you get stuck, let us know on the forum and we can help you out.