Picon

Fwd: [jira] Closed: (GROOVY-4905) polymorphic static methods

After response of Jochen Theodorou I decided discuss this feature on mailing list...

  I proposed, as real Object Oriented languages (smalltalk,...) does, that "this" on static method references the Class that receive the message (method) instead of the Class that declare the method.

  Example:

     class A {
       public static foo() {
         println("foo: " + this);
       }
     }

     class B extends A {}

     class C extends B {}
 
  Calling "foo" method with subclasses:

     A.foo(); // class A is the "foo" message receptor
     B.foo(); // class B is the "foo" message receptor
     C.foo(); // class C is the "foo" message receptor

  Now returns:

     foo: class A
     foo: class A
     foo: class A

  I Propose that result must be:

     foo: class A
     foo: class B
     foo: class C




Thank you

---------- Forwarded message ----------
From: Jochen Theodorou (JIRA) <jira-yCVjj/EcxBJg9hUCZPvPmw@public.gmane.org>
Date: Mon, Jun 27, 2011 at 4:50 PM
Subject: [jira] Closed: (GROOVY-4905) polymorphic static methods
To: jose.illescas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org



    [ https://jira.codehaus.org/browse/GROOVY-4905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Theodorou closed GROOVY-4905.
------------------------------------

   Resolution: Won't Fix
     Assignee: Jochen Theodorou

"this" has already a meaning different then what you suggest in a static context. So this change would be a breaking change. I suggest the mailing list for further discussion, if needed

> polymorphic static methods
> --------------------------
>
>                 Key: GROOVY-4905
>                 URL: https://jira.codehaus.org/browse/GROOVY-4905
>             Project: groovy
>          Issue Type: New Feature
>            Reporter: joseaio
>            Assignee: Jochen Theodorou
>
> Nex Class Hierarchy: A < B < C
>   class A {
>     public static foo() {
>       println("foo: "+ this);
>     }
>   }
>   class B extends A {}
>   class C extends B {}
> Calling "foo" method with subclasses:
>   A.foo(); // class A is the "foo" message receptor
>   B.foo(); // class B is the "foo" message receptor
>   C.foo(); // class C is the "foo" message receptor
> Returns:
>
>   foo: class A
>   foo: class A
>   foo: class A
> On Object Oriented "this" references message receptor (on static method is the Class)...
> Then the result must be:
>   foo: class A
>   foo: class B
>   foo: class C

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



Guillaume Laforge | 25 Apr 20:21
Picon
Gravatar

Groovy 1.5.6 is out!

Hi all,

G2One and the Groovy development team is pleased to announce the
release of Groovy 1.5.6, a bug fix release for the stable Groovy 1.5.x
branch.

A regression introduced in 1.5.5 was fixed, and 35 bugs have been
resolved (generics, MOP, and joint compiler issues, better line
information for IDE support, etc)

As usual, you can download the latest Groovy dustribution here:
http://groovy.codehaus.org/Download

And read the change log to know all the details there:
http://jira.codehaus.org/browse/GROOVY?report=com.atlassian.jira.plugin.system.project:changelog-panel

Enjoy!

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 5 Apr 19:10
Picon
Gravatar

Fwd: final Groovy JSR?

Wasn't delivered.

---------- Forwarded message ----------
From: Bill Shannon <bill.shannon@...>
Date: Sat, Apr 5, 2008 at 12:40 AM
Subject: Re: final Groovy JSR?
To: Guillaume Laforge <glaforge@...>
Cc: jsr-241-comments@..., Groovy JSR <jsr@...>

Guillaume Laforge wrote:

>
> >  For example, do you expect people to write libraries using Groovy,
> >  which they would distribute as jar files?
> >
>
> Right.
> This has always been possible (as long as you have the Groovy runtime
> on your classpath).
>

 But what if the library is compiled by Foo's Groovy compiler and my
 program using the library is compiled by Bar's Groovy compiler?

 You have to decide whether this is important and/or likely.  I agree
 you can probably ignore this for the first version.

 Will this get any easier in Java SE 7 with the new dynamic language
 bytecode?

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 5 Apr 19:10
Picon
Gravatar

Fwd: final Groovy JSR?

Wasn't delivered.

---------- Forwarded message ----------
From: Bill Shannon <bill.shannon@...>
Date: Fri, Apr 4, 2008 at 11:59 PM
Subject: Re: final Groovy JSR?
To: Guillaume Laforge <glaforge@...>
Cc: jsr-241-comments@..., Groovy JSR <jsr@...>

Guillaume Laforge wrote:

> On Sat, Mar 22, 2008 at 8:24 PM, Bill Shannon <bill.shannon@...> wrote:
>
> > [...]
> >  You need a spec that's sufficient for someone else to implement
> >  Groovy support without reference to your code.  I don't know that
> >  much about Groovy, but you might want to split the spec into a
> >  language/compiler portion and a runtime portion (assuming runtime
> >  support beyond what's in Java SE is needed).
> >
>
> What do you mean by language/compiler portion, and runtime portion exactly?
> I just want to be sure I understood correctly.
> For the language part, we need to explain the semantics of the
> language, its grammar, etc.
> For the runtime part, you mean things like the libraries? ie. a
> closure class, a GString class, etc.
> Is that what you meant?
>

 Yes, exactly.

> Back on the level of integration mentioned above, and on this
> portability / interoperability aspect, Groovy mandates a seamless
> integration with Java. But does it mean we'd also mandate a perfect
> interoperability with other Groovy implementations?
>

 I think it would be better if you did, but it's up to you to decide.

> The fact Groovy is a dynamic language, with a MOP, a double dispatch
> system, means that we rely on some proprietary APIs for generating
> bytecode, for handling method calls, doing some clever call site
> caching techniques, etc.
>
> If we'd choose to totally specify these aspects, it'd mean that we
> couldn't extend Groovy or improve its performance by introducing other
> improvement techniques or that we could evolve the underlying code
> generation classes.
>
> Is it okay if we dont specify these to avoid restraining further
> development, perhaps at the cost of making two compiled Groovy classes
> incompatible if compiled with two different compilers?
>
> Obviously, it's a problem Java doesn't have since it's a statically
> compiled language.
>

 You're allowed to make that choice.  It's up to your expert group to
 decide whether that's a good choice.  Personally, I think this might
 be acceptable for a first release, but long term it will limit
 acceptance of Groovy.  But you should work through the scenarios for
 how you expect people to use Groovy to see if it will be an issue for
 you.  For example, do you expect people to write libraries using Groovy,
 which they would distribute as jar files?

>
> >  In addition to the actual tests in the test suite, you get to decide
> >  what the rules are for running your test suite.  Do people have to
> >  run the binaries in your test suite?  Are they allowed to recompile
> >  your test suite with any arbitrary compiler?  Can they modify the tests
> >  in your test suite?  Are they allowed to extend the Groovy language or
> >  Groovy APIs to add their own value-added, non-standard features?  What
> >  exactly is considered "passing" your test suite?  If someone questions
> >  whether tests in your test suite are correct, how do they interact with
> >  you to get a fix?
> >
>
> And where these rules should be explained? In the TCK itself?
>

 We include them in the TCK User's Guide.

>
> >  We have a set of rules we use for all Sun TCKs, and we can give you a
> >  template you can start with for these compatibility test suite rules.
> >
>
> I'd be interested in seeing these rules.
>

 Let me figure out how to get them to you.

>
> >  Of course, we also have an (open source) test suite harness, but you're
> >  free to use whatever harness you want.  The major advantage of using
> >  our harness is that it makes it easier to integrate your TCK with a
> >  Java platform TCK, if your JSR were to be included as part of a Java
> >  platform specification.  That may not be an issue for you.
> >
>
> Have you got something in mind here? :-) (ie. integrating Groovy in the JDK)
>

 No, I didn't have anything specific in mind.  This has been an issue
 for a few other JSRs, but I don't expect it to be an issues for you.

 We're very interested in having Groovy work well with GlassFish, but
 I don't think we'll be proposing to include it in Java EE or Java SE
 anytime soon.  :-)

