Programming Languages

PL101: Create your own programming language

In this class you will learn how to use the principles of programming language design to implement your own working programming language in JavaScript. You’ll be able to show off the finished product to your friends and prospective employers on a simple demo webpage.

How does the class work?

You sign up with your email address. From then on I’ll email you details about what to do. There will be a discussion board for participants to talk about the material and help each other out.

I plan to post one section of material each week. In general there will be course webpages, online demos, and links to books and papers for further reading for each section. In addition you will be working on your own programming project. You’ll start with a simple toy language, then add features to it following the concepts we cover to make a language that is uniquely yours.

There are no graded assignments or exams. Your project will be reviewed by me and your fellow students, but there aren’t any scores; it will just be comments and suggestions.

How hard is it?

Participants in the class should be comfortable programming in JavaScript. It’s also good if you’ve used a few different languages before. Creating a new programming language covers a lot of ground, so you’ll have to be willing to do some work.

If I were to place this class in an academic setting I would classify it as between “beginning undergraduate” and “advanced undergraduate”. Your project can be more or less ambitious depending on your preference.

Why should I join?

You will learn an incredible amount in this course if you put the work in. In addition, you’ll end up with a cool project you can easily show your friends and potential employers. But the real reason is that it is incredibly fun to create something as amazing as a programming language.

Who can participate?

You can! In fact, participation is open to ANYONE for FREE as long as spots are still available.

Who is the instructor?

I’m Nathan Whitehead, the instructor and designer of the class. I’m a software developer in Sunnyvale, CA. I have a PhD in computer science from University of California, Santa Cruz. I love programming and thinking about advanced computer science things. One of my projects was Nathan’s Lessons, a series of interactive JavaScript lessons about closures.

How do I enroll?

Leave your email address on the signup form. It’s that easy.

I want to help out

Awesome! One thing you can do is tell your friends about the class to get the word out. Tell people about

If you want to help with the course contents, please sign up as a student. I’ll have a special section of the discussion boards for discussion about upcoming sections where you can help me out.

Organization (preliminary)

Whirlwind tour of programming languages history

First we’ll delve into the past to see how programming languages have evolved through time. We’ll look at different families of programming languages (e.g. imperative and functional) and examine broad similarities and differences between them. At this point you’ll be thinking of ideas for your programming language.

Project setup

Everyone will set up a GitHub project for hosting their code and a Google App Engine project for their live demo page. You may use other resources if they are more convenient for you. You will put up some “hello world” code and an introduction webpage.


We’ll cover what parsing is, why it can be tricky, and how the problem is usually solved. We’ll work through some example simple parsers to get familiar with the parsing tools we’ll be using. We’ll be using PEG, a packrat style parser generator. No actual rats will be harmed in the making of the parsers.

Your first interpreter

You will create your first working interactive interpreter for a toy imperative language. Not a lot of theory here, this is about getting some code up and running with a usable interface.


We’ll add in procedures to our toy language, which will involve figuring out how to represent environments and keep track of assignments to local variables.


Next we’ll take break from the theory and do some fun graphics hacking. We’ll work through a turtle graphics example and draw some pretty pictures.

Project proposal review

At this stage you should have a good idea of what features you want your programming language to have. We’ll discuss project ideas and review each other’s proposals to give constructive feedback.

Recursion [optional]

We’ll figure out some of the tricky details involving functions calling themselves.

Objects [optional]

You will add a simple object system to your language with classes and methods.

Exceptions [optional]

We’ll discuss continuation passing interpreters, which allow us to write interpreters that can handle complicated control flow patterns such as exceptions.

Types [optional]

We’ll work through some simple type systems for our toy language to demonstrate how typing and type-checking work. We’ll also do some examples of type inference for an ML-like example.

Project showcase

Your project is done, now you get to show it off! We’ll review each other’s projects and give constructive feedback. Then we’ll shout out to everyone how cool our projects are.

I hope you’ll join me in this epic quest.

–Nathan Whitehead

Nathan’s course has worked wonders for me and i am sure it will do the same for you! Stop thinking about it and start the program today!

Bruce Donivan / Facebook

I was extremely hesitant to join Nathans University but after i signed up and worked on a few courses i was glad i did. The amount of knowledge i gained from from Nathans University has helped me excel in my programming career.

Patrick Lillards / Facebook

Nathans University is the BEST online resource for beginner programmers who are looking to take it one step further. Don’t believe me? Sign up today and check it out for yourself!

Amy Evans / Facebook