On Apr 9, 9:31 am, Alen Ribic <alen.ri...@gmail.com> wrote: > I came across this > posthttp://www.baptiste-wicht.com/2010/04/java-7-more-dynamics/ > and though this would be a good place to share.
The article seems to say that using this API instead of reflection will make dynamic calls "almost the same as a standard call.". Fascinating! I wonder how much work it would be to modify Clojure to use the new API automatically if it was present in the current JVM. * Primitive Return Values * I wondered if this new API could be used to specify primitive return types so Clojure could be extended to create IFns that return int. I found a text form of JSR 292 and it contained this gem: (source: http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/001131.html) 1.3 Any call to a method in Dynamic accepts an optional type parameter which specifies the return type of the call site's descriptor. The type parameter may any type whatever, including void or a primitive type. Lau's latest experiment with fluid dynamics showed a 9794x speed improvement by using native types for all of his calculations (and by getting rid of reflection overhead): http://www.bestinclass.dk/index.php/2010/03/functional-fluid-dynamics-in-clojure/ It looks like we'll soon have the JVM features available to get ~ this speedup without having to resort to macros or arrays. The thought of this makes me smile. I wish I wasn't in crunch mode right now because this would be my personal fun project. Cheers. -- 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 To unsubscribe, reply using "remove me" as the subject.