Return-Path: X-Original-To: apmail-groovy-dev-archive@minotaur.apache.org Delivered-To: apmail-groovy-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB7391811B for ; Thu, 26 Nov 2015 12:58:51 +0000 (UTC) Received: (qmail 78919 invoked by uid 500); 26 Nov 2015 12:58:51 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 78876 invoked by uid 500); 26 Nov 2015 12:58:51 -0000 Mailing-List: contact dev-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.incubator.apache.org Delivered-To: mailing list dev@groovy.incubator.apache.org Received: (qmail 78842 invoked by uid 99); 26 Nov 2015 12:58:51 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2015 12:58:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EF501C0845 for ; Thu, 26 Nov 2015 12:58:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.002 X-Spam-Level: **** X-Spam-Status: No, score=4.002 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id okc9KGFLIt1s for ; Thu, 26 Nov 2015 12:58:41 +0000 (UTC) Received: from smtpout02.partage.renater.fr (smtpout02.partage.renater.fr [194.254.241.31]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 6171F20C34 for ; Thu, 26 Nov 2015 12:58:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtpout02.partage.renater.fr (Postfix) with ESMTP id 5C521A32D4 for ; Thu, 26 Nov 2015 13:58:39 +0100 (CET) Received: from smtpout02.partage.renater.fr ([127.0.0.1]) by localhost (smtpout02.partage.renater.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rj7sZC4tfv4A for ; Thu, 26 Nov 2015 13:58:35 +0100 (CET) Received: from zmtaout01.partage.renater.fr (zmtaout01.partage.renater.fr [194.254.240.30]) by smtpout02.partage.renater.fr (Postfix) with ESMTP id 6772EA01A3 for ; Thu, 26 Nov 2015 13:58:34 +0100 (CET) Received: from zmtaout01.partage.renater.fr (localhost [127.0.0.1]) by zmtaout01.partage.renater.fr (Postfix) with ESMTP id 62F121A0263 for ; Thu, 26 Nov 2015 13:58:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zmtaout01.partage.renater.fr (Postfix) with ESMTP id 56FF91A025D for ; Thu, 26 Nov 2015 13:58:34 +0100 (CET) X-Virus-Scanned: amavisd-new at Received: from zmtaout01.partage.renater.fr ([127.0.0.1]) by localhost (zmtaout01.partage.renater.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id GqrOvNyJCAZM for ; Thu, 26 Nov 2015 13:58:34 +0100 (CET) Received: from zstore27-staff.partage.renater.fr (zstore27-staff.partage.renater.fr [10.254.241.53]) by zmtaout01.partage.renater.fr (Postfix) with ESMTP id 3E9721A0147 for ; Thu, 26 Nov 2015 13:58:34 +0100 (CET) Date: Thu, 26 Nov 2015 13:58:34 +0100 (CET) From: Remi Forax To: dev@groovy.incubator.apache.org Message-ID: <2131754572.49711.1448542714105.JavaMail.zimbra@u-pem.fr> In-Reply-To: References: <56164EAB.1030302@gmx.org> <5648ADB3.9090906@gmx.org> <116343119.48441.1448541597230.JavaMail.zimbra@u-pem.fr> Subject: Re: challenges through Java modules (aka jigsaw) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_49710_1234926740.1448542714104" X-Originating-IP: [194.254.240.40] X-Mailer: Zimbra 8.0.5_GA_5839 (ZimbraWebClient - FF42 (Linux)/8.0.5_GA_5839) Thread-Topic: challenges through Java modules (aka jigsaw) Thread-Index: 87tbkPBEsvWrgMdoJ5WT8A8b35Zsog== ------=_Part_49710_1234926740.1448542714104 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ----- Mail original ----- > De: "C=C3=A9dric Champeau" > =C3=80: dev@groovy.incubator.apache.org > Envoy=C3=A9: Jeudi 26 Novembre 2015 13:49:18 > Objet: Re: challenges through Java modules (aka jigsaw) > > You can have breaking changes in the way the classes are seen from Java > > (and > > jigsaw) without having breaking changes when you use these classes from > > Groovy. >=20 > > By example, you can introduce a way to create type aliases to Groovy, g= iven > > that, you can move Java classes around and keep the same references in = the > > Groovy code. >=20 > This would work only if a library is recompiled against the latest Groovy > version (and even more true if you use @CompileStatic), whereas the idea = of > backwards compatibility is *not* to recompile everything. That is to say, > take Groovy N+1 and it is capable of running classes compiled with Groovy= N. The translation of types can appear at runtime if the type aliases are know= n by the groovy class loader.=20 I think you only need re-compilation if you use @CompileStatic.=20 > > Also about groovy-all, you can create a module groovy-all that will req= uire > > all other modules, no ? >=20 > Yes, but that's not the purpose of this module today. It's more for guys = who > are too lazy to precisely determine all their Groovy module dependencies = and > prefer to use groovy-all instead of groovy + "find all modules that I use= ". > Note that the simplification that I give is recent, because a few release= s > ago, groovy-all contained repackaged ASM classes, whereas groovy.jar did > not. Now both have repackaged classes, making it much more consistent and > even less useful to use groovy-all. if it's only packaging, you just have to create a module-info.class that wi= ll concatenate all the module-info.class of all other modules, you may need= ASM for that :)=20 R=C3=A9mi=20 > > regards, >=20 > > R=C3=A9mi >=20 > > > De: "C=C3=A9dric Champeau" < cedric.champeau@gmail.com > > >=20 >=20 > > > =C3=80: dev@groovy.incubator.apache.org > >=20 >=20 > > > Envoy=C3=A9: Jeudi 26 Novembre 2015 13:10:11 > >=20 >=20 > > > Objet: Re: challenges through Java modules (aka jigsaw) > >=20 >=20 > > > So I'm taking advantage of a bit of free time to write a quick summar= y of > > > the > > > situation and what we will have to decide. Basically, we have a serio= us > > > problem (but we will not be the only ones). > >=20 >=20 > > > When you declare a Jigsaw module, one has to declare the list of pack= ages > > > that it exports (and sub-packages are not exported). Those packages a= re > > > the > > > ones that can be consumed from other Jigsaw modules. It therefore > > > implements > > > strong encapsulation, but making it impossible to reference an intern= al > > > class of a module, both at compile time and runtime. So far so good. = The > > > problem is that the list of packages that belong to a module is exclu= sive > > > to > > > that module. So if module A exports "foo.bar", another module cannot = do > > > the > > > same, or it will fail whenever the 2 modules are loaded at the same t= ime. > > > Worse, *internal packages* are also exclusive, so even if you don't > > > export > > > a > > > package, two modules containing the same internal packages will *also= * > > > fail. > >=20 >=20 > > > Why is it a problem for Groovy? It is a problem because we have a ver= y > > > long > > > history. And part of this history makes that modularization was > > > introduced > > > pretty recently, in the 2.0 release. Before, Groovy only had a single > > > module. Now Groovy provides multiple modules, but also a "groovy-all"= jar > > > that contains all the classes from all modules. At this point, we can > > > already see that this won't be possible anymore: groovy-all must die,= or > > > we > > > must not support modules (sigh). But the problem is even worse. Since= the > > > split into modules was done late and that we wanted to preserve backw= ards > > > compatibility, we decided not to change the packages of classes extra= cted > > > into their own modules. So for example, XmlParser is found in groovy.= util > > > (not groovy.util.xml) in the groovy-xml module, but we also have lots= of > > > classes that live into groovy.xml into the "groovy" core module. So i= n > > > short, our modules are no fit for Jigsaw: we must come back to the ve= ry > > > bad > > > state of having everything in a single module. > >=20 >=20 > > > Of course, that's not a satisfactory solution, and of course, there's > > > nothing > > > we can do to influence the decision not to make such a strong > > > requirement: > > > there are technical reasons behind this choice. > >=20 >=20 > > > So what can we do? > >=20 >=20 > > > 1. the easiest, fastest path, is to kill all modules that we have tod= ay, > > > and > > > go with a single, good old, groovy-all jar. We would go years backwar= ds, > > > and > > > it's definitely not something we want to do. We want to have *more* > > > modularization, in particular for Android, where the current split is > > > still > > > too big. > >=20 >=20 > > > 2. refactor modules so that each module has its own set of packages, = and > > > hope > > > that we don't end up with a big groovy-all jar. Seems very unlikely. > >=20 >=20 > > > 3. break binary compatibility, move classes around, reorganize stuff. > >=20 >=20 > > > Despite my worst nightmare of fragmenting the community (that is what > > > happened for all languages that tried to introduce breaking changes),= I > > > think we don't have the choice and we have to go route 3. And if we d= o > > > so, > > > I > > > would take advantage of this fact to: > >=20 >=20 > > > 1. reorganize our code base even further to separate everything into > > > their > > > own modules and make them as minimal as possible > >=20 >=20 > > > 2. migrate to Java 8 as the minimum JDK version, which would allow us= to > > > drop > > > support of the old call site caching, get a new MOP, and possibly > > > removing > > > everything that annoys us in terms of behavior which is kept for the = sake > > > of > > > compatibility > >=20 >=20 > > > It's a long road, and it is pretty obvious that we won't be able to b= e > > > ready > > > for Jigsaw launch (october 2016), but it we don't decide today what w= e > > > want > > > to do, we will soon be obsolete, because nobody will be able to use > > > Groovy > > > with Jigsaw. > >=20 >=20 > > > Last but not least, as part of the Gradle team, I'd like to take > > > advantage > > > of > > > this to rework our build to make it more consistent, faster, and aime= d > > > towards the future. In next January, we will start promoting a smooth > > > migration path to Jigsaw using the Java software model. I think Groov= y is > > > still too big to migrate now to the java software model, but at least= , we > > > can start investigating. It is crucial to us because Gradle uses Groo= vy > > > internally, so if Gradle doesn't run on Jigsaw, we will have a medium > > > term > > > problem (medium, because we could still run on JDK 8 but target JDK 9= ). > >=20 >=20 > > > Let the fun begin! > >=20 >=20 > > > 2015-11-15 17:07 GMT+01:00 Jochen Theodorou < blackdrag@gmx.org > : > >=20 >=20 > > > > On 15.11.2015 12:11, C=C3=A9dric Champeau wrote: > > >=20 > >=20 >=20 > > > > > Hi guys, > > > >=20 > > >=20 > >=20 >=20 > > > > > After spending some days at Devoxx, I had a few chats about Jigsa= w > > > > > and > > > >=20 > > >=20 > >=20 >=20 > > > > > the implications on Groovy. I will send an email summarizing them= and > > > > > I > > > >=20 > > >=20 > >=20 >=20 > > > > > think we need to come up with a plan. > > > >=20 > > >=20 > >=20 >=20 > > > > I was saying that, yes. Seems nobody wanted to believe me > > >=20 > >=20 >=20 > > > > > I'm not sure JIRA is the best way > > > >=20 > > >=20 > >=20 >=20 > > > > > to track this, but in short, we have serious issues coming, and > > > > > breaking > > > >=20 > > >=20 > >=20 >=20 > > > > > changes. Maybe it's a chance for us to make all the breaking chan= ges > > > > > we > > > >=20 > > >=20 > >=20 >=20 > > > > > thought for so long. > > > >=20 > > >=20 > >=20 >=20 > > > > I doubt it, we don't have the manpower, but we can do a bit of cour= se > > >=20 > >=20 >=20 > > > > bye Jochen > > >=20 > >=20 >=20 ------=_Part_49710_1234926740.1448542714104 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable



De= : "C=C3=A9dric Champeau" <cedric.champeau@gmail.com>
=C3=80= : dev@groovy.incubator.apache.org
Envoy=C3=A9: Jeudi 26 Novem= bre 2015 13:49:18
Objet: Re: challenges through Java modules (aka= jigsaw)


You can have breaking changes in the way the classes a= re seen from Java (and jigsaw) without having breaking changes when you use= these classes from Groovy.
By example, you can introduce a = way to create type aliases to Groovy, given that, you can move Java classes= around and keep the same references in the Groovy code.

=
This would work only if a library is recompil= ed against the latest Groovy version (and even more true if you use @Compil= eStatic), whereas the idea of backwards compatibility is *not* to recompile= everything. That is to say, take Groovy N+1 and it is capable of running c= lasses compiled with Groovy N.
The translation of types can appear at runtime if the type alia= ses are known by the groovy class loader.
I think you only ne= ed re-compilation if you use @CompileStatic.

Also about groovy-all, you can create a module = groovy-all that will require all other modules, no ?

Yes, but that's not the purpose of this module to= day. It's more for guys who are too lazy to precisely determine all their G= roovy module dependencies and prefer to use groovy-all instead of groovy + = "find all modules that I use". Note that the simplification that I give is = recent, because a few releases ago, groovy-all contained repackaged ASM cla= sses, whereas groovy.jar did not. Now both have repackaged classes, making = it much more consistent and even less useful to use groovy-all.
=

if it's only packaging, you ju= st have to create a module-info.class that will concatenate all the module-= info.class of all other modules, you may need ASM for that :)

R=C3=A9mi

=
regards,
R=C3=A9mi


De: "C=C3=A9d= ric Champeau" <cedric.champeau@gmail.com>
=C3=80: dev@groovy.incubator.ap= ache.org
Envoy=C3=A9: Jeudi 26 Novembre 2015 13:10:11
O= bjet: Re: challenges through Java modules (aka jigsaw)


So I'm taking advantage of a bi= t of free time to write a quick summary of the situation and what we will h= ave to decide. Basically, we have a serious problem (but we will not be the= only ones).

When you declare a Jigsaw module, one has t= o declare the list of packages that it exports (and sub-packages are not ex= ported). Those packages are the ones that can be consumed from other Jigsaw= modules. It therefore implements strong encapsulation, but making it impos= sible to reference an internal class of a module, both at compile time and = runtime. So far so good. The problem is that the list of packages that belo= ng to a module is exclusive to that module. So if module A exports "foo.bar= ", another module cannot do the same, or it will fail whenever the 2 module= s are loaded at the same time. Worse, *internal packages* are also exclusiv= e, so even if you don't export a package, two modules containing the same i= nternal packages will *also* fail.

Why is it a pro= blem for Groovy? It is a problem because we have a very long history. And p= art of this history makes that modularization was introduced pretty recentl= y, in the 2.0 release. Before, Groovy only had a single module. Now Groovy = provides multiple modules, but also a "groovy-all" jar that contains all th= e classes from all modules. At this point, we can already see that this won= 't be possible anymore: groovy-all must die, or we must not support modules= (sigh). But the problem is even worse. Since the split into modules was do= ne late and that we wanted to preserve backwards compatibility, we decided = not to change the packages of classes extracted into their own modules. So = for example, XmlParser is found in groovy.util (not groovy.util.xml) in the= groovy-xml module, but we also have lots of classes that live into groovy.= xml into the "groovy" core module. So in short, our modules are no fit for = Jigsaw: we must come back to the very bad state of having everything in a s= ingle module.

Of course, that's not a satisfactory= solution, and of course, there's nothing we can do to influence the decisi= on not to make such a strong requirement: there are technical reasons behin= d this choice.

So what can we do?

1. the easiest, fastest path, is to kill all modules that we have = today, and go with a single, good old, groovy-all jar. We would go years ba= ckwards, and it's definitely not something we want to do. We want to have *= more* modularization, in particular for Android, where the current split is= still too big.
2. refactor modules so that each module has its o= wn set of packages, and hope that we don't end up with a big groovy-all jar= . Seems very unlikely.
3. break binary compatibility, move classe= s around, reorganize stuff.

Despite my worst night= mare of fragmenting the community (that is what happened for all languages = that tried to introduce breaking changes), I think we don't have the choice= and we have to go route 3. And if we do so, I would take advantage of this= fact to:
1. reorganize our code base even further to separate ev= erything into their own modules and make them as minimal as possible
<= div>2. migrate to Java 8 as the minimum JDK version, which would allow us t= o drop support of the old call site caching, get a new MOP, and possibly re= moving everything that annoys us in terms of behavior which is kept for the= sake of compatibility

It's a long road, and it is= pretty obvious that we won't be able to be ready for Jigsaw launch (octobe= r 2016), but it we don't decide today what we want to do, we will soon be o= bsolete, because nobody will be able to use Groovy with Jigsaw.
<= br>
Last but not least, as part of the Gradle team, I'd like to t= ake advantage of this to rework our build to make it more consistent, faste= r, and aimed towards the future. In next January, we will start promoting a= smooth migration path to Jigsaw using the Java software model. I think Gro= ovy is still too big to migrate now to the java software model, but at leas= t, we can start investigating. It is crucial to us because Gradle uses Groo= vy internally, so if Gradle doesn't run on Jigsaw, we will have a medium te= rm problem (medium, because we could still run on JDK 8 but target JDK 9).<= /div>

Let the fun begin!

2015-11-15 17:07 GMT+01:00 Jochen The= odorou <blackdrag@gmx.org>:
Hi guys,

After spending some days at Devoxx, I had a few chats about Jigsaw and
the implications on Groovy. I will send an email summarizing them and I
think we need to come up with a plan.

I was saying that, yes. Seems nobody wanted to believe me

I'm not sure JIRA is the best way
to track this, but in short, we have serious issues coming, and breaking changes. Maybe it's a chance for us to make all the breaking changes we
thought for so long.

I doubt it, we don't have the manpower, but we can do a bit of course
bye Jochen





=
------=_Part_49710_1234926740.1448542714104--