Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9971 > unrolled thread

Static type checking: hybrid mode in Groovy

Started byRobert Klemme <shortcutter@googlemail.com>
First post2011-11-16 00:41 -0800
Last post2011-11-19 11:49 +0100
Articles 11 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Static type checking: hybrid mode in Groovy Robert Klemme <shortcutter@googlemail.com> - 2011-11-16 00:41 -0800
    Re: Static type checking: hybrid mode in Groovy Roedy Green <see_website@mindprod.com.invalid> - 2011-11-17 07:16 -0800
      Re: Static type checking: hybrid mode in Groovy Lew <lewbloch@gmail.com> - 2011-11-17 09:28 -0800
        Re: Static type checking: hybrid mode in Groovy Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-18 08:16 +0000
        Re: Static type checking: hybrid mode in Groovy Roedy Green <see_website@mindprod.com.invalid> - 2011-11-18 02:32 -0800
          Re: Static type checking: hybrid mode in Groovy Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-18 07:35 -0400
          Re: Static type checking: hybrid mode in Groovy Lew <lewbloch@gmail.com> - 2011-11-18 07:23 -0800
      Re: Static type checking: hybrid mode in Groovy Gene Wirchenko <genew@ocis.net> - 2011-11-17 10:25 -0800
        Re: Static type checking: hybrid mode in Groovy markspace <-@.> - 2011-11-17 10:32 -0800
          Re: Static type checking: hybrid mode in Groovy Gene Wirchenko <genew@ocis.net> - 2011-11-17 11:02 -0800
    Re: Static type checking: hybrid mode in Groovy Robert Klemme <shortcutter@googlemail.com> - 2011-11-19 11:49 +0100

#9971 — Static type checking: hybrid mode in Groovy

FromRobert Klemme <shortcutter@googlemail.com>
Date2011-11-16 00:41 -0800
SubjectStatic type checking: hybrid mode in Groovy
Message-ID<61e17074-e229-4303-a549-2389ccf502d3@m10g2000vbc.googlegroups.com>
Folks,

we recently had this discussion about the benefits of STC: Groovy now
takes a hybrid approach and allows to use both.  For the interested
reader:

http://www.jroller.com/melix/entry/groovy_static_type_checker_status

They are trying to have the best of both worlds.

I find this quote noteworthy:

"One of them is that Java programmers who discover Groovy are often
amazed about the conciseness of the language as compared to Java, and
start programming in Groovy like they would in Java, that is to say
with types and leveraging the syntax of Groovy. The key here is that
many programmers never use the dynamic features of Groovy, but rather
use the language as a "better Java syntax"."

Kind regards

robert

[toc] | [next] | [standalone]


#10002

FromRoedy Green <see_website@mindprod.com.invalid>
Date2011-11-17 07:16 -0800
Message-ID<im8ac7t9bge5464b2aesgsnqd6qmf553c8@4ax.com>
In reply to#9971
On Wed, 16 Nov 2011 00:41:36 -0800 (PST), Robert Klemme
<shortcutter@googlemail.com> wrote, quoted or indirectly quoted
someone who said :

>"One of them is that Java programmers who discover Groovy are often
>amazed about the conciseness of the language as compared to Java, and
>start programming in Groovy like they would in Java, that is to say
>with types and leveraging the syntax of Groovy. The key here is that
>many programmers never use the dynamic features of Groovy, but rather
>use the language as a "better Java syntax"."

The verbosity of Java has always bothered me. Early on I lobbied for
various measures to put it on a diet.  The biggest win was for:each.
The Java creators are only now beginning to relax their resistance to
syntactic sugar to make programs terser, hence easier to type and
proofread.

I think the problem was/is:

1. Sun was far more interested in the JVM than the Java language. In
their view, Javac.exe was just a preprocessor for the JVM byte code.
It was a necessary kludge, but of no interest in itself. The innards
of the JVM is the exciting part. Java the language is pretty dull and
clumsy. The WORA comes from the JVM, not a major revolution in the
language.

