What are some reasons for choosing Racket over Common Lisp?

The question above was asked in #general on the Racket Discord today.

While my initial response was ‘Depends. What you want to do?’, there were a number of insightful responses. I’ll invite them to be repeated here.

Almost unedited from an ignorant Racketeer (myself)

I found Racket easier to learn because of Racket's excellent learning material (guide, etc.) and because the foundations of Racket seem cleaner and easier to make sense of. That applies to standard data structures and procedures, macros, and even the gui libs which I struggled with more. With CL I agree with the sentiment that you need a guide to understand the current right way to do things.

Quasi-quote macros look neat and easy until you realize what it takes to make robust macros. And then syntax/parse and similar look like a gift from gods. And don’t forget the eval-when nonsense: Racket’s module system is cleaner and as a result easier to understand (IMO).

I think perf-wise Racket is comparable if generally a bit slower without extra tuning, but that’s because idiomatic CL seems very imperative/mutable which is the opposite of idiomatic Racket (IMO).

If you need highly interactive programming environments, CL has an edge. But Racket is also very interactive and is at least honest about how difficult interactive semantics are.

Another reason for choosing one or the other is libs for tasks: I don’t know the state of CL libs. It’s easy to search the Racket package catalog and docs for libs you need, and many of the highly used ones are quite nice. Plus any Git URL can be a package.

1 Like

I don’t know the nowadays state of Common Lisp, but I remember that in earlier days, and may be even nowadays, it did not treat procedures easily when passed as arguments to other procedures. In Racket (and Scheme) procedures are full fletched first class run time objects that can be passed around between procedures without any further ado. In Common Lisp as I remember, procedures are first class run time objects too, but need special approach when passed as arguments to other procedures. With respect to macros, Racket (and scheme) are richer in tools for the creation of macros. Moreover, the syntax of Racket is much simpler than that of Common Lisp and at the same time much richer. MHO.



Thanks everyone. I'll close this off for now.

It is worth remembering questions 'Is X better than Y?' don't really make sense without asking what the goal and constraints are. Just like benchmarks, they are not useful unless they are relevant to what you want to achieve.

It is worth remembering that CL has many nice implementations, not least the speedy SBCL and commercially supported Allegro CL. So don't forget CL - it may be the right choice for your application!

Have a good weekend everyone.