DSL for handle binding

Charles Oliver Nutter headius at headius.com
Mon Mar 21 01:00:48 PDT 2011


I have pushed what I have so far to http://github.com/headius/invokebinder

There are tests for everything except "cast" so far, but I have not
added all handle transforms. I'd love to have contributions, and will
happily add anyone that wants to contribute :)

Note: I could not figure out how to get Maven to pass the appropriate
invokedynamic -XX parameters to the JVM. If someone knows how to do
that, please show me.

- Charlie

On Mon, Mar 21, 2011 at 2:10 AM, Howard Lovatt <howard.lovatt at gmail.com> wrote:
> Hi Charles,
>
> Yes it is interesting to me, looks much easier to use and also nice
> that you can chain calls because they are instance methods rather than
> static functions.
>
> I will give it a try once you have a version to download.
>
>  -- Howard.
>
> On 21 March 2011 17:21, Charles Oliver Nutter <headius at headius.com> wrote:
>> I'm working on a DSL for binding method handles *forward* rather than
>> backward. It's not much logic, really, but for me it's much easier to
>> reason about incoming arguments being transformed toward an eventual
>> target, rather than a target being transformed backward toward
>> incoming arguments. The API lets you bind like this:
>>
>> MethodHandle mh = Binder
>>    .from(String.class, String.class, String.class) // (String, String)String
>>    .drop(1, String.class) // (String)String
>>    .insert(0, 'hello') // (String, String)String
>>    .cast(String.class, CharSequence.class, Object.class) //
>> (CharSequence, Object)String
>>    .invoke(someTargetHandle);
>>
>> Is this interesting to others on the list? I will push my work to
>> github sooner rather than later if so. I plan to use this in JRuby to
>> make the MH binding code easier to read.
>>
>> - Charlie
>> _______________________________________________
>> mlvm-dev mailing list
>> mlvm-dev at openjdk.java.net
>> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
>>
>
>
>
> --
>   -- Howard.
>


More information about the mlvm-dev mailing list