Re: the ScriptingMojo

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Kartik Ohri <kartikohri13(at)gmail(dot)com>
Cc: pljava-dev(at)lists(dot)postgresql(dot)org
Subject: Re: the ScriptingMojo
Date: 2020-08-22 19:33:13
Message-ID: 5F4172F9.4060608@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On 08/22/20 06:15, Kartik Ohri wrote:
> Hi!
> I am working adding these changes but I am particularly stuck at this one.
> It seems that Nashorn and Graal do not support SAM inside SAM or I am doing
> this the wrong way. Please see https://www.ideone.com/cQVGuB and
> https://www.ideone.com/1x7Ah7. The former one fails at runtime but the
> latter completes execution. (Here I have done a Consumer<Function, ?>
> whereas Function<Consumer, ?> will be required for our use case, but both
> fail at runtime anyways). This is the commit (
> https://github.com/amCap1712/pljava/commit/136a8e879951432ec47faeb74e2a86e848481e67)
> with changes that fails. I have been able to work around the issue using
> the approach here
> https://github.com/amCap1712/pljava/commit/d5977c5cf386758fb2d9e56524b05f9549cefe31

Just getting a look at this now. In the (failing) 136a commit, it appears
to me that nashorn fails but graal is happy. Is that what you saw?

Graal fails at a different spot, on the Files.walk().parallel()...
invocation in the script, but that's clearly a different issue;
neither script engine wants to be shared across threads. A sequential
walk is adequate here; this is just a build process that runs once,
so shaving milliseconds isn't essential.

Ok, I removed the parallel() and now graal also complains about the SAM
cast. This puzzles me because I thought both engines were intended to
support that, so I'll keep playing with it a bit.

Regards,
-Chap

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Chapman Flack 2020-08-22 20:13:28 Re: the ScriptingMojo
Previous Message Kartik Ohri 2020-08-22 19:12:04 Re: the ScriptingMojo