From cushon at google.com Fri Aug 4 23:23:56 2017 From: cushon at google.com (Liam Miller-Cushon) Date: Fri, 4 Aug 2017 16:23:56 -0700 Subject: plans to support ZipFile/JarFile? Message-ID: Hello, I have been experimenting with using native-image on my application, and the initial benchmark results are encouraging. The only class I encountered that is not supported is java.util.zip.ZipFile. There was some previous discussion of that here: http://mail.openjdk.java.net/pipermail/graal-dev/2017-February/004859.html. Have there been any updates on ZipFile support since that thread? Thanks, From jaroslav.tulach at oracle.com Mon Aug 7 05:50:27 2017 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Mon, 07 Aug 2017 07:50:27 +0200 Subject: plans to support ZipFile/JarFile? In-Reply-To: References: Message-ID: <1830808.WLbJbhsg6b@pracovni> On p?tek 4. srpna 2017 16:23:56 CEST Liam Miller-Cushon wrote: > Hello, > > I have been experimenting with using native-image on my application, and > the initial benchmark results are encouraging. > > The only class I encountered that is not supported is java.util.zip.ZipFile. > There was some previous discussion of that here: > http://mail.openjdk.java.net/pipermail/graal-dev/2017-February/004859.html. > Have there been any updates on ZipFile support since that thread? Hello Liam, I've been solving similar issue as well and at the end I decided to use FastJar code: https://github.com/jtulach/bck2brwsr/commit/ d20ad8a4e4419273000d3b20dce04612c8e494fd - it is not generic ZIP implementation, but it works for files generated by Java's jar command. -jt From eregontp at gmail.com Mon Aug 7 09:35:34 2017 From: eregontp at gmail.com (Benoit Daloze) Date: Mon, 7 Aug 2017 11:35:34 +0200 Subject: plans to support ZipFile/JarFile? In-Reply-To: References: Message-ID: Note that ZipInputStream/ZipOutputStream seem to work fine with native-image, which might be enough for your needs. On Sat, Aug 5, 2017 at 1:23 AM, Liam Miller-Cushon wrote: > Hello, > > I have been experimenting with using native-image on my application, and > the initial benchmark results are encouraging. > > The only class I encountered that is not supported is > java.util.zip.ZipFile. > There was some previous discussion of that here: > http://mail.openjdk.java.net/pipermail/graal-dev/2017-February/004859.html > . > Have there been any updates on ZipFile support since that thread? > > Thanks, > From jerven.bolleman at sib.swiss Mon Aug 7 10:49:01 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Mon, 7 Aug 2017 12:49:01 +0200 Subject: Graal embed documentation not in place Message-ID: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> Dear Graal devs, Really love the work you are doing. I am just looking for some documentation. In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md file a location is mentioned where one should find graal embedding documentation. http://www.graalvm.org/docs/embed/ However, this does not resolve at this time. Otherwise, the example in that directory was exactly what I was looking for! I did want to know if it is already possible to run graal.js on a JDK9-EA? Without graal if need be? for example by copying the trufflejs.jar and truffle.jar to a JDK9 classpath? Regards, Jerven -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From doug.simon at oracle.com Mon Aug 7 12:39:49 2017 From: doug.simon at oracle.com (Doug Simon) Date: Mon, 7 Aug 2017 14:39:49 +0200 Subject: Graal embed documentation not in place In-Reply-To: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> Message-ID: <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> We are currently working on extensive documentation for GraalVM but it's not yet ready for release. You can find a draft of the embedding page at https://www.dropbox.com/s/ia4yoe2jh6viyzq/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 Keep in mind that it's only a draft and may contain errors. -Doug > On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman wrote: > > Dear Graal devs, > > Really love the work you are doing. I am just looking for some documentation. > > In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md > file a location is mentioned where one should find graal embedding documentation. > > http://www.graalvm.org/docs/embed/ > > However, this does not resolve at this time. > > Otherwise, the example in that directory was exactly what I was looking for! > > I did want to know if it is already possible to run graal.js on a JDK9-EA? Without graal if need be? for example by copying the trufflejs.jar and truffle.jar to a JDK9 classpath? > > Regards, > Jerven > -- > ------------------------------------------------------------------- > Jerven Bolleman Jerven.Bolleman at sib.swiss > SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 > CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 > 1211 Geneve 4, > Switzerland www.sib.swiss - www.uniprot.org > Follow us at https://twitter.com/#!/uniprot > ------------------------------------------------------------------- From doug.simon at oracle.com Mon Aug 7 12:59:59 2017 From: doug.simon at oracle.com (Doug Simon) Date: Mon, 7 Aug 2017 14:59:59 +0200 Subject: Graal embed documentation not in place In-Reply-To: <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> Message-ID: Updated link: https://www.dropbox.com/s/aqy69srqki4g7hw/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 -Doug > On 7 Aug 2017, at 14:39, Doug Simon wrote: > > We are currently working on extensive documentation for GraalVM but it's not yet ready for release. > > You can find a draft of the embedding page at https://www.dropbox.com/s/ia4yoe2jh6viyzq/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 > > Keep in mind that it's only a draft and may contain errors. > > -Doug > >> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman wrote: >> >> Dear Graal devs, >> >> Really love the work you are doing. I am just looking for some documentation. >> >> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >> file a location is mentioned where one should find graal embedding documentation. >> >> http://www.graalvm.org/docs/embed/ >> >> However, this does not resolve at this time. >> >> Otherwise, the example in that directory was exactly what I was looking for! >> >> I did want to know if it is already possible to run graal.js on a JDK9-EA? Without graal if need be? for example by copying the trufflejs.jar and truffle.jar to a JDK9 classpath? >> >> Regards, >> Jerven >> -- >> ------------------------------------------------------------------- >> Jerven Bolleman Jerven.Bolleman at sib.swiss >> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >> 1211 Geneve 4, >> Switzerland www.sib.swiss - www.uniprot.org >> Follow us at https://twitter.com/#!/uniprot >> ------------------------------------------------------------------- > From christian.wimmer at oracle.com Tue Aug 8 02:51:20 2017 From: christian.wimmer at oracle.com (Christian Wimmer) Date: Mon, 7 Aug 2017 19:51:20 -0700 Subject: plans to support ZipFile/JarFile? In-Reply-To: References: Message-ID: <8fe7ee88-c58e-7f15-9f62-68909d874fac@oracle.com> Hi Liam, There is no change yet regarding ZipFile. The code for it in the JDK is a real mess (lots of C code). Now that we have JNI support in Substrate VM, we will probably try to use the existing JDK C code. -Christian On 8/4/2017 4:23 PM, Liam Miller-Cushon wrote: > Hello, > > I have been experimenting with using native-image on my application, and > the initial benchmark results are encouraging. > > The only class I encountered that is not supported is java.util.zip.ZipFile. > There was some previous discussion of that here: > http://mail.openjdk.java.net/pipermail/graal-dev/2017-February/004859.html. > Have there been any updates on ZipFile support since that thread? > > Thanks, > From jerven.bolleman at sib.swiss Tue Aug 8 09:14:19 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Tue, 8 Aug 2017 11:14:19 +0200 Subject: Question about graal.js import resolution in polygot context [was Re: Graal embed documentation not in place] In-Reply-To: <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> Message-ID: <3dfc5620-507a-621d-b0e8-4c40fa84bbad@sib.swiss> Dear Graal devs, I am really pleased with how smooth this experiment is going. Those snippets already helped a lot. My first question is how are js imports resolved/supported inside a Graal.js/polyglot instance. e.g. Context context = context.create("js"); context.eval("js", "import {x} from 'y.js'"); currently it fails with. SyntaxError: Unnamed:474:0 Expected an operand but found import import x from y.js;out.print(render(taxon)); Suggests it is not (yet) supported. This is not something that will block me from further experimentation but working imports would be nice to have. Regards, Jerven On 08/07/2017 02:39 PM, Doug Simon wrote: > We are currently working on extensive documentation for GraalVM but it's not yet ready for release. > > You can find a draft of the embedding page at https://www.dropbox.com/s/ia4yoe2jh6viyzq/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 > > Keep in mind that it's only a draft and may contain errors. > > -Doug > >> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman wrote: >> >> Dear Graal devs, >> >> Really love the work you are doing. I am just looking for some documentation. >> >> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >> file a location is mentioned where one should find graal embedding documentation. >> >> http://www.graalvm.org/docs/embed/ >> >> However, this does not resolve at this time. >> >> Otherwise, the example in that directory was exactly what I was looking for! >> >> I did want to know if it is already possible to run graal.js on a JDK9-EA? Without graal if need be? for example by copying the trufflejs.jar and truffle.jar to a JDK9 classpath? >> >> Regards, >> Jerven >> -- >> ------------------------------------------------------------------- >> Jerven Bolleman Jerven.Bolleman at sib.swiss >> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >> 1211 Geneve 4, >> Switzerland www.sib.swiss - www.uniprot.org >> Follow us at https://twitter.com/#!/uniprot >> ------------------------------------------------------------------- > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From jerven.bolleman at sib.swiss Tue Aug 8 09:54:17 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Tue, 8 Aug 2017 11:54:17 +0200 Subject: how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place] In-Reply-To: <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> Message-ID: Hi All, Next question, How can I import a java.lang.Long into the js space inside the context. I am now working around it by passing it in as a parameter e.g. Value function = context.eval("js", "function(x,out){out.print(x)}"); function.execute(out, 1000_000_000_000L); Works However, context.exportSymbol("x",1000_000_000_000L); context.exportSymbol("out", response.getOutoutStream()); Value function = context.eval("js", "x=Interop.import('x');out=Interop.import('out);out.print(x)"); Does not with the following exception. java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject Regards, Jerven On 08/07/2017 02:39 PM, Doug Simon wrote: > We are currently working on extensive documentation for GraalVM but it's not yet ready for release. > > You can find a draft of the embedding page at https://www.dropbox.com/s/ia4yoe2jh6viyzq/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 > > Keep in mind that it's only a draft and may contain errors. > > -Doug > >> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman wrote: >> >> Dear Graal devs, >> >> Really love the work you are doing. I am just looking for some documentation. >> >> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >> file a location is mentioned where one should find graal embedding documentation. >> >> http://www.graalvm.org/docs/embed/ >> >> However, this does not resolve at this time. >> >> Otherwise, the example in that directory was exactly what I was looking for! >> >> I did want to know if it is already possible to run graal.js on a JDK9-EA? Without graal if need be? for example by copying the trufflejs.jar and truffle.jar to a JDK9 classpath? >> >> Regards, >> Jerven >> -- >> ------------------------------------------------------------------- >> Jerven Bolleman Jerven.Bolleman at sib.swiss >> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >> 1211 Geneve 4, >> Switzerland www.sib.swiss - www.uniprot.org >> Follow us at https://twitter.com/#!/uniprot >> ------------------------------------------------------------------- > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From jaroslav.tulach at oracle.com Tue Aug 8 12:34:59 2017 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Tue, 08 Aug 2017 14:34:59 +0200 Subject: how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place] In-Reply-To: References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> Message-ID: <5670748.XQEs232vnM@pracovni> On ?ter? 8. srpna 2017 11:54:17 CEST Jerven Tjalling Bolleman wrote: > Hi All, > > Next question, How can I import a java.lang.Long into the js space > inside the context. I am now working around it by passing it in as a > parameter e.g. > > Value function = context.eval("js", "function(x,out){out.print(x)}"); > function.execute(out, 1000_000_000_000L); > > Works > > However, > > context.exportSymbol("x",1000_000_000_000L); > context.exportSymbol("out", response.getOutoutStream()); > Value function = context.eval("js", > "x=Interop.import('x');out=Interop.import('out);out.print(x)"); > > Does not with the following exception. > > java.lang.Long cannot be cast to > com.oracle.truffle.api.interop.TruffleObject What's the stacktrace? -jt PS: What version are you using? From daniele.bonetta at oracle.com Tue Aug 8 12:53:14 2017 From: daniele.bonetta at oracle.com (Daniele Bonetta) Date: Tue, 8 Aug 2017 14:53:14 +0200 Subject: how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place] In-Reply-To: References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> Message-ID: <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> Hi Jerven, your code is correct, but does not work due to a bug in the Graal.js interop support. We already have a fix for that bug, and the fix will be part of the next monthly Graal VM release (v0.27). Thanks for your bug report! Regards, Daniele On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: > Hi All, > > Next question, How can I import a java.lang.Long into the js space > inside the context. I am now working around it by passing it in as a > parameter e.g. > > Value function = context.eval("js", "function(x,out){out.print(x)}"); > function.execute(out, 1000_000_000_000L); > > Works > > However, > > context.exportSymbol("x",1000_000_000_000L); > context.exportSymbol("out", response.getOutoutStream()); > Value function = context.eval("js", > "x=Interop.import('x');out=Interop.import('out);out.print(x)"); > > Does not with the following exception. > > java.lang.Long cannot be cast to > com.oracle.truffle.api.interop.TruffleObject > > Regards, > Jerven > > > > On 08/07/2017 02:39 PM, Doug Simon wrote: >> We are currently working on extensive documentation for GraalVM but >> it's not yet ready for release. >> >> You can find a draft of the embedding page at >> https://www.dropbox.com/s/ia4yoe2jh6viyzq/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 >> >> Keep in mind that it's only a draft and may contain errors. >> >> -Doug >> >>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>> wrote: >>> >>> Dear Graal devs, >>> >>> Really love the work you are doing. I am just looking for some >>> documentation. >>> >>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>> file a location is mentioned where one should find graal embedding >>> documentation. >>> >>> http://www.graalvm.org/docs/embed/ >>> >>> However, this does not resolve at this time. >>> >>> Otherwise, the example in that directory was exactly what I was >>> looking for! >>> >>> I did want to know if it is already possible to run graal.js on a >>> JDK9-EA? Without graal if need be? for example by copying the >>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>> >>> Regards, >>> Jerven >>> -- >>> ------------------------------------------------------------------- >>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>> 1211 Geneve 4, >>> Switzerland www.sib.swiss - www.uniprot.org >>> Follow us at https://twitter.com/#!/uniprot >>> ------------------------------------------------------------------- >> > From andreas.woess at oracle.com Tue Aug 8 13:21:39 2017 From: andreas.woess at oracle.com (Andreas Woess) Date: Tue, 8 Aug 2017 15:21:39 +0200 Subject: Question about graal.js import resolution in polygot context [was Re: Graal embed documentation not in place] In-Reply-To: <3dfc5620-507a-621d-b0e8-4c40fa84bbad@sib.swiss> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <3dfc5620-507a-621d-b0e8-4c40fa84bbad@sib.swiss> Message-ID: <96e48252-f2f4-63a4-1cd4-5efe8d89280f@oracle.com> Hi Jerven, thanks for your interest in Graal.js/GraalVM and giving it a try. We appreciate your feedback. Regarding your first question, our support for ES modules is still experimental; partly because the details of how modules are to be loaded aren't specified/standardized yet. A particular problem is that we need to know if a source ought to be parsed as Module or Script. Currently, we have a hack in place that if the name of the Source starts with "module:" it is treated as a module; it also only works with file-based sources right now (as the file path is used to resolve imported modules). This will certainly improve in future releases. So, something like this may work: > Context context = Context.create("js"); > context.eval(Source.newBuilder("js", new > File("x.js")).name("module:x.js").content("import {x} from > 'y.js'").build()); - andreas On 08/08/2017 11:14, Jerven Tjalling Bolleman wrote: > Dear Graal devs, > > I am really pleased with how smooth this experiment is going. Those > snippets already helped a lot. > > My first question is how are js imports resolved/supported inside a > Graal.js/polyglot instance. > > e.g. > > Context context = context.create("js"); > context.eval("js", "import {x} from 'y.js'"); > > currently it fails with. > > SyntaxError: Unnamed:474:0 Expected an operand but found import > import x from y.js;out.print(render(taxon)); > > Suggests it is not (yet) supported. > > This is not something that will block me from further experimentation > but working imports would be nice to have. > > Regards, > Jerven > From jerven.bolleman at sib.swiss Tue Aug 8 13:21:45 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Tue, 8 Aug 2017 15:21:45 +0200 Subject: how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place] In-Reply-To: <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> Message-ID: <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> Hi Daniele, All, Thanks, for the fast reply. Does anyone mind if I keep sending e-mails in this form to the graal-dev list or would you prefer I send these Graal.js java interop ones too a different list? I already have a few more ;) Regards, Jerven On 08/08/2017 02:53 PM, Daniele Bonetta wrote: > Hi Jerven, > > your code is correct, but does not work due to a bug in the Graal.js > interop support. > > We already have a fix for that bug, and the fix will be part of the next > monthly Graal VM release (v0.27). > > > Thanks for your bug report! > > Regards, > > Daniele > > > > On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: >> Hi All, >> >> Next question, How can I import a java.lang.Long into the js space >> inside the context. I am now working around it by passing it in as a >> parameter e.g. >> >> Value function = context.eval("js", "function(x,out){out.print(x)}"); >> function.execute(out, 1000_000_000_000L); >> >> Works >> >> However, >> >> context.exportSymbol("x",1000_000_000_000L); >> context.exportSymbol("out", response.getOutoutStream()); >> Value function = context.eval("js", >> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >> >> Does not with the following exception. >> >> java.lang.Long cannot be cast to >> com.oracle.truffle.api.interop.TruffleObject >> >> Regards, >> Jerven >> >> >> >> On 08/07/2017 02:39 PM, Doug Simon wrote: >>> We are currently working on extensive documentation for GraalVM but >>> it's not yet ready for release. >>> >>> You can find a draft of the embedding page at >>> https://www.dropbox.com/s/ia4yoe2jh6viyzq/Embed%20Languages%20with%20the%20Graal%20Polyglot%20SDK.pdf?dl=0 >>> >>> >>> Keep in mind that it's only a draft and may contain errors. >>> >>> -Doug >>> >>>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>>> wrote: >>>> >>>> Dear Graal devs, >>>> >>>> Really love the work you are doing. I am just looking for some >>>> documentation. >>>> >>>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>>> file a location is mentioned where one should find graal embedding >>>> documentation. >>>> >>>> http://www.graalvm.org/docs/embed/ >>>> >>>> However, this does not resolve at this time. >>>> >>>> Otherwise, the example in that directory was exactly what I was >>>> looking for! >>>> >>>> I did want to know if it is already possible to run graal.js on a >>>> JDK9-EA? Without graal if need be? for example by copying the >>>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>>> >>>> Regards, >>>> Jerven >>>> -- >>>> ------------------------------------------------------------------- >>>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>>> 1211 Geneve 4, >>>> Switzerland www.sib.swiss - www.uniprot.org >>>> Follow us at https://twitter.com/#!/uniprot >>>> ------------------------------------------------------------------- >>> >> > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From jerven.bolleman at sib.swiss Tue Aug 8 13:48:23 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Tue, 8 Aug 2017 15:48:23 +0200 Subject: how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place] In-Reply-To: <5670748.XQEs232vnM@pracovni> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <5670748.XQEs232vnM@pracovni> Message-ID: <38f5c21f-1ef7-f64d-e832-21153c6964fb@sib.swiss> I am using 0.26 from OTN and Daniele writes it is a known bug fixed in 0.27 (for next public release) On 08/08/2017 02:34 PM, Jaroslav Tulach wrote: > On ?ter? 8. srpna 2017 11:54:17 CEST Jerven Tjalling Bolleman wrote: >> Hi All, >> >> Next question, How can I import a java.lang.Long into the js space >> inside the context. I am now working around it by passing it in as a >> parameter e.g. >> >> Value function = context.eval("js", "function(x,out){out.print(x)}"); >> function.execute(out, 1000_000_000_000L); >> >> Works >> >> However, >> >> context.exportSymbol("x",1000_000_000_000L); >> context.exportSymbol("out", response.getOutoutStream()); >> Value function = context.eval("js", >> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >> >> Does not with the following exception. >> >> java.lang.Long cannot be cast to >> com.oracle.truffle.api.interop.TruffleObject > > What's the stacktrace? > -jt > > PS: What version are you using? > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From daniele.bonetta at oracle.com Tue Aug 8 14:28:38 2017 From: daniele.bonetta at oracle.com (Daniele Bonetta) Date: Tue, 8 Aug 2017 16:28:38 +0200 Subject: how to import long from java into polyglot => java.lang.Long cannot be cast to com.oracle.truffle.api.interop.TruffleObject [was Re: Graal embed documentation not in place] In-Reply-To: <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> Message-ID: <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> Hi Jerven, there is no Graal.js-only list at the moment, so feel free to report any issue on this list :) Regards, Daniele On 08.08.2017 15:21, Jerven Tjalling Bolleman wrote: > Hi Daniele, All, > > Thanks, for the fast reply. Does anyone mind if I keep sending e-mails > in this form to the graal-dev list or would you prefer I send these > Graal.js java interop ones too a different list? > > I already have a few more ;) > > Regards, > Jerven > > On 08/08/2017 02:53 PM, Daniele Bonetta wrote: >> Hi Jerven, >> >> your code is correct, but does not work due to a bug in the Graal.js >> interop support. >> >> We already have a fix for that bug, and the fix will be part of the >> next monthly Graal VM release (v0.27). >> >> >> Thanks for your bug report! >> >> Regards, >> >> Daniele >> >> >> >> On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: >>> Hi All, >>> >>> Next question, How can I import a java.lang.Long into the js space >>> inside the context. I am now working around it by passing it in as a >>> parameter e.g. >>> >>> Value function = context.eval("js", "function(x,out){out.print(x)}"); >>> function.execute(out, 1000_000_000_000L); >>> >>> Works >>> >>> However, >>> >>> context.exportSymbol("x",1000_000_000_000L); >>> context.exportSymbol("out", response.getOutoutStream()); >>> Value function = context.eval("js", >>> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >>> >>> Does not with the following exception. >>> >>> java.lang.Long cannot be cast to >>> com.oracle.truffle.api.interop.TruffleObject >>> >>> Regards, >>> Jerven >>> >>> >>> >>> On 08/07/2017 02:39 PM, Doug Simon wrote: >>>> We are currently working on extensive documentation for GraalVM but >>>> it's not yet ready for release. >>>> >>>> You can find a draft of the embedding page at >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_ia4yoe2jh6viyzq_Embed-2520Languages-2520with-2520the-2520Graal-2520Polyglot-2520SDK.pdf-3Fdl-3D0&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=Cv0eEOI0tBRk2cYh61HPe4A00Xn4uUVm32MQgXGQSro&e= >>>> >>>> >>>> Keep in mind that it's only a draft and may contain errors. >>>> >>>> -Doug >>>> >>>>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>>>> wrote: >>>>> >>>>> Dear Graal devs, >>>>> >>>>> Really love the work you are doing. I am just looking for some >>>>> documentation. >>>>> >>>>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>>>> file a location is mentioned where one should find graal embedding >>>>> documentation. >>>>> >>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.graalvm.org_docs_embed_&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=X_S7O7VP-odaX11BVYCcKzjL8pLneZMoXl98Xzp-VmQ&e= >>>>> >>>>> However, this does not resolve at this time. >>>>> >>>>> Otherwise, the example in that directory was exactly what I was >>>>> looking for! >>>>> >>>>> I did want to know if it is already possible to run graal.js on a >>>>> JDK9-EA? Without graal if need be? for example by copying the >>>>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>>>> >>>>> Regards, >>>>> Jerven >>>>> -- >>>>> ------------------------------------------------------------------- >>>>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>>>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>>>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>>>> 1211 Geneve 4, >>>>> Switzerland www.sib.swiss - www.uniprot.org >>>>> Follow us at >>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_-23-21_uniprot&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=0kjMaBI9UJj3x8hoD0ePJJLhOMChklmfrE9b9kH0AKk&e= >>>>> ------------------------------------------------------------------- >>>> >>> >> > From jerven.bolleman at sib.swiss Tue Aug 8 14:35:37 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Tue, 8 Aug 2017 16:35:37 +0200 Subject: Feature request: Javacript Arrays.from() should accept Java Iterable or JS map on java collections should map to Iterable.stream().map() In-Reply-To: <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> Message-ID: <7323956b-26ee-1612-c42b-0460dcac2dae@sib.swiss> Hi All, This is the biggest annoyance up to now. Given a java collection object one can't use JS map methods without doing some work around. For now I have an utility method but I think ergonomically it would be nice to be able to do this without further work for the users of graal.js. Examples of what I would like -> given that "list" is a java.util.List, "joining" is bound to the Function Collectors.joining() and we are in Javascript using template literals. The following works already. `
    ${list.stream().map(item => `${item.toString()}.collect(joining)
` But it would be really nice if we could have the following "just" work. `
    ${list.map(item => `${item.toString()}.join('')
` i.e. the java collection interface is decorated with a JS map method. if that won't be possible then matching the JS @@iterable protocol to the Java iterable interface would be nice because then we could at least do. `
    ${Array.from(list).map(item => `${item.toString()}.join('')
` Regards, Jerven On 08/08/2017 04:28 PM, Daniele Bonetta wrote: > Hi Jerven, > > there is no Graal.js-only list at the moment, so feel free to report any > issue on this list :) > > Regards, > > Daniele > > > > On 08.08.2017 15:21, Jerven Tjalling Bolleman wrote: >> Hi Daniele, All, >> >> Thanks, for the fast reply. Does anyone mind if I keep sending e-mails >> in this form to the graal-dev list or would you prefer I send these >> Graal.js java interop ones too a different list? >> >> I already have a few more ;) >> >> Regards, >> Jerven >> >> On 08/08/2017 02:53 PM, Daniele Bonetta wrote: >>> Hi Jerven, >>> >>> your code is correct, but does not work due to a bug in the Graal.js >>> interop support. >>> >>> We already have a fix for that bug, and the fix will be part of the >>> next monthly Graal VM release (v0.27). >>> >>> >>> Thanks for your bug report! >>> >>> Regards, >>> >>> Daniele >>> >>> >>> >>> On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: >>>> Hi All, >>>> >>>> Next question, How can I import a java.lang.Long into the js space >>>> inside the context. I am now working around it by passing it in as a >>>> parameter e.g. >>>> >>>> Value function = context.eval("js", "function(x,out){out.print(x)}"); >>>> function.execute(out, 1000_000_000_000L); >>>> >>>> Works >>>> >>>> However, >>>> >>>> context.exportSymbol("x",1000_000_000_000L); >>>> context.exportSymbol("out", response.getOutoutStream()); >>>> Value function = context.eval("js", >>>> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >>>> >>>> Does not with the following exception. >>>> >>>> java.lang.Long cannot be cast to >>>> com.oracle.truffle.api.interop.TruffleObject >>>> >>>> Regards, >>>> Jerven >>>> >>>> >>>> >>>> On 08/07/2017 02:39 PM, Doug Simon wrote: >>>>> We are currently working on extensive documentation for GraalVM but >>>>> it's not yet ready for release. >>>>> >>>>> You can find a draft of the embedding page at >>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_ia4yoe2jh6viyzq_Embed-2520Languages-2520with-2520the-2520Graal-2520Polyglot-2520SDK.pdf-3Fdl-3D0&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=Cv0eEOI0tBRk2cYh61HPe4A00Xn4uUVm32MQgXGQSro&e= >>>>> >>>>> >>>>> Keep in mind that it's only a draft and may contain errors. >>>>> >>>>> -Doug >>>>> >>>>>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>>>>> wrote: >>>>>> >>>>>> Dear Graal devs, >>>>>> >>>>>> Really love the work you are doing. I am just looking for some >>>>>> documentation. >>>>>> >>>>>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>>>>> file a location is mentioned where one should find graal embedding >>>>>> documentation. >>>>>> >>>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.graalvm.org_docs_embed_&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=X_S7O7VP-odaX11BVYCcKzjL8pLneZMoXl98Xzp-VmQ&e= >>>>>> >>>>>> However, this does not resolve at this time. >>>>>> >>>>>> Otherwise, the example in that directory was exactly what I was >>>>>> looking for! >>>>>> >>>>>> I did want to know if it is already possible to run graal.js on a >>>>>> JDK9-EA? Without graal if need be? for example by copying the >>>>>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>>>>> >>>>>> Regards, >>>>>> Jerven >>>>>> -- >>>>>> ------------------------------------------------------------------- >>>>>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>>>>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>>>>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>>>>> 1211 Geneve 4, >>>>>> Switzerland www.sib.swiss - www.uniprot.org >>>>>> Follow us at >>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_-23-21_uniprot&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=0kjMaBI9UJj3x8hoD0ePJJLhOMChklmfrE9b9kH0AKk&e= >>>>>> ------------------------------------------------------------------- >>>>> >>>> >>> >> > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From jerven.bolleman at sib.swiss Tue Aug 8 14:47:14 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Tue, 8 Aug 2017 16:47:14 +0200 Subject: Bug: no single overload found. Probably due to generic super interface In-Reply-To: <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> Message-ID: <03cb536e-2814-14df-9d4d-ea777f78b916@sib.swiss> Hi All, I have a class hierarchy like this in Java. I am not using the real hierarchy because it are large objects which hide the details. But the following Junit should demonstrate the issue. package org.expasy.services.taxonomy.view; import static org.junit.Assert.assertEquals; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Value; import org.junit.Test; public class GraalTest { public interface Identity{ public T getId(); } public interface SomeClassOfThingWithIdentity extends Identity{ public Integer getId(); } public class ActualRealThingWithIdentity implements SomeClassOfThingWithIdentity { Integer id = 1; public Integer getId(){ return id; }; } @Test public void test(){ final Value value = Context.create("js").eval("js", "function(example){return `${example.getId().toString()}`;}"); String result = value.execute(new ActualRealThingWithIdentity()).asString(); assertEquals("1", result); } } This fails with the following stacktrace org.graalvm.polyglot.PolyglotException: java.lang.IllegalArgumentException: no single overload found (candidates: [Method[public java.lang.Integer org.expasy.services.taxonomy.view.GraalTest$ActualRealThingWithIdentity.getId()], Method[public java.lang.Object org.expasy.services.taxonomy.view.GraalTest$ActualRealThingWithIdentity.getId()]], arguments: []) at com.oracle.truffle.api.interop.java.ExecuteMethodNode.ambiguousOverloadsException(ExecuteMethodNode.java:441) at com.oracle.truffle.api.interop.java.ExecuteMethodNode.selectOverload(ExecuteMethodNode.java:270) at com.oracle.truffle.api.interop.java.ExecuteMethodNodeGen.executeAndSpecialize(ExecuteMethodNodeGen.java:179) at com.oracle.truffle.api.interop.java.ExecuteMethodNodeGen.execute(ExecuteMethodNodeGen.java:75) at com.oracle.truffle.api.interop.java.JavaObjectMessageResolution$InvokeNode.access(JavaObjectMessageResolution.java:94) at com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeign$InvokeSubNode.accessWithTarget(JavaObjectMessageResolutionForeign.java:229) at com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeignFactory$InvokeSubNodeGen.executeAndSpecialize(JavaObjectMessageResolutionForeignFactory.java:267) at com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeignFactory$InvokeSubNodeGen.executeWithTarget(JavaObjectMessageResolutionForeignFactory.java:249) at com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeign$InvokeSubNode$INVOKERootNode.execute(JavaObjectMessageResolutionForeign.java:247) at :program$0(Unnamed:1:28-42) at org.graalvm.polyglot.Value.execute(Value.java:162) at org.expasy.services.taxonomy.view.GraalTest.test(GraalTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at .... Regards, Jerven On 08/08/2017 04:28 PM, Daniele Bonetta wrote: > Hi Jerven, > > there is no Graal.js-only list at the moment, so feel free to report any > issue on this list :) > > Regards, > > Daniele > > > > On 08.08.2017 15:21, Jerven Tjalling Bolleman wrote: >> Hi Daniele, All, >> >> Thanks, for the fast reply. Does anyone mind if I keep sending e-mails >> in this form to the graal-dev list or would you prefer I send these >> Graal.js java interop ones too a different list? >> >> I already have a few more ;) >> >> Regards, >> Jerven >> >> On 08/08/2017 02:53 PM, Daniele Bonetta wrote: >>> Hi Jerven, >>> >>> your code is correct, but does not work due to a bug in the Graal.js >>> interop support. >>> >>> We already have a fix for that bug, and the fix will be part of the >>> next monthly Graal VM release (v0.27). >>> >>> >>> Thanks for your bug report! >>> >>> Regards, >>> >>> Daniele >>> >>> >>> >>> On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: >>>> Hi All, >>>> >>>> Next question, How can I import a java.lang.Long into the js space >>>> inside the context. I am now working around it by passing it in as a >>>> parameter e.g. >>>> >>>> Value function = context.eval("js", "function(x,out){out.print(x)}"); >>>> function.execute(out, 1000_000_000_000L); >>>> >>>> Works >>>> >>>> However, >>>> >>>> context.exportSymbol("x",1000_000_000_000L); >>>> context.exportSymbol("out", response.getOutoutStream()); >>>> Value function = context.eval("js", >>>> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >>>> >>>> Does not with the following exception. >>>> >>>> java.lang.Long cannot be cast to >>>> com.oracle.truffle.api.interop.TruffleObject >>>> >>>> Regards, >>>> Jerven >>>> >>>> >>>> >>>> On 08/07/2017 02:39 PM, Doug Simon wrote: >>>>> We are currently working on extensive documentation for GraalVM but >>>>> it's not yet ready for release. >>>>> >>>>> You can find a draft of the embedding page at >>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_ia4yoe2jh6viyzq_Embed-2520Languages-2520with-2520the-2520Graal-2520Polyglot-2520SDK.pdf-3Fdl-3D0&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=Cv0eEOI0tBRk2cYh61HPe4A00Xn4uUVm32MQgXGQSro&e= >>>>> >>>>> >>>>> Keep in mind that it's only a draft and may contain errors. >>>>> >>>>> -Doug >>>>> >>>>>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>>>>> wrote: >>>>>> >>>>>> Dear Graal devs, >>>>>> >>>>>> Really love the work you are doing. I am just looking for some >>>>>> documentation. >>>>>> >>>>>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>>>>> file a location is mentioned where one should find graal embedding >>>>>> documentation. >>>>>> >>>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.graalvm.org_docs_embed_&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=X_S7O7VP-odaX11BVYCcKzjL8pLneZMoXl98Xzp-VmQ&e= >>>>>> >>>>>> However, this does not resolve at this time. >>>>>> >>>>>> Otherwise, the example in that directory was exactly what I was >>>>>> looking for! >>>>>> >>>>>> I did want to know if it is already possible to run graal.js on a >>>>>> JDK9-EA? Without graal if need be? for example by copying the >>>>>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>>>>> >>>>>> Regards, >>>>>> Jerven >>>>>> -- >>>>>> ------------------------------------------------------------------- >>>>>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>>>>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>>>>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>>>>> 1211 Geneve 4, >>>>>> Switzerland www.sib.swiss - www.uniprot.org >>>>>> Follow us at >>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_-23-21_uniprot&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=0kjMaBI9UJj3x8hoD0ePJJLhOMChklmfrE9b9kH0AKk&e= >>>>>> ------------------------------------------------------------------- >>>>> >>>> >>> >> > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From cushon at google.com Tue Aug 8 19:16:23 2017 From: cushon at google.com (Liam Miller-Cushon) Date: Tue, 8 Aug 2017 12:16:23 -0700 Subject: plans to support ZipFile/JarFile? In-Reply-To: <1830808.WLbJbhsg6b@pracovni> References: <1830808.WLbJbhsg6b@pracovni> Message-ID: On Sun, Aug 6, 2017 at 10:50 PM, Jaroslav Tulach wrote: > Hello Liam, > I've been solving similar issue as well and at the end I decided to use > FastJar code: https://github.com/jtulach/bck2brwsr/commit/ > d20ad8a4e4419273000d3b20dce04612c8e494fd - it is not generic ZIP > implementation, but it works for files generated by Java's jar command. > On Mon, Aug 7, 2017 at 2:35 AM, Benoit Daloze wrote: > Note that ZipInputStream/ZipOutputStream seem to work fine with > native-image, which might be enough for your needs. > Thanks, something similar to FastJar should be fine for now. (I'd prefer an implementation that assumes random access files and reads the central directory, instead of ZipInputStream.) From andreas.woess at oracle.com Wed Aug 9 12:51:02 2017 From: andreas.woess at oracle.com (Andreas Woess) Date: Wed, 9 Aug 2017 14:51:02 +0200 Subject: Bug: no single overload found. Probably due to generic super interface In-Reply-To: <03cb536e-2814-14df-9d4d-ea777f78b916@sib.swiss> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> <03cb536e-2814-14df-9d4d-ea777f78b916@sib.swiss> Message-ID: Hi Jerven, thanks for the bug report. I've pushed a fix for it [1]. Naturally, it will be part of the next GraalVM release (0.27). [1] https://github.com/graalvm/graal/commit/08abcb23d1d3f736f98d2dda6e04392f13912691 Regards, Andreas On 08/08/2017 16:47, Jerven Tjalling Bolleman wrote: > Hi All, > > I have a class hierarchy like this in Java. I am not using the real > hierarchy because it are large objects which hide the details. But the > following Junit should demonstrate the issue. > > package org.expasy.services.taxonomy.view; > > import static org.junit.Assert.assertEquals; > > import org.graalvm.polyglot.Context; > import org.graalvm.polyglot.Value; > import org.junit.Test; > > public class GraalTest > { > public interface Identity{ > public T getId(); > } > > public interface SomeClassOfThingWithIdentity extends > Identity{ > public Integer getId(); > } > > public class ActualRealThingWithIdentity > implements SomeClassOfThingWithIdentity { > Integer id = 1; > > public Integer getId(){ > return id; > }; > } > > @Test > public void test(){ > final Value value = Context.create("js").eval("js", > "function(example){return `${example.getId().toString()}`;}"); > String result = value.execute(new > ActualRealThingWithIdentity()).asString(); > assertEquals("1", result); > } > } > > This fails with the following stacktrace > > org.graalvm.polyglot.PolyglotException: > java.lang.IllegalArgumentException: no single overload found > (candidates: [Method[public java.lang.Integer > org.expasy.services.taxonomy.view.GraalTest$ActualRealThingWithIdentity.getId()], > Method[public java.lang.Object > org.expasy.services.taxonomy.view.GraalTest$ActualRealThingWithIdentity.getId()]], > arguments: []) > at > com.oracle.truffle.api.interop.java.ExecuteMethodNode.ambiguousOverloadsException(ExecuteMethodNode.java:441) > at > com.oracle.truffle.api.interop.java.ExecuteMethodNode.selectOverload(ExecuteMethodNode.java:270) > at > com.oracle.truffle.api.interop.java.ExecuteMethodNodeGen.executeAndSpecialize(ExecuteMethodNodeGen.java:179) > at > com.oracle.truffle.api.interop.java.ExecuteMethodNodeGen.execute(ExecuteMethodNodeGen.java:75) > at > com.oracle.truffle.api.interop.java.JavaObjectMessageResolution$InvokeNode.access(JavaObjectMessageResolution.java:94) > at > com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeign$InvokeSubNode.accessWithTarget(JavaObjectMessageResolutionForeign.java:229) > at > com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeignFactory$InvokeSubNodeGen.executeAndSpecialize(JavaObjectMessageResolutionForeignFactory.java:267) > at > com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeignFactory$InvokeSubNodeGen.executeWithTarget(JavaObjectMessageResolutionForeignFactory.java:249) > at > com.oracle.truffle.api.interop.java.JavaObjectMessageResolutionForeign$InvokeSubNode$INVOKERootNode.execute(JavaObjectMessageResolutionForeign.java:247) > at :program$0(Unnamed:1:28-42) > at org.graalvm.polyglot.Value.execute(Value.java:162) > at > org.expasy.services.taxonomy.view.GraalTest.test(GraalTest.java:31) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at .... > > > Regards, > Jerven > From andreas.woess at oracle.com Wed Aug 9 13:15:18 2017 From: andreas.woess at oracle.com (Andreas Woess) Date: Wed, 9 Aug 2017 15:15:18 +0200 Subject: Feature request: Javacript Arrays.from() should accept Java Iterable or JS map on java collections should map to Iterable.stream().map() In-Reply-To: <7323956b-26ee-1612-c42b-0460dcac2dae@sib.swiss> References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> <7323956b-26ee-1612-c42b-0460dcac2dae@sib.swiss> Message-ID: Hi Jerven, I'm not very fond of decorating Java objects with JS methods (#2), mostly for 2 reasons: (a) It'd be no longer obvious if you're calling a Java method or a JS method, and there's the (small) possibility that your code will break in the future if someone adds a Java method with the same name. (b) In a polyglot environment, you probably don't want your Java objects to have different methods depending on the language they're used in. Array.from(javaList) (#3) looks reasonable to me, and I think we can add support for that. I can't promise anything just yet; we'll have to discuss this in the team, and see if we can implement this in a consistent fashion so that e.g. you can use Java Lists in other places where a JS Iterable is expected, too. Alternatively, we can provide a Java.from built-in that does the conversion. Regards, Andreas On 08/08/2017 16:35, Jerven Tjalling Bolleman wrote: > Hi All, > > This is the biggest annoyance up to now. Given a java collection > object one can't use JS map methods without doing some work around. > For now I have an utility method but I think ergonomically it would be > nice to be able to do this without further work for the users of > graal.js. > > Examples of what I would like -> given that "list" is a > java.util.List, "joining" is bound to the Function > Collectors.joining() and we are in Javascript using template literals. > > The following works already. > > `
    > ${list.stream().map(item => `${item.toString()}.collect(joining) >
` > > But it would be really nice if we could have the following "just" work. > > `
    > ${list.map(item => `${item.toString()}.join('') >
` > > i.e. the java collection interface is decorated with a JS map method. > if that won't be possible then matching the JS @@iterable protocol to > the Java iterable interface would be nice because then we could at > least do. > > > `
    > ${Array.from(list).map(item => `${item.toString()}.join('') >
` > > Regards, > Jerven > > > On 08/08/2017 04:28 PM, Daniele Bonetta wrote: >> Hi Jerven, >> >> there is no Graal.js-only list at the moment, so feel free to report >> any issue on this list :) >> >> Regards, >> >> Daniele >> >> >> >> On 08.08.2017 15:21, Jerven Tjalling Bolleman wrote: >>> Hi Daniele, All, >>> >>> Thanks, for the fast reply. Does anyone mind if I keep sending >>> e-mails in this form to the graal-dev list or would you prefer I >>> send these Graal.js java interop ones too a different list? >>> >>> I already have a few more ;) >>> >>> Regards, >>> Jerven >>> >>> On 08/08/2017 02:53 PM, Daniele Bonetta wrote: >>>> Hi Jerven, >>>> >>>> your code is correct, but does not work due to a bug in the >>>> Graal.js interop support. >>>> >>>> We already have a fix for that bug, and the fix will be part of the >>>> next monthly Graal VM release (v0.27). >>>> >>>> >>>> Thanks for your bug report! >>>> >>>> Regards, >>>> >>>> Daniele >>>> >>>> >>>> >>>> On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: >>>>> Hi All, >>>>> >>>>> Next question, How can I import a java.lang.Long into the js space >>>>> inside the context. I am now working around it by passing it in as >>>>> a parameter e.g. >>>>> >>>>> Value function = context.eval("js", "function(x,out){out.print(x)}"); >>>>> function.execute(out, 1000_000_000_000L); >>>>> >>>>> Works >>>>> >>>>> However, >>>>> >>>>> context.exportSymbol("x",1000_000_000_000L); >>>>> context.exportSymbol("out", response.getOutoutStream()); >>>>> Value function = context.eval("js", >>>>> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >>>>> >>>>> Does not with the following exception. >>>>> >>>>> java.lang.Long cannot be cast to >>>>> com.oracle.truffle.api.interop.TruffleObject >>>>> >>>>> Regards, >>>>> Jerven >>>>> >>>>> >>>>> >>>>> On 08/07/2017 02:39 PM, Doug Simon wrote: >>>>>> We are currently working on extensive documentation for GraalVM >>>>>> but it's not yet ready for release. >>>>>> >>>>>> You can find a draft of the embedding page at >>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_ia4yoe2jh6viyzq_Embed-2520Languages-2520with-2520the-2520Graal-2520Polyglot-2520SDK.pdf-3Fdl-3D0&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=Cv0eEOI0tBRk2cYh61HPe4A00Xn4uUVm32MQgXGQSro&e= >>>>>> >>>>>> >>>>>> Keep in mind that it's only a draft and may contain errors. >>>>>> >>>>>> -Doug >>>>>> >>>>>>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>>>>>> wrote: >>>>>>> >>>>>>> Dear Graal devs, >>>>>>> >>>>>>> Really love the work you are doing. I am just looking for some >>>>>>> documentation. >>>>>>> >>>>>>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>>>>>> file a location is mentioned where one should find graal >>>>>>> embedding documentation. >>>>>>> >>>>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.graalvm.org_docs_embed_&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=X_S7O7VP-odaX11BVYCcKzjL8pLneZMoXl98Xzp-VmQ&e= >>>>>>> >>>>>>> However, this does not resolve at this time. >>>>>>> >>>>>>> Otherwise, the example in that directory was exactly what I was >>>>>>> looking for! >>>>>>> >>>>>>> I did want to know if it is already possible to run graal.js on >>>>>>> a JDK9-EA? Without graal if need be? for example by copying the >>>>>>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>>>>>> >>>>>>> Regards, >>>>>>> Jerven >>>>>>> -- >>>>>>> ------------------------------------------------------------------- >>>>>>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>>>>>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>>>>>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>>>>>> 1211 Geneve 4, >>>>>>> Switzerland www.sib.swiss - www.uniprot.org >>>>>>> Follow us at >>>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_-23-21_uniprot&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=0kjMaBI9UJj3x8hoD0ePJJLhOMChklmfrE9b9kH0AKk&e= >>>>>>> ------------------------------------------------------------------- >>>>>> >>>>> >>>> >>> >> > From jerven.bolleman at sib.swiss Wed Aug 9 13:47:17 2017 From: jerven.bolleman at sib.swiss (Jerven Tjalling Bolleman) Date: Wed, 9 Aug 2017 15:47:17 +0200 Subject: Feature request: Javacript Arrays.from() should accept Java Iterable or JS map on java collections should map to Iterable.stream().map() In-Reply-To: References: <9eb2eabc-0bf4-4d18-9940-77215a9f92cd@sib.swiss> <84D95348-07DE-4358-B8B8-5D9B7B52FAE8@oracle.com> <2c5c90c9-51c1-5469-0076-842d7f981552@oracle.com> <0ead0ad4-0690-2573-e50a-1545b0f7fb66@sib.swiss> <942bd4a0-23f7-5aa4-cead-191aa8606f38@oracle.com> <7323956b-26ee-1612-c42b-0460dcac2dae@sib.swiss> Message-ID: <6ee0964c-29a2-2537-af82-9e35469b751f@sib.swiss> Hi Andreas, Thanks for considering and I think you are right about Java objects should act like Java objects. I will depend a lot on the Java objects not being falsy in tests and that non defined methods give a type error. A build in Java.from would be fine as well. In the end its not a lot of code to translate a java collection to an JS Array so that one can use the JS map. Regards, Jerven On 08/09/2017 03:15 PM, Andreas Woess wrote: > Hi Jerven, > > I'm not very fond of decorating Java objects with JS methods (#2), > mostly for 2 reasons: > (a) It'd be no longer obvious if you're calling a Java method or a JS > method, and there's the (small) possibility that your code will break in > the future if someone adds a Java method with the same name. > (b) In a polyglot environment, you probably don't want your Java objects > to have different methods depending on the language they're used in. > > Array.from(javaList) (#3) looks reasonable to me, and I think we can add > support for that. I can't promise anything just yet; we'll have to > discuss this in the team, and see if we can implement this in a > consistent fashion so that e.g. you can use Java Lists in other places > where a JS Iterable is expected, too. Alternatively, we can provide a > Java.from built-in that does the conversion. > > Regards, > Andreas > > On 08/08/2017 16:35, Jerven Tjalling Bolleman wrote: >> Hi All, >> >> This is the biggest annoyance up to now. Given a java collection >> object one can't use JS map methods without doing some work around. >> For now I have an utility method but I think ergonomically it would be >> nice to be able to do this without further work for the users of >> graal.js. >> >> Examples of what I would like -> given that "list" is a >> java.util.List, "joining" is bound to the Function >> Collectors.joining() and we are in Javascript using template literals. >> >> The following works already. >> >> `
    >> ${list.stream().map(item => `${item.toString()}.collect(joining) >>
` >> >> But it would be really nice if we could have the following "just" work. >> >> `
    >> ${list.map(item => `${item.toString()}.join('') >>
` >> >> i.e. the java collection interface is decorated with a JS map method. >> if that won't be possible then matching the JS @@iterable protocol to >> the Java iterable interface would be nice because then we could at >> least do. >> >> >> `
    >> ${Array.from(list).map(item => `${item.toString()}.join('') >>
` >> >> Regards, >> Jerven >> >> >> On 08/08/2017 04:28 PM, Daniele Bonetta wrote: >>> Hi Jerven, >>> >>> there is no Graal.js-only list at the moment, so feel free to report >>> any issue on this list :) >>> >>> Regards, >>> >>> Daniele >>> >>> >>> >>> On 08.08.2017 15:21, Jerven Tjalling Bolleman wrote: >>>> Hi Daniele, All, >>>> >>>> Thanks, for the fast reply. Does anyone mind if I keep sending >>>> e-mails in this form to the graal-dev list or would you prefer I >>>> send these Graal.js java interop ones too a different list? >>>> >>>> I already have a few more ;) >>>> >>>> Regards, >>>> Jerven >>>> >>>> On 08/08/2017 02:53 PM, Daniele Bonetta wrote: >>>>> Hi Jerven, >>>>> >>>>> your code is correct, but does not work due to a bug in the >>>>> Graal.js interop support. >>>>> >>>>> We already have a fix for that bug, and the fix will be part of the >>>>> next monthly Graal VM release (v0.27). >>>>> >>>>> >>>>> Thanks for your bug report! >>>>> >>>>> Regards, >>>>> >>>>> Daniele >>>>> >>>>> >>>>> >>>>> On 08.08.2017 11:54, Jerven Tjalling Bolleman wrote: >>>>>> Hi All, >>>>>> >>>>>> Next question, How can I import a java.lang.Long into the js space >>>>>> inside the context. I am now working around it by passing it in as >>>>>> a parameter e.g. >>>>>> >>>>>> Value function = context.eval("js", "function(x,out){out.print(x)}"); >>>>>> function.execute(out, 1000_000_000_000L); >>>>>> >>>>>> Works >>>>>> >>>>>> However, >>>>>> >>>>>> context.exportSymbol("x",1000_000_000_000L); >>>>>> context.exportSymbol("out", response.getOutoutStream()); >>>>>> Value function = context.eval("js", >>>>>> "x=Interop.import('x');out=Interop.import('out);out.print(x)"); >>>>>> >>>>>> Does not with the following exception. >>>>>> >>>>>> java.lang.Long cannot be cast to >>>>>> com.oracle.truffle.api.interop.TruffleObject >>>>>> >>>>>> Regards, >>>>>> Jerven >>>>>> >>>>>> >>>>>> >>>>>> On 08/07/2017 02:39 PM, Doug Simon wrote: >>>>>>> We are currently working on extensive documentation for GraalVM >>>>>>> but it's not yet ready for release. >>>>>>> >>>>>>> You can find a draft of the embedding page at >>>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_ia4yoe2jh6viyzq_Embed-2520Languages-2520with-2520the-2520Graal-2520Polyglot-2520SDK.pdf-3Fdl-3D0&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=Cv0eEOI0tBRk2cYh61HPe4A00Xn4uUVm32MQgXGQSro&e= >>>>>>> >>>>>>> >>>>>>> Keep in mind that it's only a draft and may contain errors. >>>>>>> >>>>>>> -Doug >>>>>>> >>>>>>>> On 7 Aug 2017, at 12:49, Jerven Tjalling Bolleman >>>>>>>> wrote: >>>>>>>> >>>>>>>> Dear Graal devs, >>>>>>>> >>>>>>>> Really love the work you are doing. I am just looking for some >>>>>>>> documentation. >>>>>>>> >>>>>>>> In the Graal OTN 0.26 release graalvm-0.26/examples/embed/README.md >>>>>>>> file a location is mentioned where one should find graal >>>>>>>> embedding documentation. >>>>>>>> >>>>>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.graalvm.org_docs_embed_&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=X_S7O7VP-odaX11BVYCcKzjL8pLneZMoXl98Xzp-VmQ&e= >>>>>>>> >>>>>>>> However, this does not resolve at this time. >>>>>>>> >>>>>>>> Otherwise, the example in that directory was exactly what I was >>>>>>>> looking for! >>>>>>>> >>>>>>>> I did want to know if it is already possible to run graal.js on >>>>>>>> a JDK9-EA? Without graal if need be? for example by copying the >>>>>>>> trufflejs.jar and truffle.jar to a JDK9 classpath? >>>>>>>> >>>>>>>> Regards, >>>>>>>> Jerven >>>>>>>> -- >>>>>>>> ------------------------------------------------------------------- >>>>>>>> Jerven Bolleman Jerven.Bolleman at sib.swiss >>>>>>>> SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 >>>>>>>> CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 >>>>>>>> 1211 Geneve 4, >>>>>>>> Switzerland www.sib.swiss - www.uniprot.org >>>>>>>> Follow us at >>>>>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_-23-21_uniprot&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=W5Zo00VHyUAb3eyeSOfpd8vQ04i6XWgfLSLJcJECgxE&m=6PDu846uJ078h-SZRYjYKPBaGR1da2ltWJgHrzftIso&s=0kjMaBI9UJj3x8hoD0ePJJLhOMChklmfrE9b9kH0AKk&e= >>>>>>>> ------------------------------------------------------------------- >>>>>>> >>>>>> >>>>> >>>> >>> >> > -- ------------------------------------------------------------------- Jerven Bolleman Jerven.Bolleman at sib.swiss SIB Swiss Institute of Bioinformatics Tel: +41 (0)22 379 58 85 CMU, rue Michel Servet 1 Fax: +41 (0)22 379 58 58 1211 Geneve 4, Switzerland www.sib.swiss - www.uniprot.org Follow us at https://twitter.com/#!/uniprot ------------------------------------------------------------------- From cthalinger at twitter.com Thu Aug 10 08:08:04 2017 From: cthalinger at twitter.com (Christian Thalinger) Date: Thu, 10 Aug 2017 10:08:04 +0200 Subject: AlwaysInlineIntrinsics and AbstractInliningPolicy.isIntrinsic Message-ID: Currently looking at some inlining stuff and I noticed that AlwaysInlineIntrinsics in AbstractInliningPolicy.isIntrinsic doesn?t do anything since the two methods called (onlyIntrinsics and onlyForcedIntrinsics) have exactly the same implementation: protected boolean isIntrinsic(Replacements replacements, InlineInfo info) { if (AlwaysInlineIntrinsics.getValue(info.graph().getOptions())) { return onlyIntrinsics(replacements, info); } else { return onlyForcedIntrinsics(replacements, info); } } private static boolean onlyIntrinsics(Replacements replacements, InlineInfo info) { for (int i = 0; i < info.numberOfMethods(); i++) { if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { return false; } } return true; } private static boolean onlyForcedIntrinsics(Replacements replacements, InlineInfo info) { for (int i = 0; i < info.numberOfMethods(); i++) { if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { return false; } } return true; } Am I missing something? From doug.simon at oracle.com Thu Aug 10 10:11:17 2017 From: doug.simon at oracle.com (Doug Simon) Date: Thu, 10 Aug 2017 12:11:17 +0200 Subject: AlwaysInlineIntrinsics and AbstractInliningPolicy.isIntrinsic In-Reply-To: References: Message-ID: <4CA301C5-9340-414C-B6BB-F20731828231@oracle.com> > On 10 Aug 2017, at 10:08, Christian Thalinger wrote: > > Currently looking at some inlining stuff and I noticed that AlwaysInlineIntrinsics in AbstractInliningPolicy.isIntrinsic doesn?t do anything since the two methods called (onlyIntrinsics and onlyForcedIntrinsics) have exactly the same implementation: > > protected boolean isIntrinsic(Replacements replacements, InlineInfo info) { > if (AlwaysInlineIntrinsics.getValue(info.graph().getOptions())) { > return onlyIntrinsics(replacements, info); > } else { > return onlyForcedIntrinsics(replacements, info); > } > } > > private static boolean onlyIntrinsics(Replacements replacements, InlineInfo info) { > for (int i = 0; i < info.numberOfMethods(); i++) { > if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { > return false; > } > } > return true; > } > > private static boolean onlyForcedIntrinsics(Replacements replacements, InlineInfo info) { > for (int i = 0; i < info.numberOfMethods(); i++) { > if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { > return false; > } > } > return true; > } > > Am I missing something? I don't think so - that code just looks wrong. I don't even know what a "force intrinsic" means. -Doug From cthalinger at twitter.com Thu Aug 10 12:20:02 2017 From: cthalinger at twitter.com (Christian Thalinger) Date: Thu, 10 Aug 2017 14:20:02 +0200 Subject: AlwaysInlineIntrinsics and AbstractInliningPolicy.isIntrinsic In-Reply-To: <4CA301C5-9340-414C-B6BB-F20731828231@oracle.com> References: <4CA301C5-9340-414C-B6BB-F20731828231@oracle.com> Message-ID: > On Aug 10, 2017, at 12:11 PM, Doug Simon wrote: > > >> On 10 Aug 2017, at 10:08, Christian Thalinger wrote: >> >> Currently looking at some inlining stuff and I noticed that AlwaysInlineIntrinsics in AbstractInliningPolicy.isIntrinsic doesn?t do anything since the two methods called (onlyIntrinsics and onlyForcedIntrinsics) have exactly the same implementation: >> >> protected boolean isIntrinsic(Replacements replacements, InlineInfo info) { >> if (AlwaysInlineIntrinsics.getValue(info.graph().getOptions())) { >> return onlyIntrinsics(replacements, info); >> } else { >> return onlyForcedIntrinsics(replacements, info); >> } >> } >> >> private static boolean onlyIntrinsics(Replacements replacements, InlineInfo info) { >> for (int i = 0; i < info.numberOfMethods(); i++) { >> if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { >> return false; >> } >> } >> return true; >> } >> >> private static boolean onlyForcedIntrinsics(Replacements replacements, InlineInfo info) { >> for (int i = 0; i < info.numberOfMethods(); i++) { >> if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { >> return false; >> } >> } >> return true; >> } >> >> Am I missing something? > > I don't think so - that code just looks wrong. I don't even know what a "force intrinsic" means. Doug and I had an offline discussion about this. AlwaysInlineIntrinsics can be useful if the inlining heuristic decides to not inline you intrinsic because in that case you are falling back to Java code. From christian.humer at gmail.com Tue Aug 22 11:55:38 2017 From: christian.humer at gmail.com (Christian Humer) Date: Tue, 22 Aug 2017 11:55:38 +0000 Subject: GraalVM 0.27 and Truffle 0.27 Release Message-ID: Hi Guys, We have just uploaded GraalVM 0.27 for Linux and macOS to OTN: http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html This release does not introduce major changes compared to 0.26 [1]. We have also released a new compatible Truffle release 0.27 on Maven Central[2]. Please note that Truffle API 0.27 now depends on Graal SDK [3]. Please see the changelog [4] for further details on the changes in this release. The next release is scheduled for mid/end of September. Cheers, Christian [1] http://mail.openjdk.java.net/pipermail/graal-dev/2017-July/005038.html [2] http://repo1.maven.org/maven2/com/oracle/truffle/truffle-api/0.27/ [3] http://repo1.maven.org/maven2/org/graalvm/graal-sdk/0.27/ [4] https://github.com/graalvm/graal/blob/master/truffle/CHANGELOG.md From java at stefan-marr.de Wed Aug 23 14:25:17 2017 From: java at stefan-marr.de (Stefan Marr) Date: Wed, 23 Aug 2017 16:25:17 +0200 Subject: Call for Presentations and Participation: 4th Virtual Machine Meetup, co-located with ManLang'17 Message-ID: Call for Participation: VMM?17 ============================== 4th Virtual Machine Meetup Co-located with ManLang September 27-29, 2017, Prague, Czech Republic http://vmmeetup.github.io/2017/ The 4th Virtual Machine Meetup (VMM'17) is a venue for discussing the latest research and developments in the area of managed language execution. It will be held from 27th to 29th of September at the Charles University Prague, Prague, Czech Republic and is colocated with the Managed Languages conference 2017 (http://d3s.mff.cuni.cz/conferences/manlang17/). We welcome presentations of new research results, experience reports, as well as position statements that can lead to interesting discussions. Topics include, but are not limited to: - Programming language design - Dynamic and static program analysis - Compiler construction - Managed runtime architectures - Data processing engines - Distributed execution environments Participation is free of charge! To participate, please register at "http://d3s.mff.cuni.cz/conferences/manlang17/?n=Main.Registration". There are limited participant slots due to the constraints of the room, so please register early, and by September 19th the latest. If you would like to give a presentation, please submit a presentation abstract (a title with max. 100 characters and an abstract with max. 400 characters) to https://ssw.jku.at/VMM17/. We may ask for additional information from you before making the program decision. Presentation slots are either 30 minutes (long) or 15 minutes (short) including Q/A. Important dates: - Submissions: August 31st, 2017 - Author notification: September 1st, 2017 - Registration for participation: September 19th, 2017 - Virtual machine Meetup: Sep 27th to 29th at Charles University Prague - Social Event: Sep 29th 2017, optional Submission link: - https://ssw.jku.at/VMM17/ Program committee: - Stefan Marr, JKU Linz, Austria - Matthias Grimmer, Oracle Labs Austria - Thomas Wuerthinger, Oracle Labs Switzerland -- Stefan Marr Johannes Kepler Universit?t Linz http://stefan-marr.de/research/ From doug.simon at oracle.com Wed Aug 23 14:29:20 2017 From: doug.simon at oracle.com (Doug Simon) Date: Wed, 23 Aug 2017 16:29:20 +0200 Subject: JVMCI 0.33 released Message-ID: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> JVMCI 0.33 includes numerous bug fixes and changes: http://hg.openjdk.java.net/graal/graal-jvmci-8/log?revcount=400&rev=ancestors%28%27jvmci-0.33%27%29+-+ancestors%28%27jvmci-0.29%27%29 Namely: - Update base JDK from 8u121 to 8u141. - Switch back to OracleJDK (from OpenJDK) based binaries on OTN for Linux. All other platforms continue to be on OracleJDK. - OpenJDK based binary for Linux is available at https://github.com/dougxc/openjdk8-jvmci-builder/releases/tag/jvmci-0.33 The binaries are available at http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html. -Doug From ted at tedneward.com Wed Aug 23 18:24:48 2017 From: ted at tedneward.com (Ted Neward) Date: Wed, 23 Aug 2017 11:24:48 -0700 Subject: JVMCI 0.33 released In-Reply-To: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> References: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> Message-ID: Out of curiosity, have you given thought to providing a Docker image with JVMCI and Graal installed already? If not, I?ve been building out some Docker images for presentation demos for myself lately, and I?d be happy to take a stab at building out a GraalVM image Dockerfile for you guys to use and put up in the Oracle official images. (It?s not hard, I?d only be saving you time, and that assumes I got all the details right. ( ) Ted Neward Author, Speaker, Mentor http://www.newardassociates.com t: @tedneward | m: (425) 647-4526 On 8/23/17, 7:29 AM, "graal-dev on behalf of Doug Simon" wrote: JVMCI 0.33 includes numerous bug fixes and changes: http://hg.openjdk.java.net/graal/graal-jvmci-8/log?revcount=400&rev=ancestors%28%27jvmci-0.33%27%29+-+ancestors%28%27jvmci-0.29%27%29 Namely: - Update base JDK from 8u121 to 8u141. - Switch back to OracleJDK (from OpenJDK) based binaries on OTN for Linux. All other platforms continue to be on OracleJDK. - OpenJDK based binary for Linux is available at https://github.com/dougxc/openjdk8-jvmci-builder/releases/tag/jvmci-0.33 The binaries are available at http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html. -Doug From doug.simon at oracle.com Wed Aug 23 19:03:29 2017 From: doug.simon at oracle.com (Doug Simon) Date: Wed, 23 Aug 2017 21:03:29 +0200 Subject: JVMCI 0.33 released In-Reply-To: References: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> Message-ID: Hi Ted, We are thinking about putting some Docker images up at https://hub.docker.com/u/oracle/ at some point. Watch this space ;-) -Doug > On 23 Aug 2017, at 20:24, Ted Neward wrote: > > Out of curiosity, have you given thought to providing a Docker image with JVMCI and Graal installed already? > > If not, I?ve been building out some Docker images for presentation demos for myself lately, and I?d be happy to take a stab at building out a GraalVM image Dockerfile for you guys to use and put up in the Oracle official images. (It?s not hard, I?d only be saving you time, and that assumes I got all the details right. ( ) > > Ted Neward > Author, Speaker, Mentor > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.newardassociates.com&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=i1-Hef1Qrt47JSTmUR8-SfhVlDSGnFCGV-TedFESCK4&m=KcsSANDNwn6HksAgulkZ85P6ECArcH7B4l0IcYkoGDk&s=7AJsczM3422VC5aP6XRKbZAtmBeHE7T3awROcSr-kvc&e= > t: @tedneward | m: (425) 647-4526 > > On 8/23/17, 7:29 AM, "graal-dev on behalf of Doug Simon" wrote: > > JVMCI 0.33 includes numerous bug fixes and changes: > > http://hg.openjdk.java.net/graal/graal-jvmci-8/log?revcount=400&rev=ancestors%28%27jvmci-0.33%27%29+-+ancestors%28%27jvmci-0.29%27%29 > > Namely: > - Update base JDK from 8u121 to 8u141. > - Switch back to OracleJDK (from OpenJDK) based binaries on OTN for Linux. All other platforms continue to be on OracleJDK. > - OpenJDK based binary for Linux is available at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dougxc_openjdk8-2Djvmci-2Dbuilder_releases_tag_jvmci-2D0.33&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=i1-Hef1Qrt47JSTmUR8-SfhVlDSGnFCGV-TedFESCK4&m=KcsSANDNwn6HksAgulkZ85P6ECArcH7B4l0IcYkoGDk&s=tx9Hp-w8wgTB-o001Lrym34r_dkgHDM0QznEBe1IEa4&e= > > The binaries are available at http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html. > > -Doug > > > From thomas.wuerthinger at oracle.com Wed Aug 23 19:29:05 2017 From: thomas.wuerthinger at oracle.com (Thomas Wuerthinger) Date: Wed, 23 Aug 2017 21:29:05 +0200 Subject: JVMCI 0.33 released In-Reply-To: References: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> Message-ID: One question we are currently discussing regarding docker images is whether we should put up a single Graal VM image including all the languages or rather take a layered approach with a base image that can be combined with images for individual languages (e.g., for the JavaScript, Ruby, LLVM, or R support). The latter could have the advantage to reduce the docker image size when only a subset of the Graal languages are in use. The other feature we will add to the native-image building tool is to create not only a binary but also a docker image after doing the AOT compilation. This would allow the result to be immediately be deployed in a container service. The docker image sizes for these AOT generated images are very small. In general, we are interested in feedback what approaches to docker images could be most useful for Graal VM users. - thomas > On 23 Aug 2017, at 21:03, Doug Simon wrote: > > Hi Ted, > > We are thinking about putting some Docker images up at https://hub.docker.com/u/oracle/ at some point. Watch this space ;-) > > -Doug > >> On 23 Aug 2017, at 20:24, Ted Neward wrote: >> >> Out of curiosity, have you given thought to providing a Docker image with JVMCI and Graal installed already? >> >> If not, I?ve been building out some Docker images for presentation demos for myself lately, and I?d be happy to take a stab at building out a GraalVM image Dockerfile for you guys to use and put up in the Oracle official images. (It?s not hard, I?d only be saving you time, and that assumes I got all the details right. ( ) >> >> Ted Neward >> Author, Speaker, Mentor >> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.newardassociates.com&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=i1-Hef1Qrt47JSTmUR8-SfhVlDSGnFCGV-TedFESCK4&m=KcsSANDNwn6HksAgulkZ85P6ECArcH7B4l0IcYkoGDk&s=7AJsczM3422VC5aP6XRKbZAtmBeHE7T3awROcSr-kvc&e= >> t: @tedneward | m: (425) 647-4526 >> >> On 8/23/17, 7:29 AM, "graal-dev on behalf of Doug Simon" wrote: >> >> JVMCI 0.33 includes numerous bug fixes and changes: >> >> http://hg.openjdk.java.net/graal/graal-jvmci-8/log?revcount=400&rev=ancestors%28%27jvmci-0.33%27%29+-+ancestors%28%27jvmci-0.29%27%29 >> >> Namely: >> - Update base JDK from 8u121 to 8u141. >> - Switch back to OracleJDK (from OpenJDK) based binaries on OTN for Linux. All other platforms continue to be on OracleJDK. >> - OpenJDK based binary for Linux is available at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dougxc_openjdk8-2Djvmci-2Dbuilder_releases_tag_jvmci-2D0.33&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=i1-Hef1Qrt47JSTmUR8-SfhVlDSGnFCGV-TedFESCK4&m=KcsSANDNwn6HksAgulkZ85P6ECArcH7B4l0IcYkoGDk&s=tx9Hp-w8wgTB-o001Lrym34r_dkgHDM0QznEBe1IEa4&e= >> >> The binaries are available at http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html. >> >> -Doug >> >> >> > From ted at tedneward.com Wed Aug 23 22:55:18 2017 From: ted at tedneward.com (Ted Neward) Date: Wed, 23 Aug 2017 15:55:18 -0700 Subject: JVMCI 0.33 released In-Reply-To: References: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> Message-ID: <56EBE3BF-EDF5-4A49-B6BC-452568590870@tedneward.com> My personal opinion/approach is to take the more layered approach, since that seems to echo what the Docker team is suggesting, and allows for more flexibility on the part of the downstream Docker user (e.g., me). That said, my personal interest is in ?ALL THE THINGS?, so I would also love to see an image that has everything in it, particularly since the cost of using/maintaining both is pretty negligible. For my own demos, for example, I?ve built a base ?java? image, which then is the FROM that the ?scala? image and ?frege? images pull from, only adding in the scala/sbt bits (for example) in the ?scala? image. Then, if I have particular code of interest I want to include as a demo, I build a ?scala-demo? containing a copy of the demo code I want to display to people. And so on. That?s my $.02 worth. If you guys are thinking about doing this in the next few weeks, I?ll wait, but if not, I?ll probably take a pass at doing it myself just because I want to explore the whole space. Also, quick thought: Bonus points if you have separate images for *running* Graal and *building* it. :-) Ted Neward Author, Speaker, Mentor http://www.newardassociates.com t: @tedneward | m: (425) 647-4526 On 8/23/17, 12:29 PM, "Thomas Wuerthinger" wrote: One question we are currently discussing regarding docker images is whether we should put up a single Graal VM image including all the languages or rather take a layered approach with a base image that can be combined with images for individual languages (e.g., for the JavaScript, Ruby, LLVM, or R support). The latter could have the advantage to reduce the docker image size when only a subset of the Graal languages are in use. The other feature we will add to the native-image building tool is to create not only a binary but also a docker image after doing the AOT compilation. This would allow the result to be immediately be deployed in a container service. The docker image sizes for these AOT generated images are very small. In general, we are interested in feedback what approaches to docker images could be most useful for Graal VM users. - thomas > On 23 Aug 2017, at 21:03, Doug Simon wrote: > > Hi Ted, > > We are thinking about putting some Docker images up at https://hub.docker.com/u/oracle/ at some point. Watch this space ;-) > > -Doug > >> On 23 Aug 2017, at 20:24, Ted Neward wrote: >> >> Out of curiosity, have you given thought to providing a Docker image with JVMCI and Graal installed already? >> >> If not, I?ve been building out some Docker images for presentation demos for myself lately, and I?d be happy to take a stab at building out a GraalVM image Dockerfile for you guys to use and put up in the Oracle official images. (It?s not hard, I?d only be saving you time, and that assumes I got all the details right. ( ) >> >> Ted Neward >> Author, Speaker, Mentor >> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.newardassociates.com&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=i1-Hef1Qrt47JSTmUR8-SfhVlDSGnFCGV-TedFESCK4&m=KcsSANDNwn6HksAgulkZ85P6ECArcH7B4l0IcYkoGDk&s=7AJsczM3422VC5aP6XRKbZAtmBeHE7T3awROcSr-kvc&e= >> t: @tedneward | m: (425) 647-4526 >> >> On 8/23/17, 7:29 AM, "graal-dev on behalf of Doug Simon" wrote: >> >> JVMCI 0.33 includes numerous bug fixes and changes: >> >> http://hg.openjdk.java.net/graal/graal-jvmci-8/log?revcount=400&rev=ancestors%28%27jvmci-0.33%27%29+-+ancestors%28%27jvmci-0.29%27%29 >> >> Namely: >> - Update base JDK from 8u121 to 8u141. >> - Switch back to OracleJDK (from OpenJDK) based binaries on OTN for Linux. All other platforms continue to be on OracleJDK. >> - OpenJDK based binary for Linux is available at https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dougxc_openjdk8-2Djvmci-2Dbuilder_releases_tag_jvmci-2D0.33&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=i1-Hef1Qrt47JSTmUR8-SfhVlDSGnFCGV-TedFESCK4&m=KcsSANDNwn6HksAgulkZ85P6ECArcH7B4l0IcYkoGDk&s=tx9Hp-w8wgTB-o001Lrym34r_dkgHDM0QznEBe1IEa4&e= >> >> The binaries are available at http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html. >> >> -Doug >> >> >> > From chris.seaton at oracle.com Wed Aug 23 23:01:36 2017 From: chris.seaton at oracle.com (Chris Seaton) Date: Thu, 24 Aug 2017 00:01:36 +0100 Subject: JVMCI 0.33 released In-Reply-To: <56EBE3BF-EDF5-4A49-B6BC-452568590870@tedneward.com> References: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> <56EBE3BF-EDF5-4A49-B6BC-452568590870@tedneward.com> Message-ID: <2D802B4D-44F1-4A06-8E68-F04888F3BF8F@oracle.com> > On 23 Aug 2017, at 23:55, Ted Neward wrote: > > Also, quick thought: Bonus points if you have separate images for *running* Graal and *building* it. :-) We?ve got these for TruffleRuby and Sulong https://github.com/graalvm/truffleruby/tree/master/test/truffle/docker https://github.com/graalvm/truffleruby/tree/master/tool/docker From ted at tedneward.com Thu Aug 24 01:06:51 2017 From: ted at tedneward.com (Ted Neward) Date: Wed, 23 Aug 2017 18:06:51 -0700 Subject: JVMCI 0.33 released In-Reply-To: <2D802B4D-44F1-4A06-8E68-F04888F3BF8F@oracle.com> References: <94B69166-63E5-4FD1-A917-A56C357D2186@oracle.com> <56EBE3BF-EDF5-4A49-B6BC-452568590870@tedneward.com> <2D802B4D-44F1-4A06-8E68-F04888F3BF8F@oracle.com> Message-ID: That?s beautiful. :-) Will play with this ASAP. Ted Neward Author, Speaker, Mentor http://www.newardassociates.com t: @tedneward | m: (425) 647-4526 On 8/23/17, 4:01 PM, "Chris Seaton" wrote: > On 23 Aug 2017, at 23:55, Ted Neward wrote: > > Also, quick thought: Bonus points if you have separate images for *running* Graal and *building* it. :-) We?ve got these for TruffleRuby and Sulong https://github.com/graalvm/truffleruby/tree/master/test/truffle/docker https://github.com/graalvm/truffleruby/tree/master/tool/docker From hlk.dogan at gmail.com Mon Aug 28 16:00:02 2017 From: hlk.dogan at gmail.com (Haluk Dogan) Date: Mon, 28 Aug 2017 11:00:02 -0500 Subject: different outline window in IGV Message-ID: Hi, I'm playing with Graal to get more understanding about the technology. I run the following command: mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode However, the screen I have for Outline window is different than the Christian Wimmer's "Graal Tutorial at CGO 2015". What parameters should I add to get the same window? Thanks. Best, Haluk -- HD From tom.rodriguez at oracle.com Mon Aug 28 16:32:05 2017 From: tom.rodriguez at oracle.com (Tom Rodriguez) Date: Mon, 28 Aug 2017 09:32:05 -0700 Subject: different outline window in IGV In-Reply-To: References: Message-ID: <59A44585.5010707@oracle.com> Use -Dgraal.Dump=:2. We reduced the default verbosity of the graph dumping to level 1 and using :2 sets it to 2 which gives you a dump after every phase which was the old behaviour. tom Haluk Dogan wrote: > mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump > -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode From hlk.dogan at gmail.com Mon Aug 28 16:53:58 2017 From: hlk.dogan at gmail.com (Haluk Dogan) Date: Mon, 28 Aug 2017 11:53:58 -0500 Subject: different outline window in IGV In-Reply-To: <59A44585.5010707@oracle.com> References: <59A44585.5010707@oracle.com> Message-ID: It worked, thank you. Is there any way to get information about which optimizations techniques (e.g. method inlining, loop unrolling etc.) Graal applied to hot methods? On Mon, Aug 28, 2017 at 11:32 AM, Tom Rodriguez wrote: > Use -Dgraal.Dump=:2. We reduced the default verbosity of the graph > dumping to level 1 and using :2 sets it to 2 which gives you a dump after > every phase which was the old behaviour. > > tom > > > Haluk Dogan wrote: > >> mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump >> -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode >> > -- HD From tom.rodriguez at oracle.com Mon Aug 28 17:25:25 2017 From: tom.rodriguez at oracle.com (Tom Rodriguez) Date: Mon, 28 Aug 2017 10:25:25 -0700 Subject: different outline window in IGV In-Reply-To: References: <59A44585.5010707@oracle.com> Message-ID: <59A45205.70009@oracle.com> Haluk Dogan wrote: > It worked, thank you. Is there any way to get information about which > optimizations techniques (e.g. method inlining, loop unrolling etc.) > Graal applied to hot methods? Not a good one. The IGV has a slightly hacky feature that attempts to detect unchanged graphs but the current strategy is based on the graph encoding so it reports a spurious change for the graph after a real change. To enable it select the D with the circle around it in the toolbar for the graph view window. Now the forward and backward buttons will only move between changed graphs. Duplicate graphs have the _isDuplicate property set on them when you inspect their properties from the outline view. tom > > On Mon, Aug 28, 2017 at 11:32 AM, Tom Rodriguez > > wrote: > > Use -Dgraal.Dump=:2. We reduced the default verbosity of the graph > dumping to level 1 and using :2 sets it to 2 which gives you a dump > after every phase which was the old behaviour. > > tom > > > Haluk Dogan wrote: > > mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump > -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode > > > > > -- > HD From christian.wimmer at oracle.com Mon Aug 28 17:52:19 2017 From: christian.wimmer at oracle.com (Christian Wimmer) Date: Mon, 28 Aug 2017 10:52:19 -0700 Subject: different outline window in IGV In-Reply-To: References: Message-ID: Hi Haluk, There is an updated version of the Graal tutorial from PLDI 2017 (linked from [1]), where the command lines reflect the state from June 2017. But things change quickly in the Graal world, so it is difficult to keep a presentation up-to-date. -Christian [1] https://github.com/graalvm/graal/blob/master/docs/Publications.md On 08/28/2017 09:00 AM, Haluk Dogan wrote: > Hi, > > I'm playing with Graal to get more understanding about the technology. I > run the following command: > > mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump > -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode > > However, the screen I have for Outline window is different than the > Christian Wimmer's "Graal Tutorial at CGO 2015". What parameters should I > add to get the same window? > > Thanks. > > Best, > Haluk > From hlk.dogan at gmail.com Tue Aug 29 18:16:43 2017 From: hlk.dogan at gmail.com (Haluk Dogan) Date: Tue, 29 Aug 2017 13:16:43 -0500 Subject: different outline window in IGV In-Reply-To: References: Message-ID: Hi, Is there any examples for custom compilation with Graal? I'm interested in this part "Applications can call Graal like a library to perform custom compilations" as shown in slide 82 of "2017_PLDI_GraalTutorial.pdf". However, I was not able to make any progress. I created an Intellij project and set 9ea14-zulu as my compiler. Then, I tried to run GraalTutorial, but had errors related to undefined modules. If I changed the compiler to "labsjdk1.8.0_141-jvmci-0.33", then I am getting errors for importing jdk.vm.ci.code.* Is there any guideline to set up a project, so that I can call Graal like a library? Thanks. Best, Haluk On Mon, Aug 28, 2017 at 12:52 PM, Christian Wimmer < christian.wimmer at oracle.com> wrote: > Hi Haluk, > > There is an updated version of the Graal tutorial from PLDI 2017 (linked > from [1]), where the command lines reflect the state from June 2017. But > things change quickly in the Graal world, so it is difficult to keep a > presentation up-to-date. > > -Christian > > [1] https://github.com/graalvm/graal/blob/master/docs/Publications.md > > > > > On 08/28/2017 09:00 AM, Haluk Dogan wrote: > >> Hi, >> >> I'm playing with Graal to get more understanding about the technology. I >> run the following command: >> >> mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump >> -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode >> >> However, the screen I have for Outline window is different than the >> Christian Wimmer's "Graal Tutorial at CGO 2015". What parameters should I >> add to get the same window? >> >> Thanks. >> >> Best, >> Haluk >> >> -- HD From christian.wimmer at oracle.com Thu Aug 31 05:02:33 2017 From: christian.wimmer at oracle.com (Christian Wimmer) Date: Wed, 30 Aug 2017 22:02:33 -0700 Subject: different outline window in IGV In-Reply-To: References: Message-ID: <36b37145-ca85-6abb-1012-23debe969d3f@oracle.com> The best (but of course reasonably complex) example for custom compilations is Truffle. When you look at code like the class TruffleCompiler, you see how a custom StructuredGraph is created (using the PartialEvaluator class), compiled using the standard Graal compilation pipeline (but with some custom providers like a more aggressive constant folding of field loads), and installed into the VM's code cache. I think our version of JDK 8 is easier for experiments compared to Java 9 because you don't run in any module issues, and it is also our main development platform. When you run "mx ideinit", you get all the IDE setup for Eclipse, NetBeans, or IntelliJ (including the correct setup of the projects to include the JVMCI classes). -Christian On 8/29/2017 11:16 AM, Haluk Dogan wrote: > Hi, > > Is there any examples for custom compilation with Graal? I'm interested in > this part "Applications can call Graal like a library to perform custom > compilations" as shown in slide 82 of "2017_PLDI_GraalTutorial.pdf". > However, I was not able to make any progress. > > I created an Intellij project and set 9ea14-zulu as my compiler. Then, I > tried to run GraalTutorial, but had errors related to undefined modules. If > I changed the compiler to "labsjdk1.8.0_141-jvmci-0.33", then I am getting > errors for importing jdk.vm.ci.code.* > > Is there any guideline to set up a project, so that I can call Graal like a > library? > > Thanks. > > Best, > Haluk > > On Mon, Aug 28, 2017 at 12:52 PM, Christian Wimmer < > christian.wimmer at oracle.com> wrote: > >> Hi Haluk, >> >> There is an updated version of the Graal tutorial from PLDI 2017 (linked >> from [1]), where the command lines reflect the state from June 2017. But >> things change quickly in the Graal world, so it is difficult to keep a >> presentation up-to-date. >> >> -Christian >> >> [1] https://github.com/graalvm/graal/blob/master/docs/Publications.md >> >> >> >> >> On 08/28/2017 09:00 AM, Haluk Dogan wrote: >> >>> Hi, >>> >>> I'm playing with Graal to get more understanding about the technology. I >>> run the following command: >>> >>> mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump >>> -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode >>> >>> However, the screen I have for Outline window is different than the >>> Christian Wimmer's "Graal Tutorial at CGO 2015". What parameters should I >>> add to get the same window? >>> >>> Thanks. >>> >>> Best, >>> Haluk >>> >>> > > From hlk.dogan at gmail.com Thu Aug 31 14:21:40 2017 From: hlk.dogan at gmail.com (Haluk Dogan) Date: Thu, 31 Aug 2017 09:21:40 -0500 Subject: different outline window in IGV In-Reply-To: <36b37145-ca85-6abb-1012-23debe969d3f@oracle.com> References: <36b37145-ca85-6abb-1012-23debe969d3f@oracle.com> Message-ID: So, we actually don't have the control for optimization levels and particular optimization methods like in the gcc[1]. Am I wrong? I tried "mx ideinit" and import all the projects to my workspace, however, I had a long list in the "Problems" window mostly related with jvmci. I build graal with "labsjdk1.8.0_141-jvmci-0.33". I'll try again with cloning fresh repository. Thanks. [1] http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html On Thu, Aug 31, 2017 at 12:02 AM, Christian Wimmer < christian.wimmer at oracle.com> wrote: > The best (but of course reasonably complex) example for custom > compilations is Truffle. When you look at code like the class > TruffleCompiler, you see how a custom StructuredGraph is created (using the > PartialEvaluator class), compiled using the standard Graal compilation > pipeline (but with some custom providers like a more aggressive constant > folding of field loads), and installed into the VM's code cache. > > I think our version of JDK 8 is easier for experiments compared to Java 9 > because you don't run in any module issues, and it is also our main > development platform. When you run "mx ideinit", you get all the IDE setup > for Eclipse, NetBeans, or IntelliJ (including the correct setup of the > projects to include the JVMCI classes). > > -Christian > > > > On 8/29/2017 11:16 AM, Haluk Dogan wrote: > >> Hi, >> >> Is there any examples for custom compilation with Graal? I'm interested in >> this part "Applications can call Graal like a library to perform custom >> compilations" as shown in slide 82 of "2017_PLDI_GraalTutorial.pdf". >> However, I was not able to make any progress. >> >> I created an Intellij project and set 9ea14-zulu as my compiler. Then, I >> tried to run GraalTutorial, but had errors related to undefined modules. >> If >> I changed the compiler to "labsjdk1.8.0_141-jvmci-0.33", then I am getting >> errors for importing jdk.vm.ci.code.* >> >> Is there any guideline to set up a project, so that I can call Graal like >> a >> library? >> >> Thanks. >> >> Best, >> Haluk >> >> On Mon, Aug 28, 2017 at 12:52 PM, Christian Wimmer < >> christian.wimmer at oracle.com> wrote: >> >> Hi Haluk, >>> >>> There is an updated version of the Graal tutorial from PLDI 2017 (linked >>> from [1]), where the command lines reflect the state from June 2017. But >>> things change quickly in the Graal world, so it is difficult to keep a >>> presentation up-to-date. >>> >>> -Christian >>> >>> [1] https://github.com/graalvm/graal/blob/master/docs/Publications.md >>> >>> >>> >>> >>> On 08/28/2017 09:00 AM, Haluk Dogan wrote: >>> >>> Hi, >>>> >>>> I'm playing with Graal to get more understanding about the technology. I >>>> run the following command: >>>> >>>> mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump >>>> -D:MethodFilter=String.hashCode GraalTutorial#testStringHashCode >>>> >>>> However, the screen I have for Outline window is different than the >>>> Christian Wimmer's "Graal Tutorial at CGO 2015". What parameters should >>>> I >>>> add to get the same window? >>>> >>>> Thanks. >>>> >>>> Best, >>>> Haluk >>>> >>>> >>>> >> >> -- HD From christian.wimmer at oracle.com Thu Aug 31 16:30:23 2017 From: christian.wimmer at oracle.com (Christian Wimmer) Date: Thu, 31 Aug 2017 09:30:23 -0700 Subject: different outline window in IGV In-Reply-To: References: <36b37145-ca85-6abb-1012-23debe969d3f@oracle.com> Message-ID: You have full control over optimization phases that Graal performs: When Graal is invoked for Truffle [1], the "suites" parameter specifies the optimization phases that are applied. For Truffle, we use the default suites [2], but you can do any modification to the suites that you want, i.e., remove phases or add your own custom phases. -Christian [1] https://github.com/graalvm/graal/blob/a00ce39133db463fc93a5963f62060de295c5db0/compiler/src/org.graalvm.compiler.truffle/src/org/graalvm/compiler/truffle/TruffleCompiler.java#L232 [2] https://github.com/graalvm/graal/blob/a00ce39133db463fc93a5963f62060de295c5db0/compiler/src/org.graalvm.compiler.truffle/src/org/graalvm/compiler/truffle/hotspot/HotSpotTruffleCompiler.java#L45 On 08/31/2017 07:21 AM, Haluk Dogan wrote: > So, we actually don't have the control for optimization levels and > particular optimization methods like in the gcc[1]. Am I wrong? > > I tried "mx ideinit" and import all the projects to my workspace, > however, I had a long list in the "Problems" window mostly related with > jvmci. I build graal with "labsjdk1.8.0_141-jvmci-0.33". I'll try again > with cloning fresh repository. > > Thanks. > > [1] http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html > > > On Thu, Aug 31, 2017 at 12:02 AM, Christian Wimmer > > wrote: > > The best (but of course reasonably complex) example for custom > compilations is Truffle. When you look at code like the class > TruffleCompiler, you see how a custom StructuredGraph is created > (using the PartialEvaluator class), compiled using the standard > Graal compilation pipeline (but with some custom providers like a > more aggressive constant folding of field loads), and installed into > the VM's code cache. > > I think our version of JDK 8 is easier for experiments compared to > Java 9 because you don't run in any module issues, and it is also > our main development platform. When you run "mx ideinit", you get > all the IDE setup for Eclipse, NetBeans, or IntelliJ (including the > correct setup of the projects to include the JVMCI classes). > > -Christian > > > > On 8/29/2017 11:16 AM, Haluk Dogan wrote: > > Hi, > > Is there any examples for custom compilation with Graal? I'm > interested in > this part "Applications can call Graal like a library to perform > custom > compilations" as shown in slide 82 of "2017_PLDI_GraalTutorial.pdf". > However, I was not able to make any progress. > > I created an Intellij project and set 9ea14-zulu as my compiler. > Then, I > tried to run GraalTutorial, but had errors related to undefined > modules. If > I changed the compiler to "labsjdk1.8.0_141-jvmci-0.33", then I > am getting > errors for importing jdk.vm.ci.code.* > > Is there any guideline to set up a project, so that I can call > Graal like a > library? > > Thanks. > > Best, > Haluk > > On Mon, Aug 28, 2017 at 12:52 PM, Christian Wimmer < > christian.wimmer at oracle.com > > wrote: > > Hi Haluk, > > There is an updated version of the Graal tutorial from PLDI > 2017 (linked > from [1]), where the command lines reflect the state from > June 2017. But > things change quickly in the Graal world, so it is difficult > to keep a > presentation up-to-date. > > -Christian > > [1] > https://github.com/graalvm/graal/blob/master/docs/Publications.md > > > > > > On 08/28/2017 09:00 AM, Haluk Dogan wrote: > > Hi, > > I'm playing with Graal to get more understanding about > the technology. I > run the following command: > > mx unittest -XX:+UseJVMCICompiler -Dgraal.Dump > -D:MethodFilter=String.hashCode > GraalTutorial#testStringHashCode > > However, the screen I have for Outline window is > different than the > Christian Wimmer's "Graal Tutorial at CGO 2015". What > parameters should I > add to get the same window? > > Thanks. > > Best, > Haluk > > > > > > > > -- > HD