> I haven't looked yet at the OpenJDK project.
> Is the test harness available in the OpenJDK project?
> Is there any place explaining how this test harness is working?
>

 https://jtharness.dev.java.net/

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 5 Apr 00:33
Picon
Gravatar

Re: final Groovy JSR?

On Fri, Apr 4, 2008 at 11:59 PM, Bill Shannon <bill.shannon@...> wrote:
> [...]
> > Back on the level of integration mentioned above, and on this
> > portability / interoperability aspect, Groovy mandates a seamless
> > integration with Java. But does it mean we'd also mandate a perfect
> > interoperability with other Groovy implementations?
> >
>
>  I think it would be better if you did, but it's up to you to decide.

Yes, for sure, conceptually speaking, this would be desired.
For Java, this is simpler as a call to a method is directly encoded in
the bytecode.
No intermediary layer of indirection.
It then just depends on the runtime part (JDK classes, third party
libraries, etc)
But for a dynamic language, in the bytecode you'll find some calls to
utility classes handling the double dispatch.
Some of them are public APIs (which will be part of the JSR), but
others may be present that are specific to each implementation.
So we'll have to think deeper as to what we really want to make portable or not.
Tricky issue :-)

> [...]
>  You're allowed to make that choice.  It's up to your expert group to
>  decide whether that's a good choice.  Personally, I think this might
>  be acceptable for a first release, but long term it will limit
>  acceptance of Groovy.  But you should work through the scenarios for
>  how you expect people to use Groovy to see if it will be an issue for
>  you.  For example, do you expect people to write libraries using Groovy,
>  which they would distribute as jar files?

