Scala committer here. I wasn't subscribed to core-libs-dev yesterday so I can't reply to the message over there, so posting here instead.
A while back, I prototyped [1] a change to Scala's structural invocations to use dynalink. The existing implementation generates code at each callsite to reflect on the receiver to lookup the matching target method (employing a cache) and is described in "Compiling Structural Types on the JVM" (Dubochet, Odersky) [2].
dynalink was really simple to integrate, and seems to fit our use case perfectly.
The need to add a runtime dependency was a little off-putting (tilting the balance from "no brainer, let's use this" to "nice to have, but I'd rather not touch our build") , so I welcome the move to standardize the API.
One problem that came to mind when reviewing the dynalink internals was potential class loader leaks in the cache in ChainedCallSite: an call site will contain a strong reference to the method handle of recently invoked targets. Has this issue been raised before?
Scala's existing cache [3] associated with each structural type callsites suffers from the same problem. I don't remember anyone reporting it in practice, but this might be because structural calls are something of a niche / frowned-upon feature in Scala.
I understand that this sort of problem is notoriously painful to code around, though.
Jason Zaugg