Beautiful Racket: Why Racket? Why Lisp?
Thank you for your comment
Beautiful Racket / appendix<br>Why Racket? Why Lisp?
Beautiful Racket and Practical Typography were made possible by a publishing system called Pollen. I created Pollen with the Racket programming language. Racket is a descendant of Scheme, which in turn is a descendant of Lisp.
So while Racket is not Lisp (in the specific Common Lisp sense), it is a Lisp (in the familial sense). Its core ideas—and core virtues—are shared with Lisp. So talking about Racket means talking about Lisp.
In practical programming projects, Lisps are rare. Racket especially so. Thus, before I originally embarked on my Lisp adventure, I wanted to understand the costs & benefits of using a Lisp. Why do Lisps have such a great reputation, yet few users? Was I seeing something everyone else missed? Or did they know something I didn’t? To find out, I read whatever I could find about Lisps, including Paul Graham’s Hackers & Painters and Peter Seibel’s Practical Common Lisp. (OK, parts. It’s a big book.)
What I found was plenty of Lisp flattery from expert Lisp programmers. (Also plenty of Lisp kvetchery from its detractors.) What I didn’t find were simple, persuasive arguments in its favor. So here’s why Racket was the right tool for me, and what I see as the practical virtues of Lisps in general.
Consider the source
I didn’t study computer science in college (though I was a math major for two years, before switching to design). I’ve never held an official job as a programmer. Rather, programming has been a secondary skill I’ve used in my work as a web designer, type designer, and writer.
But in the last few years, I’ve spent an increasing amount of my time programming. This programming generates income. So by the simplest definition—does the skill make you money?—I suppose I qualify as a professional programmer. And since most of my programming efforts are in Racket, I qualify as a professional Racket programmer.
Mind you, I’m not claiming that I’m an expert programmer. Among the Racket community, which is laden with computer-science PhDs & professors, I (have no choice but to) embrace my relative inexperience. Hence the title of my talk at RacketCon 2014: Like a Blind Squirrel in a Ferrari.
Yet despite my limitations as a programmer, with Racket I’ve been able to render bigger ideas into programs more quickly, and with fewer bugs, than any language I’ve used before (and there have been many—BASIC, C, C++, Perl, Java, JavaScript, Python, and others). Since I haven’t gotten a brain transplant recently, there must be something special about Racket as a language.
If you’re not familiar with Lisp
Lisp is a language most programmers have heard of, for two reasons. First, it’s one of the oldest computer languages, in use since 1958. Second, it’s accrued a reputation as a language for brainiacs. Originally this reputation arose from its association with the field of artificial intelligence. Since then, this reputation has been maintained by periodic endorsements from respected programmers (latterly, Eric Raymond and Paul Graham) and the enduring fame of the textbook used in introductory computer-science courses at MIT, Structure and Interpretation of Computer Programs (which uses Scheme, and that one I did read start to finish).
But as mainstream programming tools, Lisp and its descendants have been largely ignored. Popularity of programming languages is tricky to measure, but here’s a simple proxy—let’s count the number of projects currently hosted on GitHub. One could quibble about the accuracy of this method, except that the results aren’t even close:
LanguageGitHub projectsJavaScript7,488,087Java6,570,575Python4,017,958PHP2,123,489Ruby1,699,590Clojure64,239Lisp17,989Scheme12,412Racket11,725
The last four languages are Lisps, and together account for only 106,365 projects. Racket itself only accounts for a small fraction of this small fraction.
Popular programming languages aren’t necessarily good—look what’s at the top of that list. + [JavaScript] has a lot of stupid in it … The good parts of [JavaScript] go back to Scheme and Self.<br>—Brendan Eich, here and here But unpopular languages often have fatal flaws that prevent wider adoption. As I was considering languages, Racket had a lot to recommend it. But was there a fatal flaw I was overlooking? And by committing to a Lisp, would I be painting myself into a corner? I wanted to understand the risks and benefits.
Flattery gets you nowhere
I said above that Lisp flattery is easy to find. The problem with Lisp flattery is that it makes sense only to experienced Lisp programmers. To others—especially those who are trying to decide whether to learn and use a Lisp—it just comes across as unsubstantiated hoodoo.
For example, in his essay How to Become a Hacker, Eric Raymond says “Lisp is worth learning for …...