2. People who write system code think a long time and produce a small
number of carefully-chosen keystrokes, overwhelmingly comments.
Application programmers crank out reams and reams of twaddle.  Thus
system programmers have little motivation to be interested in
terseness.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
I can't come to bed just yet. Somebody is wrong on the Internet. 

[toc] | [prev] | [next] | [standalone]


#10008

FromLew <lewbloch@gmail.com>
Date2011-11-17 09:28 -0800
Message-ID<70683.45.1321550905474.JavaMail.geo-discussion-forums@prms22>
In reply to#10002
Roedy Green wrote:
> Robert Klemme wrote, quoted or indirectly quoted someone who said :
>> "One of them is that Java programmers who discover Groovy are often
>> amazed about the conciseness of the language as compared to Java, and
>> start programming in Groovy like they would in Java, that is to say
>> with types and leveraging the syntax of Groovy. The key here is that
>> many programmers never use the dynamic features of Groovy, but rather
>> use the language as a "better Java syntax"."
> 
> The verbosity of Java has always bothered me. Early on I lobbied for
> various measures to put it on a diet.  The biggest win was for:each.
> The Java creators are only now beginning to relax their resistance to
> syntactic sugar to make programs terser, hence easier to type and
> proofread.

Conciseness is overrated.

> I think the problem was/is:
> 
> 1. Sun was far more interested in the JVM than the Java language. In

Evidence?

> their view, Javac.exe was just a preprocessor for the JVM byte code.
> It was a necessary kludge, but of no interest in itself. The innards
> of the JVM is the exciting part. Java the language is pretty dull and clumsy.

Unsubstantiable opinion.

> The WORA comes from the JVM, not a major revolution in the
> language.
> 
> 2. People who write system code think a long time and produce a small
> number of carefully-chosen keystrokes, overwhelmingly comments.
> Application programmers crank out reams and reams of twaddle.  Thus

Oh, really?

Are you an application programmer?

> system programmers have little motivation to be interested in
> terseness.

Wow.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#10034

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2011-11-18 08:16 +0000
Message-ID<slrnjcc53r.fvg.avl@gamma.logic.tuwien.ac.at>
In reply to#10008
Lew <lewbloch@gmail.com> wrote:
> Conciseness is overrated.

It surely is in languages like Perl.

It is underrated in many other languages,
and it was much underrated in Java up to 1.4

[toc] | [prev] | [next] | [standalone]


#10035

FromRoedy Green <see_website@mindprod.com.invalid>
Date2011-11-18 02:32 -0800
Message-ID<hnccc757k3bpgsmfll1oop6lrtkuqbpko7@4ax.com>
In reply to#10008
On Thu, 17 Nov 2011 09:28:25 -0800 (PST), Lew <lewbloch@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>Conciseness is overrated

What sort of apps do you write?  Over my lifetime I have done a bit of
everything from device drivers, to a Forth engine, to new methods of
solving differential equations  to online banking. That experience
gives me a right to an opinion about how Java fits into the overall
scheme of things.

I have talked with Bill Joy and watched Mr. Gosling lecture. I think I
understand what makes them tick. They are both very intelligent people
who have no interest whatsoever in process of cranking out guis. 

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
I can't come to bed just yet. Somebody is wrong on the Internet. 

[toc] | [prev] | [next] | [standalone]


#10040

FromArved Sandstrom <asandstrom3minus1@eastlink.ca>
Date2011-11-18 07:35 -0400
Message-ID<tqrxq.43494$Ra6.21590@newsfe07.iad>
In reply to#10035
On 11-11-18 06:32 AM, Roedy Green wrote:
> On Thu, 17 Nov 2011 09:28:25 -0800 (PST), Lew <lewbloch@gmail.com>
> wrote, quoted or indirectly quoted someone who said :
> 
>> Conciseness is overrated
> 
> What sort of apps do you write?  Over my lifetime I have done a bit of
> everything from device drivers, to a Forth engine, to new methods of
> solving differential equations  to online banking. That experience
> gives me a right to an opinion about how Java fits into the overall
> scheme of things.
> 
> I have talked with Bill Joy and watched Mr. Gosling lecture. I think I
> understand what makes them tick. They are both very intelligent people
> who have no interest whatsoever in process of cranking out guis. 
> 
Yeah, but that last phrase in that last sentence is not the same thing
as your assertion that "application programmers crank out reams and
reams of twaddle". Or for that matter, your related statement that
"People who write system code think a long time and produce a small
number of carefully-chosen keystrokes, overwhelmingly comments".

