Published 2022-05-13

Mocha-Script

Somehow I ended up graduating my undergraduate program without ever taking a compilers course. Seems like a sin.

In any case, I had the burning desire to understand compilers and interpreters more so circa 2013 (where "js but not js languages" were reaching a fever pitch e.g., CoffeeScript), I created mocha-script as a learning experience.

Mocha-Script is a dialect of Lisp that compiles to executable JavaScript code. It was pretty heavily inspired by Clojure and features some of their syntax conveniences as well as first class macro support.

The GitHub repo is here: https://github.com/tantaman/mocha-script/

A Tour of the Language

Declarations

>
Compile & Run

Functions

>
Compile & Run

Objects

>
Compile & Run

Arrays / Objects continued

>
Compile & Run

JS Interop

>
Compile & Run

Looping and Branching

>
Compile & Run

Types, Inheritance, Mixins

>
Compile & Run

Macros

>
Compile & Run

Events msdispatch

>
Compile & Run

Standard Library

>
Compile & Run