Right.
This has always been possible (as long as you have the Groovy runtime
on your classpath).
We can seamlessly integrate with Java, or any other alternative
language for the JVM.
But the problem comes when we have to be compatible between different
implementations of Groovy.
At the basic object level, things are just fine, but it's when you get
into metaprogramming techniques that this may be more problematic to
achieve that goal.
We'll see if it's doable or not, but I suspect we won't go as far in
the first version of the spec.

> [...]
>  We include them in the TCK User's Guide.
> [...]
>  Let me figure out how to get them to you.
> [...]
> https://jtharness.dev.java.net/

Great, thanks a lot for the link.

> > Have you got something in mind here? :-) (ie. integrating Groovy in the
> JDK)
>
>  No, I didn't have anything specific in mind.  This has been an issue
>  for a few other JSRs, but I don't expect it to be an issues for you.
>
>  We're very interested in having Groovy work well with GlassFish, but
>  I don't think we'll be proposing to include it in Java EE or Java SE
>  anytime soon.  :-)

Then what's the poing of making a JSR? ;-)))

Thanks again Bill for your explanations, the links, and your fast replies!
This is very much appreciated.

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 4 Apr 23:41
Picon
Gravatar

Re: final Groovy JSR?

Bonjour Liz,

On Wed, Mar 26, 2008 at 11:37 AM, Liz M Kiener <Liz@...> wrote:
>
>  Bonjour Guillaume -
>
>  It has been a while since you took over this JSR and we corresponded last.
> Your next stage for this JSR is the EDR.  You should have seen email from me
> regarding any planned stages before JavaOne.

Alright, I saw it.
It'll take me some time to get the EDR finished, and it won't be before JavaOne.

> Will you make it to San Francisco for JavaOne?

Yes.

> The PMO will once again host an EG meeting room.

Yup, I saw that, this is handy.

> I am attaching the EDR presentation for you outlining the deliverables for
> submission to the PMO.  You may want to take the opportunity to put an
> update on the Community Update Page of the JSR and send me a schedule update
> for the JSR detail page.
>
>  If you have any questions please contact me.

Merci beaucoup :-)

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 4 Apr 23:38
Picon
Gravatar

Re: final Groovy JSR?

Hi Bill,

Thanks a lot for your explanations.
I haven't been able to answer earlier, I'm sorry.

Some comments inline.

