4 ms·
I can't talk about IDEs because I use Emacs for both languages, and it works well for me. Clojure and Racket have quite a few similarities. They are both relat
by jnxx 5y ago
I can't talk about IDEs because I use Emacs for both languages, and it works well for me.
Clojure and Racket have quite a few similarities. They are both relatively minimal, and are both Lisp-1 (https://clojure.org/reference/lisps https://clojure.org/reference/lisps).
Racket as a Scheme has a stronger separation between compilation and run time, in order to maintain safe semantics. This has an effect on interactivity which is an important difference between Schemes and Lisps. It is easy to redefine a function in a running Clojure program and call into it without re-starting the whole program. In Racket, one does more often re-start a program.
Clojure is heavily opinionated towards functional programming. For example, all sequences are evaluated lazy, while Schemes do not do that by default. This is something it has in common with Haskell. But I also think this might be one of its many adaptations for use as a language in server and back-end environments, where sequences can become very large. These adaptations make Clojure very good for concurrency but less well-suited for true parallelism. It generates also slower code than Common Lisp.
Clojures standard implementation is tied to the Java virtual machine. This has advantages and disadvantages: A very large library of functions which programs can call into. Worse stack traces. Error reporting is limited in comparison to Common Lisp. No continuations like in Scheme. And it is much harder to call into C code when this is needed for speed, for for calling into system functions.
In Racket, it is easy to call into C code and to call into Rust code with C ABI. That means Racket can be used as a glue language, like Python (however it is not made for being embedded into C/C++ programs, that would be a flagship application for Guile).
Clojure programs have a large start-up time of potentially several seconds which is irrelevant for servers, but make int unsuitable for scripting (well, there is babashka, a Clojure implementation which improves on that https://github.com/babashka/babashka https://github.com/babashka/babashka).
All in all, Clojure is fantastic for programming for the server and for concurrent tasks, and for learning functional programming.
Racket on the other hand is well suited for beginners, it has a large and well-rounded standard library and a lot of useful packages. It is easy to write a GUI with it, it is good for easy scripting, interacting with the OS, writing experimental algorithms, like Python very suitable as glue and so on.
Also, because Racket belongs to the Scheme family, if needed there is a whole host of Scheme implementations which can be used for any special needs, with very little change in the base language, so in that way Racket is one versatile power tool in a quite large tool shop.
There are also applications where I think Common Lisp is probably the best choice: Very mature implementations, very stable, availability of compilers which generate very fast code, especially a high performance in numerical algorithms, good imperative capabilities where they are needed, fastest start-up for scripts, very good documentation and books, independence from particular vendors or projects.