"Cranking out guis" != application programming. And it sounds like
you've got an obsolete and somewhat quaint picture of system programming.

As an example of software that most definitely doesn't fit your
worldview, try most anything by James Clark, including groff, and highly
influential XML and SGML parsers. Hint: none of these are systems software.

AHS
-- 
You should know the problem before you try to solve it.
Example: When my son was three he cried about a problem with his hand. I
kissed it several times and asked him about the problem. He peed on his
hand.
-- Radia Perlman, inventor of spanning tree protocol

[toc] | [prev] | [next] | [standalone]


#10043

FromLew <lewbloch@gmail.com>
Date2011-11-18 07:23 -0800
Message-ID<17804106.47.1321629825213.JavaMail.geo-discussion-forums@prfx4>
In reply to#10035
On Friday, November 18, 2011 2:32:56 AM UTC-8, Roedy Green wrote:
> On Thu, 17 Nov 2011 09:28:25 -0800 (PST), Lew <lewb...@gmail.com>
> wrote, quoted or indirectly quoted someone who said :
> 
> >Conciseness is overrated
> 
> What sort of apps do you write?  Over my lifetime I have done a bit of

Everything imaginable over the years, from device drivers to web apps to enterprise apps to desktop apps to GUI-driven apps to middleware to back-end components to Android mobile apps.  FORTRAN, assembler, C, C++, SQL, Java and others for programming languages, plus a fair amount of things like shell, Perl, Javascript and such for scripting.  (I forbear to mention JCL.)  Mainframes, minicomputers, PCs, mobile, embedded.  Big shops, solo programmer, government agencies, private businesses.  

> everything from device drivers, to a Forth engine, to new methods of

I haven't written a Forth engine but I've written some toy Forth programs.
> solving differential equations  to online banking. That experience

Similar.  I've worked on scientific, financial, health-care, government and private-industry apps.

> gives me a right to an opinion about how Java fits into the overall
> scheme of things.

Yes, it would do that.  And ...?

We all have the right to an opinion about how Java fits into the overall scheme of things, even those of us with minimal experience.  The question is whether our opinion has merit.

Yours does, AFAICT.

My experience is also quite extensive.

> I have talked with Bill Joy and watched Mr. Gosling lecture. I think I
> understand what makes them tick. They are both very intelligent people
> who have no interest whatsoever in process of cranking out guis. 

So?

I'm sorry, Roedy, but how does all this tie in to this discussion?

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#10012

FromGene Wirchenko <genew@ocis.net>
Date2011-11-17 10:25 -0800
Message-ID<4njac7ttrpfca17vtgcesuq9buli0hgls3@4ax.com>
In reply to#10002
On Thu, 17 Nov 2011 07:16:09 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote:

>On Wed, 16 Nov 2011 00:41:36 -0800 (PST), Robert Klemme
><shortcutter@googlemail.com> wrote, quoted or indirectly quoted
>someone who said :
>
>>"One of them is that Java programmers who discover Groovy are often
>>amazed about the conciseness of the language as compared to Java, and
>>start programming in Groovy like they would in Java, that is to say
>>with types and leveraging the syntax of Groovy. The key here is that
>>many programmers never use the dynamic features of Groovy, but rather
>>use the language as a "better Java syntax"."
>
>The verbosity of Java has always bothered me. Early on I lobbied for
>various measures to put it on a diet.  The biggest win was for:each.
>The Java creators are only now beginning to relax their resistance to
>syntactic sugar to make programs terser, hence easier to type and
>proofread.

     I can live with some verbosity.  There will always be edge cases
