> > It's right there in the docstring of deftype, but OK.
...followed by several sentences of big fat warnings, including that they are present only to facilitate the building of higher level constructs, such as Clojure's reference types, in Clojure itself. Other than that, you are right, it's there in the docstring :) Fair enough. My point was simply that Clojure implementations have a small > learnable subset that performs well when performance is desired - > primitives, loops, arrays, deftypes, etc regardless of host. It's > unfortunate that the host, in this case the JVM, requires quite a bit of > thinking about type hints and casts. I think most of the challenges around > are writing fast Clojure JVM code lie here. I note these issues are not > present in ClojureScript ;) > OK, but does that mean that at the end of the day, optimized ClojureScript performance is head-to-head with optimized JVM Clojure in a desktop/server side application? > > >> Finally, Cristophe's solution, as well as all other optimized Clojure >> code, seems to be just barely making it for the use case involved. In my >> code, for example, I struggle with such things as an array of Strings >> (received from a Java method) failing when used in amap, which needs an >> array of Objects. I'm sure I could come up with yet another layer of >> obscurity which would make this work, but, as I said, after several months >> of struggling I'm ready to settle for 100 lines of clean, elegant, obvious >> Java. >> > > Perhaps it's because I lack considerable experience with Java that I don't > find it so challenging. Yes it's a bit finicky, yes it could be improved, > but it still beats writing Java in my mind. > I'll give you one specific item that I keep tripping upon: the lack of reassignable, stack-based locals. Without them I can't efficiently get more than one value out of a loop. Another item is that I can get zero primitive values out of a loop. How do you cope with those? When on the subject, the times are getting ripe for a full-length book not about how handsome and elegant and FP-y Clojure is (we have plenty of those), but a "terrorist's handbook" on writing performant Clojure. Can you recommend any current material in that direction? -Marko -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.