On this page:
Hack Your Own Language

Hack Your Own Language


(aka, 4620 Building Extensible Systems)

Extensible systems consist of many different components all written in different languages. For example, modern web pages use jQuery to inspect the DOM instead of traversing it manually and frameworks such as React or Vue to deal with events. Many other such embedded domain-specific languages have appeared, and developers continue to build new ones.

This instance of the course will focus on Racket’s advanced tools for building embedded domain-specific languages. Some of its tools have begun to migrate to the JavaScript universe (see sweet.js, for example) and other languages (see Rust and Scala, for example).

Students will first learn to use these tools and then build at least one language on their own.

The course will be highly interactive similar to the Software Dev course I usually teach. At least half of each class period will be spent on student presentation, and they are expected to learn from each others’ design and code presentations.


This course will mostly rely on a rock-solid understanding of Fundamentals I, but students will benefit from additional coding experience (prior to college, as a hobby, or via co-op).


Thu Mar 22 16:59:55 EDT 2018

Here is Tuesday’s code: network-lang-client-as-syn, network-lang-gen-parser, network-lang-reader, network-lang, network-lib, network-syn-lang, network-lang-client, network-lang-gen-parser, network-lang-reader, network-lang-regexp-parser, network-lang, network-lib, network-syn-lang-client Stephen may revise the code some more.

Also, you may wish to use the Set-up instructions to eliminate the s-exp part of the language specification. This will make your language look better.

Tue Feb 27 16:52:18 EST 2018

If you wish to use the Turnstile language, you will need to install the turnstile package from the Racket package server. Use Racket’s raco command at the shell prompt to install the package or DrRacket’s file menu. Once you have installed the turnstile package, you can begin to play with Stephen’s code from today, stlc-prog, stlc, lc .

Stephen has also published the full deck of lecture slides from today.

Fri Feb 23 17:42:06 EST 2018

Stephen’s code is available: stlc-prog, stlc, stx-utils, typecheck-forms, typecheck-testing, typecheck . Also take a look at his explanation of type-checking lambda on Piazza.

Wed Feb 21 19:38:09 EST 2018

I have re-released 7 — Simple Types (b). Please study it in preparation for Friday’s lecture. The point of this assignment is to clarify whatever question you have about Stephen Chang’s lectures—so come prepared and ask all the questions you have.

Tue Feb 20 20:47:07 EST 2018

Stephen has posted the files from today’s lecture: stlc-prog, stlc, typecheck-forms, typecheck, typecheck-testing . Please study them in preparation of the key lecture on Friday, which will enable you to implement the solution for next Tuesday’s homework.

You may also wish to look at phasing which presents some phasing examples.

Finally, here are Stehpen’s overview slides.

Sun Feb 18 19:07:21 EST 2018

The code from Stephen’s Tuesday lecture is now available: stlc-prog, stlc, typecheck-testing, typecheck . Note that this code may be improved on Tuesday.

Tue Feb 13 14:40:33 EST 2018

You may wish to read up on the monolithic way of implementing Typed Racket.

Fri Feb 9 17:13:13 EST 2018

The code for today’s lecture is available: redex, redex-types, type-check To some extent, these files also guide you thru the lecture, though not the philosophical remarks.

Tue Feb 6 14:41:56 EST 2018

The code for today’s lecture is partly available through 5 — Racket Languages 2 and the rest is here: network-lib-client, network-lib, network-lang-client, network-lang

Mon Feb 5 21:21:57 EST 2018

The code for past Friday’s lectures is available now: a, b-lang, c-lang, d-lang, e-lang, f-lang

Thu Feb 1 12:04:46 EST 2018

You may find the following readings useful for doing your homework that is due next Tuesday:

The code for Michael Ballantyne’s lectures are available now: hook, eval, exists-example, exists, expander, hygienic-expander, or-macrostepper

Tue Jan 30 12:09:55 EST 2018

Please read Composable and Compilable Macros for the meeting on Tue Feb 6.

Thu Jan 25 17:16:30 EST 2018

The code for past Tuesday’s lectures is available now: a, b, c, d, e, f

Fri Jan 19 16:28:50 EST 2018

The code for today’s lectures is available now: e, f, g, h, i, j, k

Fri Jan 19 12:18:32 EST 2018

Please read up on Racket’s syntax model for next week, Tue Jan 23 and 26.

Mon Jan 8 21:26:32 EST 2018

Please read A Programmable Programming Language for the meeting on Tue Jan 16.