5 ms·
Why Lisp? That is understood. Why Racket? From an ignorant outsider's perspective, all Lisps seem to be more or less interchangeable when it comes to the langu
by DCKing 12y ago
Why Lisp? That is understood.
Why Racket? From an ignorant outsider's perspective, all Lisps seem to be more or less interchangeable when it comes to the language. They only differ in the details, and each seems to be about as difficult to learn as the other. Although this article does make somewhat of a case for specifically Racket, it seems to be a rather weak one - tools are nice and some language details are nice. But the same general arguments can be made for other Lisps, most notably Clojure. It seems to me that Clojure is a lot more practical: it has many good libraries in both Clojure and Java, it has some great tools, there's a lot of momentum, and it can be deployed everywhere (including the browser).
So, being an ignorant outsider, is there any reason the Lisp I should learn isn't Clojure?
- pervycreeper 12y agoSICP
- klibertp 12y agoStructure and Interpretation of Computer Programs by Abelson and Sussman, for the uninitiated. It's one of the best introductions to basic and advanced (and then even more advanced) programming there is. This book, along with a series of "The Little Schemer", "The Seasoned Schemer" and "How to design programs" use Scheme as a language, and Racket makes it particularly easy to follow them by providing special environments (#langs) crafted for them.
- cipher0 12y agoOnline interactive version of SICP http://xuanji.appspot.com/isicp/ http://xuanji.appspot.com/isicp/ for great win.
- densh 12y agoRacket has probably the best macro system out of all existing lisps available to date. Plus it has concept of extensible languages via #lang. If you care about lisp-style macros and meta-programming that's probably the main reason why I would recommend Racket. Clojure macros in comparison are very ascetic. You can get stuff done in them but it's not a strong feature of the language in my opinion.
- cturner 12y agoRacket has strong multi-platform support of its own. I actually chose racket over options like clojure for building a game, because I wanted to be able to be able to easily and quickly package one codebase for deployment on windows (running in a window), OSX (running in a window) and linux (running in a terminal). From the standard install, you can quickly package code to a stand-alone binary. With Clojure, some users would need to install a JVM. Clojure's great though.
- klibertp 12y ago> all Lisps seem to be more or less interchangeable when it comes to the language Definitely not true. It may be true to an extent for implementations of one particular lisp, like Common Lisp or Scheme, but even then there are very real, and significant differences. Simple and regular syntax makes it actually much easier to build many different semantics, and that's what lisps are about. Racket has less libraries than Clojure and no access to JVM ecosystem. On the other hand it's FFI capabilities to C are very nice and easy to use. Racket macro system - syntax-parse (with syntax-rules and syntax-case and... defmacro for simpler cases) - is the most powerful there is right now. Combined with access to the reader and ability to make reader macros this makes Racket much easier to extend and transform than Clojure (by design). Which takes us to the biggest advantage of Racket, which is it's actually a family of languages, both s-exp based and with traditional syntax, built for specific purposes, which you can mix and match easily. Typed Racket and lazy variant, and FrTime, and Datalog - and more - are examples of this. Then you have module system which is a game changer for unit-testing, object system which is more powerful than most (besides CLOS, but there's always Swindle), the most advanced contracts system among all PLs, and of course quite fast JIT compiler and many more. Clojure is simpler than Racket, but provides a set of highly opinionated defaults which people are comfortable with. I think Clojure and Racket are like Sublime Text and Emacs - Emacs is strictly more powerful, but it requires much more work to use this power well, while Sublime works well from the get go. But in the end both are infinitely better than Notepad and sooner or later you will come to know both, which is what I suggest you should do.
- DCKing 12y agoThanks for the clarification. Is it worth considering others besides Racket and Clojure as a first Lisp? Are there Lisp equivalents of Vim and Atom as well?
- klibertp 12y agoOne path you could take is to start using a lisp for the platform you're already familiar with. There is Hy for Python, LispyScript (and others) for JavaScript, LFE for Erlang and more. These are "lisps" to varying degrees - they all are written with sexps, but they typically preserve the semantics of underlying language, which makes it really easy to pick up and get over the initial hurdle of "ZOMG parens!!!". I had good experience with Chicken Scheme, which is both much simpler system than Racket, but also quite rich in features and add-on packages and it also produces fast native executables. I suppose you could make it your first Scheme. Of course, Emacs users should just hack in Elisp for a couple of months, then switch to Common Lisp. I wouldn't recommend going straight for CL, unless you're going to follow some really good book (like pg's "On Lisp" or maybe "Land of Lisp"), because it's very easy to drown in CL capabilities. You should decide what you want to build - don't learn a lisp just for the sake of learning, build something with it! - and then choose the best lisp for this particular project. I'm sure lispers everywhere will be happy to help you choose (just before the thread evolves into massive flame-war, again... ;)).
- crististm 12y agoRacket vs Scheme vs Common Lisp is like C# vs Java vs C++ vs ...