I saw the post, initially, and wanted to chime in with a "Racket is great, that is all!", but I feel like that isn't very intellectually honest.
A blog post by Hillel Wayne about "toolbox languages" has recently been making the rounds on lobste.rs
, and I think the description he provides, helps a lot to define what I consider to be Racket's sweet spot:
A toolbox language is a programming language that’s good at solving problems without requiring third party packages.
Basically, whenever I need to get something done, I reach for Racket. Of course, I am biased because I use Racket (almost) every day, but I do know a couple of other languages, including Java
, Python
, PowerShell
, and recently C#
; all of which I have come to appreciate in their own ways.
What differentiates Racket, I think, is that it is particularly good at applying the maxim of being "conservative in what you emit, and liberal in what you accept". It does a very good job of putting the user (me) first. It mostly stays out of my way, and when I need to change it, or I feel like I need to add a dash of special sauce, I can!
I would augment Hillel's definition slightly, to exclude the bit about "[not] requiring third party packages" because I feel like this misses a great deal of what makes Racket nice to use. To wit, a carpenter is not a [kitchen] island! The lobste.rs
discussion mentions Frink
and, as I suspected, there is a Racket library which does something equivalent. Running a raco pkg install ...
is too convenient for me to exclude from consideration.
Obviously, in his metaphor, each language is like a tool in the box, but in this context, I feel like the ideas that glue Racket together, are in fact the real tools in the box. Anyone can use a hammer, but at some level there is also an "internal manual" that you have to consult, and examples of previous uses, to really start nailing it.[0]
He goes on to elaborate that a toolbox language should be fast to write. I have not experienced another language with the same ease-of-development that Racket fosters. As an example, in the past week I have had to write a parser for email notifications posted to an IMAP server.
The proof of concept was written in Racket, and probably took about 3 hours to complete, most of which was spent fiddling with a tricky regular expression, and came out to roughly 126 loc, including the IMAP client usage, but minus the comments.
The equivalent program in C#
took quite a bit of time longer to write, purely from an implementational perspective, because the language forces me to "segregate" my thoughts much more rigidly, and it is obviously much more verbose.
Neither was "better" because the behaviour remained the same (modulo my own stupidity), but I felt less "encumbered" by the Racket solution. I also don't have to worry as much about the way my code is presented in Racket, because the syntax is so malleable. Instead of torturing my code into a specific format all my teammates have come to expect, I can lay it out however I think makes the code more readable.
Hillel also mentions a smooth on-ramp for learning the language. I think Racket shines here as well. I often feel like I am a bad programmer because I do not know a significant amount of what my language can do. This is likely true of most programmers and languages; however, I always feel like Racket is inviting me to learn more because of its great documentation and community, whereas I often feel like a "scrub" in the same context for another language.
This is more of a "social problem" I think, than it is a "language problem". There will always be a learning curve to any new information, but the trick is that the information can only do so much to become lodged in your brain. At some point, people--other people--need to be involved, and this makes all the difference.
Anyways, I think the sweet spot that Racket hits, is that it allows me to be whichever kind of programmer I want to be today.
Mooiloop!
[0] This is just a feeling; I don't have a specific idea in mind here, but I trust that it is not unfounded because Racket is in fact a "language-oriented" language. YMMV.