|
|
|
|
|
by ysph
5485 days ago
|
|
"Scala works very well with existing Java frameworks. Android is, of course, one big Java framework and we were going to have to interface with it a lot. A number of people asked, given the above, why not use Clojure--this is why." Since when does Clojure not work well with existing Java frameworks? I wouldn't advocate Clojure or Scala one way or the other since I have little idea of what they're doing, but the above doesn't strike me as sound reasoning. |
|
On the other hand, extending an existing Java class is quite awkward, requiring the use of gen-class, and does not (IMHO) feel idiomatic. I found the gen-class facility poorly documented. It also has a potentially small performance penalty due to an extra dereference (though in my testing I could not measure a meaningful difference between a gen-class object and a native Java implementation).
So Clojure is nice for using Java stuff from Clojure, however it becomes awkward for using Clojure stuff from Java.