A Need for Speed

For the languages you've been making so far you've been implementing an interpreter in JavaScript. But there are more possibilities. You can also compile languages into JavaScript code so that they run in the browser directly. This is what languages like CoffeeScript do.

There are advantages to compiling to JavaScript:

The disadvantages are:

The plan

In this lesson you'll take your standard Tortoise interpreter and add functions to compile programs to JavaScript. You'll see how to get compiling working with all the features of the language, then work out the details about how to get it up on a live webpage.

One of the goals of the compiler is to get things working faster with no changes to programs written in Tortoise. We'll call the compiler the Hare compiler!



Next