john.r.rose at oracle.com
Tue Jun 22 13:32:35 PDT 2010
On Jun 22, 2010, at 5:30 AM, Rémi Forax wrote:
> Le 22/06/2010 12:48, Howard Lovatt a écrit :
>> A couple of comments on the current MethodHandle API:
>> 1. Having only one bootstrap method for InvokeDynamic is a bit
>> limiting, it it possible to have one per use site?
> It's an open issue, we're working on it.
I'm prototyping an option for this, this week. We'll see what the EG comes up with. The most compelling use case is code weaving.
>> 2. Has thought been given to using the .( args ) notation (or what
>> ever it ends up as) from lambda dev for invokeGeneric( args )?
> My opinion is that the lambda spec has to mature a little bit
> before looking at this kind of things.
> Currently, the lambda super type is not MethodHandle but Object
I hope we can closely converge the lambda and method handle designs, even though they live at different levels of the stack. For now, let's listen closely to what the lambda folks need and see how to get it to them without mixing levels too much.
>> 3. Are there plans to add MethodHandle literals, e.g. Class#method( types )?
> The mlvm workspace already contains method handle literals :)
The back-end support (hotspot, jdk) for this will be pushed RSN into a real JDK7 build. But there's no javac support, other than as a prototype in the mlvm patch repo. This is because 292 is mostly about bytecodes supporting languages, not languages per se. The small amount of support in javac for 292 is a low-level punch-through to allow assembly-level programming. First class support for MHs at the language level would require a type system, syntaxes, binary compatibility rules, and more: This is the sort of thing the lambda people have to explore first.
>> 4. Assuming 3 above; are there plans for a binding literal, e.g.
>> MethodHandle addA = String#concat( String, "A" )?
> As far as I know, No.
> I don't think it worth the introduction of a new syntax
> MethodHandle addA = insertArguments(String#concat( String, String ), 1, "A");
The prototype in mlvm supports the very special (but common) case of receiver binding: String#concat(String) vs. "foo"#concat(String). They are MHs of arity 1 and 2, respectively. But the lambda project will drive creation of such things, not 292.
> Morever, your proposed syntax has a bad property.
> It allow type and expression to occur at the same place.
>> I am sure these items have been already discussed in the expert group,
>> just wondering what the latest thinking is.
The 292 expert group has enough to worry about without also getting into language design wars. Just keeping up with lambda-dev is probably a full-time job.
More information about the mlvm-dev