groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MG <mg...@arscreat.com>
Subject Re: Apache Groovy and language influences
Date Fri, 06 Oct 2017 18:36:27 GMT
@"var in Java 10": http://openjdk.java.net/jeps/286 ?
This is the same feature I suggested a month or so back for Groovy 
(coming from my short C# stint) - I was not aware that someone already 
done an in-depth analysis for Java :-)

Reading JEP 286 Groovy dodged a bit of a bullet there: They were 
considering using "def" instead of "var" as the keyword - because of 
Groovy. Only "def" in Groovy is shorthand for "Object", no type 
inference taking place (apart from IntelliJ Intellisense, which 
sometimes works better when using def instead of Object), so that would 
have made Java 10 incomaptible with Groovy in that regard.

Interestingly no one seemed to realize that using "final" without an 
explicit type together with type inference works perfectly well - 
instead they are talking about using a "val" keyword (very bad choice 
imho, since at least to me it implies a value type, or something which 
is const(ant)), for the case that the assignment is final...

So what are the plans for "var" (and the related type inference when 
using "final") in Groovy right now: Wait until the Java 10, or introduce 
earlier ?
mg


On 06.10.2017 18:51, Guillaume Laforge wrote:
> Indeed, I still remember meeting John Rose many years ago, the 
> mastermind behind invokedynamic, to speak about what a language like 
> Groovy was needing in this space :-)
> Hard to really quantify how much we helped, but yet, we did have some 
> influence for sure in this area!
> Or for things like the var stuff coming up in Java 10, it's also 
> something I've been advocating to Brian Goetze 3-4 years ago (although 
> he was really not in favor of it back in the day)
>
> Guillaume
>
>
> On Fri, Oct 6, 2017 at 3:30 PM, Joe Wolf <joewolf@gmail.com 
> <mailto:joewolf@gmail.com>> wrote:
>
>     Excellent presentation. I'd also suggest that Groovy was an
>     influence on the evolution of the Java language itself. For
>     example, I suspect Groovy was a contributing factor for
>     introducing invokedynamic in Java 7, which was key in the
>     implementation of lambdas in Java 8.
>
>     On Thu, Oct 5, 2017 at 1:14 AM, Daniel Sun
>     <realbluesun@hotmail.com <mailto:realbluesun@hotmail.com>> wrote:
>
>         Nice :)
>
>
>
>         --
>         Sent from:
>         http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html
>         <http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html>
>
>
>
>
>
> -- 
> Guillaume Laforge
> Apache Groovy committer & PMC Vice-President
> Developer Advocate @ Google Cloud Platform
>
> Blog: http://glaforge.appspot.com/
> Social: @glaforge <http://twitter.com/glaforge> / Google+ 
> <https://plus.google.com/u/0/114130972232398734985/posts>


Mime
View raw message