Perhaps I Was Too Hard on Racket
February 8th, 2024
Parentheses are Good, Actually
One construct discussed in Programming Languages is the abstract syntax tree (AST). ASTs are essentially a graph representation of how a language interpreter breaks down a program into smaller components, which are evaluated based on their syntax. Racket’s parentheses are highly meaningful, as each pair of parentheses essentially represents one node in an AST, and the separate expressions contained in those parentheses are different branches off of that node. This heavy usage of parentheses makes Racket a great metalanguage to implement other programming languages in, since the interpreter for the target language would simply be a recursive Racket function.
Homework five of Programming Languages has the student create a made-up programming language (aptly named MUPL) using Racket as the metalanguage. This homework is deeply fulfilling since it applies many of the cross-lecture concepts taught in Programming Languages, and provides a better understanding of interpreters among other things. Racket makes building the MUPL interpreter a process of concrete steps, because each evaluation step is roughly equivalent to an expression in the target language wrapped in parentheses. Dan Grossman’s in-depth analysis of Racket’s semantics gave me a much greater appreciation for the programming language than I did before.
Would I Use Racket?
I think that Grossman put it most succinctly by saying that:
“…[one] is entitled to [their] opinion about syntax, but a good historian wouldn’t refuse to study a country where they didn’t like people’s accents."
At the end of the day, a programming language is an interface for writing software. The choice to use Racket would depend entirely on if it were the best tool for the job. I’ve learned that part of being a good computer scientist is exploring technologies outside of your comfort zone, and discovering new tools you might actually enjoy using.
Table of Contents