The Racket Way
infoq.com
infoq.com
Occasionally, I do get this urge to move to Amazon so I can "play" with Haskell, Go, Racket, Scala, etc. Has anyone created a "Frankenstein" website on their side-project site? It would be a great way to learn many of these "non-mainstream" languages.
The records are destructive in the example at the end. Is working with immutable data structures in Racket as easy as in Clojure?
There are both mutable lists and immutable vectors and hashes though.
Edit: and user-defined structs are immutable unless explicitly declared with #:mutable keyword.
Racket's libraries are designed to encourage doing everything with immutable data, though there are plenty of mutable types if you need them. (And of course you can always use boxes.) I don't know enough about Clojure to make a comparison, but I can say that working with immutable data structures in Racket is easy.
http://www.infoq.com/presentations/Value-Identity-State-Rich...
So for me at least, it's simple. If I don't care about startup time and just want the best ecosystem, Clojure is a no brainer. If I do care about startup, you have to pick one of the Lisps, probably either SBCL or Clozure.
Racket since grew a full library of purely functional datastructures, cleaned up hashes, provides builtin streams and generators and as for the syntax - well, it's a lisp: write your own syntax and be done with it! ;) [edit: https://github.com/takikawa/racket-clojure/blob/master/lang/...]
Anyway, this post should be either updated or at least marked as not entirely relevant three years later.
I'm taking a Coursera course that teaches Racket, so I just started learning it this week. First time using a Lisp/Scheme family language. So far I actually really like the use of parentheses and the concept of the code itself being a data structure. I'll probably give Clojure a try once I have a firm grasp on Racket, they seem quite similar.
I would think these things could be implemented in Racket. In fact, I would love to see a Racket implementation of Clojure (minus the JVM bits) that was nicely integrated into DrRacket.
And, as a joke, their name is really bad for business, though I happen to like it just because of this ;) : For "racket", in my part of the world, the first meaning of the word that pops to one's mind is the one related to violent organized crime. Even in the English dictionary there's the "2. A dishonest business or practice, especially one that obtains money through fraud or extortion." meaning (http://www.thefreedictionary.com/racket)
http://en.wikipedia.org/wiki/Pyramid_scheme http://en.wikipedia.org/wiki/Ponzi_scheme
The re-brand wasn't a bad idea in that respect but they probably should have held off until they had some shiney new showcase app/library to (ugh) synergize with (see Pharo piggy backing with Seaside).
Scheme is great for both, and it's very unfortunate that the impression most people have of it is that it's an educational/reasearch tool only.
Racket is a very young language. Until a few (3?) years ago it was a (PLT) Scheme; Scheme has it's uses but they are very specific, nobody would use a Scheme as a general purpose, systems programming language. Racket evolved and is now much more than simply a Scheme-with-extensions: it's a platform for language creation as well as robust runtime and has many very good tools.
It all makes sense if you look at Racket as a fresh language, that only started a few years ago - think about Python in it's infancy. It is very impressive and surprisingly mature in comparison, but it's still very young and has many parts missing - it's almost ready for production, but not quite there yet and I don't think this should be rushed.
Sticking with Racket now is a kind of gamble. I think that in a six to eight years time Racket will be competing with Clojure for a place of the most popular Lisp in existence and I think that in the future it will be the "new hot thing" for a while, just as Python or Ruby or JavaScript were. Most importantly Racket is a language that I'd really like to use in ten years. But still, it's uncertain and any number of things can go wrong and Racket can remain unpopular, niche product for eternity. That's the risk of using young, aspiring languages - I once won betting on Python and now I'm going to try again with Racket.
So, to summarize this rant: Racket is very young; languages need time to gain traction; if Racket evolves as fast as it does it will become insanely popular when the time comes.
I feel a bit confused about the distinction you're making. Didn't Guy Steele refer to Scheme as a LISP dialect?
See http://en.wikipedia.org/wiki/Lisp-1_vs._Lisp-2#The_function_...
But I don't know the Lisp/lisps history that well, did I use the term incorrectly?
Much like Clojure, Kernel, and newLISP are languages in the Lisp family.
Anyway, I think that day-to-day programming in Racket is sufficiently different from Scheme's that it (Racket) deserves to stand on it's own. Saying it's a descendant of Scheme is obviously ok, but saying it's a dialect of Scheme is a bit too much, I think.
On the side, I find Rich Hickey's and other Clojure videos very inspiring and atuned to my "intuitions" (that's how you sell a Lisp!) and same for the SICP lectures from the 80's with their "processes as spirits inside the computer" metaphors.
level 0 (the "word processor" or manipulating data with not programmable tools): you are wizard's apprentice - and you clean your room by using the tools yourself (as real world brooms and scrubbers are not "programmable" :) )
level 1 (the "programming language" or "programmable tools" or code level): you are a wizard now (or an apprentice that stole the master's wand or magic hat, something) and you use your wand to instruct/program the tools to do the cleaning for you according to your rules/program
level 3 (either meta-programmer or dsl or language for building languages or the code-as-data level): you are now a master wizard that can control other people and even other wizards that can in turn control other wizards and so on... (you have a language for writing languages or, in fact, any language that can treat code as data because you can now use it to make other languages)
...if you're looking for some imagery for it, master Walt's cartoon http://www.youtube.com/watch?v=jSTWy25hRiI is pgood inspiration for level 1 (especially if you want to emphasize how "hard" programming is), but you'll have to look for yourself for level 0 and 3 images