Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 130C6200C6E for ; Mon, 8 May 2017 17:02:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 11B54160BA5; Mon, 8 May 2017 15:02:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 30D79160B99 for ; Mon, 8 May 2017 17:02:44 +0200 (CEST) Received: (qmail 44688 invoked by uid 500); 8 May 2017 15:02:43 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 44678 invoked by uid 99); 8 May 2017 15:02:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 May 2017 15:02:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E414ACA8F9 for ; Mon, 8 May 2017 15:02:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.897 X-Spam-Level: X-Spam-Status: No, score=-0.897 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id ZAVbNyrD5AZl for ; Mon, 8 May 2017 15:02:42 +0000 (UTC) Received: from mail-ua0-f175.google.com (mail-ua0-f175.google.com [209.85.217.175]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id E5E945F477 for ; Mon, 8 May 2017 15:02:41 +0000 (UTC) Received: by mail-ua0-f175.google.com with SMTP id z47so42686197uaz.0 for ; Mon, 08 May 2017 08:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=agdxMu3BFScKFPymoLoKp9MgI5I8AIogf/TrvOvTtjk=; b=leftnzLdjiXvLFL81s9v6YEJTDqVQ+rH3Fr7aSiTlykSTIxDwDyC9sAH3JTW5h2fto ZfyA00DtVDH5U9e2f2p58hpnUx7n2vP48Vw1t6KMdYE3MMF/Y0wBTjjKWFBsA3y6FbCF z/eh8KFyaQIOmcM7hPhhq7w+5OjsQFopN9a3xrleQR46xKDZAd0HkLCPeUhDd5+KTm3f rCwBxDoMs7iWaU7cTW62Bym8JvfbPs1FBh5PBt8LFj0iDERl+rhEO65dJlpViSIcw4PK QhcQjNKRW65Qxa/jxFDdps1UnnclxJ1d1okkaaxVFOUJVKzTT+hgMCXw/4BZ0I13m2PJ NQXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=agdxMu3BFScKFPymoLoKp9MgI5I8AIogf/TrvOvTtjk=; b=XSImgYBe34eedEvIaQ5L98mZXd7hZmpKWVfGbxJuUURSzASUlch0lmMuLW31UEtxmc crFLbXiR+zSFCU8cMBWZaRxqLeQZbRVSBMVxBD13rP3vjFVsMm2hFhfZDkw8JniTbQFb vsTfNTfmKVazJmIWamTLDxS+mj8LIxk3wt/nlW6bmpIbyKg1auYl7LCl10rYMdJNjlsg 5eX+DFL1VWHhRqQSXM0u39JE02l3vMjkJCYM9HSLE92J/YUFQ/gEnFC6YAvb1ktFEfnp h91XZ+zTIIk+aJX4lGiFrPx92fM9oXBzt7YhK54+9Buq7efAnvdahHjE0UtVHC1wBkzs DlFw== X-Gm-Message-State: AN3rC/4AHolZDF1dOs6IDNQftqtq0fgJq5MpVkkSoUyMUyvb83BNTm0f F0y77d70yZjaMIFZWGoS0JSRW5pXsedH X-Received: by 10.159.57.93 with SMTP id i29mr24858593uag.102.1494255761238; Mon, 08 May 2017 08:02:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.118.206 with HTTP; Mon, 8 May 2017 08:02:00 -0700 (PDT) From: Paolo Di Tommaso Date: Mon, 8 May 2017 17:02:00 +0200 Message-ID: Subject: Groovy AOT compilation To: users@groovy.apache.org Content-Type: multipart/alternative; boundary=f403043ed064da3237054f048721 archived-at: Mon, 08 May 2017 15:02:45 -0000 --f403043ed064da3237054f048721 Content-Type: text/plain; charset=UTF-8 Dear all, I just want to share with you my experience with the Java AOT compiler a came across a few days ago. Although they said clearly that it still an experimental project and it does not support dynamic class loading and most of reflection, I turns out it's possible to compile a basic static Groovy class, eg: @groovy.transform.CompileStatic class Hello { static void main( String... args ) { System.out.println "Hello world!" } } This mean that it creates a native 5MB binary executable, that can run on any machine without the need of the Java VM nor the Groovy runtime! in 12 millisecond! cool!! Unfortunately the good news stops here. I was unable to successfully compile any other piece of code, which for example uses a Groovy "println" method or just instantiate a class. The problem seems to be that, even though the code is statically compiled, Groovy uses reflection behind the scene to instantiate classes and performs other operations. Now, I guess this is certainly not a Groovy top priority, however since there is an on-going discussion around a major Groovy reengineering to make it compatible with the upcoming Java 9 module system, I was wondering if it would not make sense to include the support for the Java AOT compiler as a goal for a future Groovy 3/4 release? Personally I think it would be an extremely useful feature and a major achievement for the project. What do you think ? Cheers, Paolo --f403043ed064da3237054f048721 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear all,=C2=A0

I just want to share with you= my experience with the Java AOT compiler a came a= cross a few days ago.=C2=A0


Althoug= h they said clearly that it still an experimental project and it does not s= upport dynamic class loading and most of reflection, I turns out it's p= ossible to compile a basic static Groovy class, eg:=C2=A0

@groovy.transform.CompileStatic=C2=A0
class Hello {

=C2=A0 static void main( String... args ) {
=C2=A0 =C2=A0 System.out.println "Hello= world!"
=C2=A0 }=
}


This mean that it creates a nat= ive 5MB binary executable, that can run on any machine without the need of = the Java VM nor the Groovy runtime! in 12 millisecond! cool!!=C2=A0


Unfortunately the good news stops here. I = was unable to successfully compile any other piece of code, which for examp= le uses a Groovy "println" method or just instantiate a class. Th= e problem seems to be that, even though the code is statically compiled, Gr= oovy uses reflection behind the scene to instantiate classes and performs o= ther operations.=C2=A0

Now, I guess this is certai= nly not a Groovy top priority, however since there is an on-going discussio= n around a major Groovy reengineering to make it compatible with the upcomi= ng Java 9 module system, I was wondering if it would not make sense to incl= ude the support for the Java AOT compiler as a goal for a future Groovy 3/4= release?=C2=A0

Personally I think it would be an = extremely useful feature and a major achievement for the project.=C2=A0


What do you think ? =C2=A0

=C2=A0
Cheers,
Paolo


--f403043ed064da3237054f048721--