This is a bit of an anecdote:

I've started doing some Clojure and ClojureScript tutorials; the idea being to 
learn enough ClojureScript to use it with reactjs wrappers on the front-end.

So far the experience has been quite pleasant, with my brain wrapping itself 
around a #lang racket "cousin", overall quite similar (at least so far), but 
with some different design choices.

But ... OMG the error messages in Clojure are "not good", with abstraction leak 
into Java.

E.g. (+ 1 "foo")

Clojure:
  ClassCastException java.lang.String cannot be cast to java.lang.Number  
clojure.lang.Numbers.add

Racket:
  +: contract violation
  expected: number?
  given: "foo"
  argument position: 2nd
  other arguments.:

Python (for 1 + "foo"):
  TypeError: unsupported operand type(s) for +: 'int' and 'str'

This isn't too bad if you can guess the error, but for more involved cases and 
unfamiliar semantics the Clojure is particularly painful. Which led me to take 
a mysteriously failing piece of Clojure, hand-translate it to Racket (easy for 
a few lines), and use the Racket feedback to diagnose the problem in Clojure. 

Not an ideal workflow!

The interesting thing, to me, is that Clojure -- *despite* this shortcoming 
(which one would think would be quite an obstacle to newcomers) -- is doing 
rather well in terms of popularity.

* * *

I'd be interested in hearing from anyone else who's using or has used both. 

I see that that Asumu has mad a little #lang clojure (couldn't get it to work: 
collection not found error in 6.1.1.8) and Greg Hendershott has #lang rackjure 
(which works, but is a hybrid by design).

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to