that require special handling.  Where I take issue with Java is that
normal, run-of-the-garden case often require verbosity.  A bit here, a
bit there: it adds up to a tangle.

     In the preprocessor that I was working on, an if condition ended
up taking quite a bit of screen width.  I added a method so it would
simplify this.  In many other languages, all I would have to have
written was something like:
          if (cParsedWord=="$define")
Instead, I had to write:
          if (cParsedWord.equals("$define"))
Without that method, it was something like:
          if (cParsedWord.Value.toString().equals("$define"))
The method that hid the verbiage was in this class:
   VRStringB
    (
    StringBuilder Init
    )
      {
      this.Value=Init;
      }

   boolean equals
    (
    String theString
    )
      {
      return this.Value.toString().equals(theString);
      }

   void Set
    (
    String theString
    )
      {
      this.Value.replace(0,this.Value.length(),theString);
      }
   }
And I had that class in the first place, because Java does not have
call-by-reference.

     Death by a thousand cuts.

[snip]

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#10013

Frommarkspace <-@.>
Date2011-11-17 10:32 -0800
Message-ID<ja3k0o$9jv$1@dont-email.me>
In reply to#10012
On 11/17/2011 10:25 AM, Gene Wirchenko wrote:
> written was something like:
>            if (cParsedWord=="$define")
> Instead, I had to write:
>            if (cParsedWord.equals("$define"))
> Without that method, it was something like:
>            if (cParsedWord.Value.toString().equals("$define"))


In all honesty, I prefer the last one.  At least I can see what is going 
on, and I don't think it is long at all.  There are plenty of good 
examples where Java is verbose.  This isn't one of them.

And overriding "equals" in this way is pernicious.


[[Snipped a lot of very nasty source code]]
>     void Set
>      (
>      String theString
>      )
>        {
>        this.Value.replace(0,this.Value.length(),theString);
>        }
>     }

>
>       Death by a thousand cuts.


If you're referring to whomever invented that source formatting style, 
then yeah, it's grody.  But that's not Java's fault.

[toc] | [prev] | [next] | [standalone]


#10014

FromGene Wirchenko <genew@ocis.net>
Date2011-11-17 11:02 -0800
Message-ID<agmac7do881omd5af4mj7itrkmg10o6hav@4ax.com>
In reply to#10013
On Thu, 17 Nov 2011 10:32:54 -0800, markspace <-@.> wrote:

>On 11/17/2011 10:25 AM, Gene Wirchenko wrote:
>> written was something like:
>>            if (cParsedWord=="$define")
>> Instead, I had to write:
>>            if (cParsedWord.equals("$define"))
>> Without that method, it was something like:
>>            if (cParsedWord.Value.toString().equals("$define"))

>In all honesty, I prefer the last one.  At least I can see what is going 
>on, and I don't think it is long at all.  There are plenty of good 
>examples where Java is verbose.  This isn't one of them.

     Um, the condition is twice the length of other languages'
equivalents.

>And overriding "equals" in this way is pernicious.

     Why?  I was checking for equality.

[snip]

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#10064

FromRobert Klemme <shortcutter@googlemail.com>
Date2011-11-19 11:49 +0100
Message-ID<9ipfu2F5kaU2@mid.individual.net>
In reply to#9971
On 11/16/2011 09:41 AM, Robert Klemme wrote:
> Folks,
>
> we recently had this discussion about the benefits of STC: Groovy now
> takes a hybrid approach and allows to use both.  For the interested
> reader:
>
> http://www.jroller.com/melix/entry/groovy_static_type_checker_status
>
> They are trying to have the best of both worlds.

Interesting: the discussion solely seems to revolve around the "better 
syntax" quote and nobody talks about the hybrid type checking approach. 
  It's always fun to see how threads evolve in totally unexpected 
directions. :-)

Kind regards

	robert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web