On Sat, Mar 22, 2008 at 8:24 PM, Bill Shannon <bill.shannon@...> wrote:
> [...]
>  You need a spec that's sufficient for someone else to implement
>  Groovy support without reference to your code.  I don't know that
>  much about Groovy, but you might want to split the spec into a
>  language/compiler portion and a runtime portion (assuming runtime
>  support beyond what's in Java SE is needed).

What do you mean by language/compiler portion, and runtime portion exactly?
I just want to be sure I understood correctly.
For the language part, we need to explain the semantics of the
language, its grammar, etc.
For the runtime part, you mean things like the libraries? ie. a
closure class, a GString class, etc.
Is that what you meant?

> Do you want someone
>  else to be able to implement a Groovy compiler that generates code
>  that works with your runtime?  And vice versa?  And if the Groovy
>  compiler or interpreter needs to be available to applications at
>  runtime, how does that work and what level of mix-and-match do you
>  want to support?

Okay, it's up to us to decide the level of integration the spec
mandates or not for a language to be considered a valid Groovy
implementation. Furthermore the TCK will help ensure this.

> Very precise syntax specifications for a language
>  are critical, but you also need to specify the semantics as precisely
>  as possible.  This kind of specification is different than the
>  typical user documentation people produce; rather than describing how
>  it *does* work, you have to describe how it *must* work, in sufficient
>  detail that someone else implementing your specification will end up
>  with behavior the same as yours, without reference to your code or
>  (ideally) your implementation.  In cases where the specification isn't
>  sufficiently complete, we often rely on the behavior of the reference
>  implementation to determine what is intended, although independent
>  implementors of the specification don't really like it when we do that.

Ok, that makes perfect sense.

>  You also need a test suite that tests as much of this as you think
>  is necessary to ensure application portability and interoperability.

Back on the level of integration mentioned above, and on this
portability / interoperability aspect, Groovy mandates a seamless
integration with Java. But does it mean we'd also mandate a perfect
interoperability with other Groovy implementations?

The fact Groovy is a dynamic language, with a MOP, a double dispatch
system, means that we rely on some proprietary APIs for generating
bytecode, for handling method calls, doing some clever call site
caching techniques, etc.

If we'd choose to totally specify these aspects, it'd mean that we
couldn't extend Groovy or improve its performance by introducing other
improvement techniques or that we could evolve the underlying code
generation classes.

Is it okay if we dont specify these to avoid restraining further
development, perhaps at the cost of making two compiled Groovy classes
incompatible if compiled with two different compilers?

Obviously, it's a problem Java doesn't have since it's a statically
compiled language.

>  We all recognize that there is no such thing as a "complete" test suite,
>  and a high quality test suite is a lot of work.  You get to decide how
>  complete the test suite needs to be, and the JCP EC gets to decide
>  whether it's "complete enough" when they approve your JSR.  The more
>  likely it is that there will be independent implementations, the more
>  important it is to have a high quality test suite.  If you expect
>  everyone to use your implementation, you can probably get by with less.

Ok.

>  In addition to the actual tests in the test suite, you get to decide
>  what the rules are for running your test suite.  Do people have to
>  run the binaries in your test suite?  Are they allowed to recompile
>  your test suite with any arbitrary compiler?  Can they modify the tests
>  in your test suite?  Are they allowed to extend the Groovy language or
>  Groovy APIs to add their own value-added, non-standard features?  What
>  exactly is considered "passing" your test suite?  If someone questions
>  whether tests in your test suite are correct, how do they interact with
>  you to get a fix?

And where these rules should be explained? In the TCK itself?

>  We have a set of rules we use for all Sun TCKs, and we can give you a
>  template you can start with for these compatibility test suite rules.

I'd be interested in seeing these rules.

>  In addition to "run rules" and process issues, our TCK rules also
>  describe things that we want to be true of any implementation, but for
>  which there's no easy way to test.  Especially important to us is the
>  issue of language extensions, but you get to decide what rules you want
>  to enforce for your language.

Ok.

>  Of course, we also have an (open source) test suite harness, but you're
>  free to use whatever harness you want.  The major advantage of using
>  our harness is that it makes it easier to integrate your TCK with a
>  Java platform TCK, if your JSR were to be included as part of a Java
>  platform specification.  That may not be an issue for you.

Have you got something in mind here? :-) (ie. integrating Groovy in the JDK)

I haven't looked yet at the OpenJDK project.
Is the test harness available in the OpenJDK project?
Is there any place explaining how this test harness is working?

>  In terms of process, there's lots of information available on jcp.org.
>  You should of course produce a Public Draft specification, collect
>  comments from the public, incorporate those comments as appropriate,
>  produce a Proposed Final Draft specification, and eventually submit
>  your JSR for a Final Approval Ballot.

Ok.

>  I hope that helps.  Please feel free to ask if you have any more questions.

I'm sure I'll have many more questions along the way!

>  I'm looking forward to a final Groovy specification!  We're very excited
>  about supporting Groovy in GlassFish!

Thanks a lot for those great explanations and these kind words.

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 22 Mar 14:46
Picon
Gravatar

Re: final Groovy JSR?

Hello Bill,

On Fri, Mar 21, 2008 at 7:25 PM, Bill Shannon <bill.shannon-xsfywfwIY+M@public.gmane.org> wrote:
I see that the Groovy JSR has been going for about 4 years now,
and the implementation is up to version 1.5.x, but there's still
no Public Draft or Proposed Final Draft of the spec.  When do you
expect to complete the JSR?

Very good question. Actually, after a long period of hibernation on the JSR front, we're resuming work on it in the upcoming months.

But we'd be happy to have some guidance to the steps to follow, and details of the key deliverables that are expected to ship with the JSR.

So far, the RI is there, of course, in the shape of Groovy 1.5.4.
The TCK is not split from the Groovy test suites, so we'd need to find an easy way for people to reuse it if they want to develop a compatible Groovy language.
On the spec side, we have the language grammar in an EBNF and diagram form, but what is still missing is the writing of the formal specification document, beyond our online documentation or the books we've written on the topic.

--
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com
Guillaume Laforge | 17 Dec 00:50
Picon
Gravatar

Tentative Roadmap

Dear Groovy developers,

Now that we have released 1.5, it is time to think about the future of Groovy, by discussing its roadmap.

