tag:blogger.com,1999:blog-4704664917418794835.post1798238886261285117..comments2023-07-01T05:41:30.469-07:00Comments on Headius: Why Clojure Doesn't Need Invokedynamic (Unless You Want It to be More Awesome)headiushttp://www.blogger.com/profile/15717357218364947795noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-4704664917418794835.post-73887429959991519712012-03-07T02:18:06.541-08:002012-03-07T02:18:06.541-08:00Charles, where did u get ur comic photo? it is rea...Charles, where did u get ur comic photo? it is really nice. :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-6469070333375392272011-10-14T17:54:06.529-07:002011-10-14T17:54:06.529-07:00To be honest, I don't know the details. What I...To be honest, I don't know the details. What I know is that Mark Reinhold, in his JavaOne keynote, told the crowd that "it turns out invokedynamic is useful for Java too" and made it pretty clear they're looking at using it for lambda.<br /><br />I can theorize how they'll use it. Invokedynamic comes with Method Handles, which makes it possible to have lightweight, optimizable function pointers. That means closure bodies can be emitted into the same class and bound to their call site using handles rather than emitting a class for every closure as is done in Clojure and Scala. Aside from reducing the class load on the JVM and the inconvenience of dealing with multiple class files from a single source file, method handle-bound lambda expressions would have *no* object cost (as inner classes do); would support various types of optimized argument shuffling, currying, exception handling, etc; and would optimize as though they were direct method calls in many cases. Invokedynamic is a *fantastic* tool for all JVM languages, and it turns out it's not tied to "invoke" or "dynamic" at all.headiushttps://www.blogger.com/profile/15717357218364947795noreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-42626989493833737872011-10-14T16:23:01.042-07:002011-10-14T16:23:01.042-07:00Charles,
Please be more specific about where exac...Charles,<br /><br />Please be more specific about where exactly invoke dynamic will be used in lambda. Last time I looked it was for very little – I believe what was said was that mh is still not has fast as inner classes (http://www.wiki.jvmlangsummit.com/images/1/1e/2011_Goetz_Lambda.pdf). Oracle would love to make us all believe what huge dividends invoke dynamic is giving us java programmers. I dont think they want people to know that all this investment is doing squat for their 90% use case …. yes of java programmers!joejavanoreply@blogger.comtag:blogger.com,1999:blog-4704664917418794835.post-19398432430134707952011-10-14T15:34:49.712-07:002011-10-14T15:34:49.712-07:00I'm glad to see this issue getting airtime. I ...I'm glad to see this issue getting airtime. I was recently at a Clojure event in London and tried to initiate a conversation about invokedynamic and implications for Clojure. The room looked blank and tumbleweed was blowing. As a punter, I'm hugely excited for what invokedynamic can do for JVM languages; JRuby, Clojure or otherwise.James Ableyhttps://www.blogger.com/profile/10389773375250732709noreply@blogger.com