[jira] [Comment Edited] (GROOVY-8329) Consider statically typed/compiled as default for Groovy 3.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (GROOVY-8329) Consider statically typed/compiled as default for Groovy 3.0

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/GROOVY-8329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16187335#comment-16187335 ]

Jochen Theodorou edited comment on GROOVY-8329 at 10/12/17 10:44 PM:
---------------------------------------------------------------------

Guys, I think discussions like this should ultimately happen on the user mailing list. Here you will find mostly the developers and the devlopers might have a different view on things than actual user, even though the groups overlap of course.

For development let us change the discussion here. Let us not talk about the default.

Let us talk about what would be if we had a command line option to switch and you would have to set it.... or decide at the API-Level what is the default. What must happen for proper support of both modes?

* config script support does not really matter then anymore
* IDE support needs an option to switch modes for Intelllij, Netbeans and Eclipse.

What would be different with file endings? It is an implicit option. That means you loose this ending for the dynamic mode. I have to mention here, that the Groovy compiler does not care about file endings at all. You just feed the compiler files and the compiler treats them as Groovy source files.... even if they for example have the file ending html. IDE support could be a bit more easy, since you do not need an UI option anymore, And at least in Intellij would be able to handle this right away. The problem here, we have to choose a file ending, and even if that would not be .groovy, it would be still a breaking change.

A third option would be to not have a simple option, but to enable the user to give file endings, which are to be (non-)static compiled by default. That is of course a lot more than just a simple switch, but it would be the most flexible solution



was (Author: blackdrag):
Guys, I think discussions like this should ultimately happen on the user mailing list. Here you will find mostly the developers and the devlopers might have a different view on things than actual user, even though the groups overlap of course.

For development let us change the discussion here. Let us not talk about the default.

Let us talk about what would be if we had a command line option to switch and you would have to set it.... or decide at the API-Level what is the default. What must happen for proper support of both modes?

* config script support does not really matter then anymore
* IDE support needs an option to switch modes for Intelllij, Netbeans and Eclipse.

What would be different with file endings? It is an implicit option. That means you loose this ending for the dynamic mode. I have to mention here, that the Groovy compiler does not care about line endings at all. You just feed the compiler files and the compiler treats them as Groovy source files.... even if they for example have the file ending html. IDE support could be a bit more easy, since you do not need an UI option anymore, And at least in Intellij would be able to handle this right away. The problem here, we have to choose a file ending, and even if that would not be .groovy, it would be still a breaking change.

A third option would be to not have a simple option, but to enable the user to give file endings, which are to be (non-)static compiled by default. That is of course a lot more than just a simple switch, but it would be the most flexible solution


> Consider statically typed/compiled as default for Groovy 3.0
> ------------------------------------------------------------
>
>                 Key: GROOVY-8329
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8329
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Endre StĂžlsvik
>
> Personally, I do not understand why anyone would ever want to drop typing from JVM based languages (or in any other language, for that matter). Thus, I only started using Groovy "for real" when I discovered the @CompileStatic annotation, which really made everything great!
> If I could choose, I'd go for statically typed by default, with @DynamicCompile or somesuch as an annotation I could turn on for methods that uses the XML parsing features etc.
> To me, it seems like more and more people are realizing that statically typed languages is the way to go, notice e.g. TypeScript, Facebook's retrofitting of types onto PHP with Hack, and even PHP's own typing in PHP 7.
> Now with Kotlin joining the fray of JVM-based languages, whose literally first two words on the wepage is "statically typed", getting special support in Spring, and - notably - getting full support in Gradle, I'd say that this applies more than ever. If Groovy "looses Gradle" to Kotlin due to the ability to get a statically typed build script (oh, the joy!), I believe Groovy will have a much harder time attracting new users. Turning Groovy into one of the statically typed JVM languages, instead of hampering users with "everything is an Object"-based runtime resolution, will increase the appeal of the language.
> The 3.0 can be a great point to change this. It could of course be reverted back to previous logic by some -D switch (would need support in IDEs too, I guess), or by sticking some magic "whole-sale annotation" at the top of the source file, or something like this.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)