// HACKER NEWS — CYBERSECURITY
A Friendly Introduction to Racket
"Lisp is worth learning for the profound enlightenment experience you will have when you finally get it." — Eric S. Raymond
Welcome. Today you'll learn a language from one of programming's oldest and most unusual families. A language where code is data, where parentheses are pure structure, and where programs can write programs. By the end of this tutorial, you'll have written your own syntax.
Lisp was born in 1958, invented by John McCarthy at MIT. For context: it's the second-oldest high-level language still in use (only Fortran, from 1957, beats it by a year). Python arrived in 1991. JavaScript in 1995. Lisp predates them by more than 30 years and several ideas we now consider "modern" were born there:
For decades, Lisp was the language of artificial intelligence. In the 70s and 80s there were physical computers designed to run Lisp directly: the Lisp Machines built by Symbolics and LMI. Then came the "AI winter," funding dried up, and Lisp went from star to cult language.
But interesting ideas don't die they mutate, that's part of the beauty of the lisps.
In 1975, Gerald Sussman and Guy Steele created Scheme: a minimalist, elegant, almost mathematical Lisp. Scheme became academia's favorite language for teaching programming (the legendary book SICP Structure and Interpretation of Computer Programs is written in Scheme).
In 1995, Matthias Felleisen's group created PLT Scheme, a Scheme designed for education and programming language research. In 2010 it was renamed Racket, and today it's much more than a Scheme: it's a language for building languages. Its unofficial motto is language-oriented programming: if your problem needs its own language, Racket lets you build one in an afternoon.
In The Amazing Digital Circus (episode 8, "hjsakldfhl"), when Kinger opens the terminal to try to reset Caine, you can see that Caine (a creative AI built in 1996) is programmed in Lisp. The file is literally named Caine-core.lisp.
DrRacket has two areas: at the top you write your definitions (your program), and at the bottom you have the REPL for live experimentation. On the first line of the definitions area, write:
That line tells Racket which language you're using (remember: Racket is a language factory, so you have to pick one).