After some discussions at GDC#4 ( http://docs.codehaus.org/display/GroovyJSR/GDC4+Discussions), on the lists, and elsewhere, we've listed possible improvements and new features.

Jochen and myself compiled a tentative roadmap this weekend, taking these ideas into account and trying to lay them out across potential release numbers.

This is a tentative roadmap.
Certain features can be discussed, whether we do want them or not.
And there's room for moving features from one to another release.
New ideas missing can also be introduced.
So it's still pretty open at the moment.

Note that the roadmap can change across the course of time according to the progress (or lack thereof) we make on the GEPs (Groovy Extension Proposals).
It is not set in stone today, even after our upcoming discussions. The GEPs will drive us through the releases.
It is very important that we try to clearly define what we want to do in the coming releases, and not just commit blindly any cool hacks :-)
We need to have crystal clear scope and semantics for all major features.

First of all, the basic idea: instead of one huge release a year with several betas and RCs, it'd be great if we could make more frequent releases (with a few betas and RCs) every two or three months or so, but containing a lower number of major features. So ideally, we could release 1.6 / 1.x throughout the year, with a bigger 2.0 at then end of next year with a reworked MOP system.

There are three main kind of releases:
- 1.5.x will provide some patches to the 1.5 final release
- 1.6 / 1.x will introduce a few major features at each release depending on the completeness of the GEPs
- and 2.0 will focus on the reworked MetaClass runtime system and will be worked on in parallel to the other 1.x releases.

Ideally, we should try to release 1.5.1 next week, before Christmas, with the current fixes for the Ant builder, the dead lock in the class loader.
And probably a 1.5.2 when we find the concurrency issue we have on parallel environments.

Without further ado, here's the proposed Roadmap.
The GEPs will be there for defining the exact scope of the major features by giving some finer-grained details of the content of the upcoming releases.
I'll publish this roadmap on the JSR wiki.

Groovy Roadmap

Groovy 1.5.1

  • Bug fix release
  • Deadlock in GroovyClassLoader
  • Problem with Ant tasks

Groovy 1.5.2

  • Bug fix release
  • Concurrency issues (unless it's fixed in 1.5.1)

Groovy 1.6

  • Based on JDK 1.5 with Retro* version available for JDK 1.4
    • Make sure we can run the unit tests with the retro-weaved jar to ensure compatibility
  • Annotation definition in Groovy
    • Currently, annotations can't be defined in Groovy, only used
  • Multiple assignment
    • GEP
      • Define the exact scope of multiple assignment by revisiting the existing GEP page

Groovy 1.7

  • Upgrade to ASM 3
    • if necessary or deemed useful (more efficient bytecode?)
  • Groovy incremental compiler
    • Especially useful for the Eclipse plugin
  • AST transformations
    • GEP
      • reuse of annotations or not
      • exact scope of those transformations
    • pluggable AST transformations for advanced DSL or integration cases

Groovy 1.8

  • Nested Classes & Anonymous Inner Classes
    • GEP
      • The exact semantics with relationship to the MOP should be properly defined through a GEP

Groovy 1.9

  • Upgrade to Antlr 3
    • We'll be able to use the tooling support accompanying Antlr 3
  • Concurrency features
    • GEP
      • Define what coverage we'd like to bring
      • Rollback the iterator features to properly discuss them first
      • Work on this theme first as a module, and if deemed right, we can bring it back to groovy-core

Groovy 2.0

  • New MetaClass system
    • Benchmark test suites to track progress of performance across releases
    • GEP
      • defining the scope of changes
      • describing the new system
      • proposals of a more homogeneous system
      • homogenize categories, EMCs, custom metaclasses
      • homogenize the configuration / declaration / convetions
      • have per-thread / scoped EMCs (like categories)
      • per-module/library metaclasses



--
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com
Guillaume Laforge | 9 Dec 16:26
Picon
Gravatar

What's new in Groovy 1.5?

Hi all,

After the announcement of the release of Groovy 1.5, as promised in
the release notes, here's a detailed article on what's new in Groovy
1.5.

Read it on InfoQ:
http://www.infoq.com/articles/groovy-1.5-new

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Guillaume Laforge | 8 Dec 00:41
Picon
Gravatar

Groovy 1.5 is there!

Hi all,

I'm very pleased to announce the release of Groovy 1.5.

You can read the release notes there:
http://docs.codehaus.org/display/GROOVY/2007/12/07/Groovy+1.5+released

An upcoming article on InfoQ will give you a more in-depth overview of
this new version.

Thanks a lot to everybody: developers, contributors, users.
Without you, Groovy wouldn't be the great dynamic language it is today.

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Gmane