You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2020/08/10 15:52:19 UTC

GraalVM JavaScript Again

Hi

right now master sets polyglot.js.allowAllAccess to true when it detects
the script engine is a GraalVM engine. This is necessary if the script
wants to use any of the Ant objects.

Jaikiran suggests to enable full Nashorn compatibility mode, which I
tend to agree with. Unfortunately you cannot do that via the
ScriptEngine API, only via a system property or by creating the
GraalJSScriptEngine directly - see
https://github.com/graalvm/graaljs/blob/master/docs/user/ScriptEngine.md

I see the following options:

(1) leave things as they are right now and tell people to set system
    properties before starting Ant if they need more.

(2) Set the "Nashorn compatibility mode" via the system property based
    on another magic property - and enable it by default

(3) add graaljs as an alternative javax as script engine and add new
    magic properties to control it.

(4) find all the places that might create script engines (script and
    scriptdef tasks as well as the script filter, at least) and add
    explicit options.

Personally I'd prefer one of the first two options and would like option
3 the least.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: GraalVM JavaScript Again

Posted by Gintautas Grigelionis <g....@gmail.com>.
On Mon, 10 Aug 2020 at 17:52, Stefan Bodewig <bo...@apache.org> wrote:

> Hi
>
> right now master sets polyglot.js.allowAllAccess to true when it detects
> the script engine is a GraalVM engine. This is necessary if the script
> wants to use any of the Ant objects.
>
> Jaikiran suggests to enable full Nashorn compatibility mode, which I
> tend to agree with. Unfortunately you cannot do that via the
> ScriptEngine API, only via a system property or by creating the
> GraalJSScriptEngine directly - see
> https://github.com/graalvm/graaljs/blob/master/docs/user/ScriptEngine.md
>
> I see the following options:
>
> (1) leave things as they are right now and tell people to set system
>     properties before starting Ant if they need more.
>
> (2) Set the "Nashorn compatibility mode" via the system property based
>     on another magic property - and enable it by default
>
> (3) add graaljs as an alternative javax as script engine and add new
>     magic properties to control it.
>
> (4) find all the places that might create script engines (script and
>     scriptdef tasks as well as the script filter, at least) and add
>     explicit options.
>
> Personally I'd prefer one of the first two options and would like option
> 3 the least.
>
> Stefan
>

Option 2

Gintas