Dart unveiled

150 views
Skip to first unread message

Fabrizio Giudici

unread,
Oct 10, 2011, 5:24:45 AM10/10/11
to java...@googlegroups.com
So, it seems Dart has been officially unveiled. The website:
http://www.dartlang.org/

Found some comment about the GOTO presentation, even though I presume many
more detailed ones will come later:

http://news.cnet.com/8301-30685_3-20117924-264/google-debuts-dart-a-javascript-alternative/

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it

Simon Ochsenreither

unread,
Oct 10, 2011, 7:48:10 AM10/10/11
to java...@googlegroups.com
Very disappointing.

It is 2011 and the language designers repeated every single mistake made before?

They mixed the worst parts of Java with the worst parts of JavaScript and the result is not just bad, it is almost PHP-scale bad (but with Generics! (which are broken)).

Still shaking my head...

Casper Bang

unread,
Oct 10, 2011, 8:04:58 AM10/10/11
to java...@googlegroups.com
Care to elaborate on that? Is it the laxed type-checking you don't like? I rather like catering to prototyping which btw. you will find in many other new languages (Fantom, C#...). Let static-analysis be a tool rather than handcuffs.

Simon Ochsenreither

unread,
Oct 10, 2011, 9:31:49 AM10/10/11
to java...@googlegroups.com
As far as I have seen there is no type checking at all. Actually writing the “types” doesn't change much, they still blow up at runtime as before.
I think that “handcuff” straw man is more or less a Java straw man.

We had more or less the thing you propose with C. Lint and ton of other tools tried it, but it wasn't that great in practice.

phil swenson

unread,
Oct 10, 2011, 1:17:57 PM10/10/11
to java...@googlegroups.com
I can't believe the semicolon has survived.  wtf!?

I would prefer a statically checked coffee-script.  now that would be sweet.


--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.


opinali

unread,
Oct 10, 2011, 3:45:46 PM10/10/11
to java...@googlegroups.com

Ricky Clarkson

unread,
Oct 10, 2011, 3:47:42 PM10/10/11
to java...@googlegroups.com
Yeah, seems to have a similar model to Groovy.  The environment on the webpage does give warnings for type errors but they should be errors.

--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/3tp50ilyuSoJ.

To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.

clay

unread,
Oct 10, 2011, 4:17:44 PM10/10/11
to The Java Posse
A big JavaScript limitation is their limited dependency/modularity
support. You just include JavaScript source from HTML, which is
simple, but for more larger applications with complex dependency
graphs, this is a significant deficiency. Python has eggs, Ruby has
gems, Java has a ton of stuff in this area: .jars/Maven/OSGi, and soon
Jigsaw. Apparently, Dart doesn't change this at all, which is
disappointing.

I'm surprised how conservative Dart is. It definitely cleans up lots
of small items like the JavaScript Prototype stuff which was a bad
idea to begin with.

Cédric Beust ♔

unread,
Oct 10, 2011, 4:24:01 PM10/10/11
to java...@googlegroups.com
Very nice summary, Osvaldo, and I agree with your assessment overall: this looks promising.

-- 
Cédric




On Mon, Oct 10, 2011 at 12:45 PM, opinali <opi...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/Wfjnf6lMoi8J.

Fabrizio Giudici

unread,
Oct 10, 2011, 4:27:51 PM10/10/11
to java...@googlegroups.com, Cédric Beust ♔
On Mon, 10 Oct 2011 22:24:01 +0200, Cédric Beust ♔ <ced...@beust.com>
wrote:

> Very nice summary, Osvaldo, and I agree with your assessment overall:
> this
> looks promising.

Before making my own opinion I need to read more examples and eventually
find the time to write something in it. I have a small photo gallery
software (yeah, yet another) made in JavaScript and if it's confirmed, as
I seem to understand, that one can write in Dart and translate to JS for
deploying everywhere already today, I could try to translate it.

For what I've seen so far, I second Osvaldo and Cédric.

opinali

unread,
Oct 10, 2011, 7:02:06 PM10/10/11
to java...@googlegroups.com, Cédric Beust ♔
I think (obviously) the proof of the pudding will be in the eating; right now we have some stuff to read and a nice web-based REPL app to test code snippets, also the source code for the really adventurous with lots of free time (not my case)... but really, we need a build of Chrome integrating the Dart VM, and we need a few large-scale web applications written in Dart. Google is making this stuff for their own needs, they have increasingly more complex apps such as Google Docs etc., so world+dog will be really convinced when they eat their dog food and show off new releases of some of these apps (and not just cool microbenchmarks and demos) with a new Dart front-end. The current implementation doesn't seem too close to supporting that, but I guess they can reach beta stage in <1yr - which means that the next Google IO should be very interesting...

A+
Osvaldo

work only

unread,
Oct 10, 2011, 8:34:49 PM10/10/11
to java...@googlegroups.com
Don't see the point of another language :(  

I'll stop with Java, Scala and C#



--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.

JamesJ

unread,
Oct 10, 2011, 9:35:36 PM10/10/11
to java...@googlegroups.com
If only Scala ran in place of Javascript on the browser, I would
agree. I'm hoping that somehow the work on Dart will facilitate
solutions to run language of choice in the browser.

Russel Winder

unread,
Oct 10, 2011, 10:40:47 PM10/10/11
to java...@googlegroups.com

Scala GWT ?

--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel...@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@russel.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder

signature.asc

Russel Winder

unread,
Oct 10, 2011, 10:43:26 PM10/10/11
to java...@googlegroups.com
On Mon, 2011-10-10 at 17:34 -0700, work only wrote:
> Don't see the point of another language :(
>
> I'll stop with Java, Scala and C#

Clojure, Groovy, JRuby, Jython, Mirah, . . .

Python, Ruby, . . .

C++, D, Go, . . .

Fortran, Cobol, . . .

Lisp, . . .

Prolog, . . .

Expertise is about knowing many languages and computational models to
usable level even if you only ever work with one language.

signature.asc

Jon Kiparsky

unread,
Oct 10, 2011, 10:52:16 PM10/10/11
to java...@googlegroups.com
"Expertise is about knowing many languages and computational models to
usable level even if you only ever work with one language."

True that. Learning new languages is learning new ways of thinking. There's always something to be gained by it.

"Give the man a coin, that he may profit by what he learns"

Kevin Wright

unread,
Oct 11, 2011, 4:24:11 AM10/11/11
to java...@googlegroups.com
The three biggest problems I see are:

- It has nulls, in 2011.  Despite them already being named a billion-dollar mistake by their inventor: http://qconlondon.com/london-2009/presentation/Null+References:+The+Billion+Dollar+Mistake

- All generics are contravariant by design.  Want to use a Collection<Double> as a Collection<Object> then try and add a String?  With dart you can! A great tribute to ArrayStoreException, because now you can get the equivalent failure everywhere, in all your types...

- It guenuinely doesn't appear to offer anything over and above CoffeeScript, or any of the other languages that can be converted to JavaScript.  Ironically Google are one of the groups who were best at this, with GWT.

Fabrizio Giudici

unread,
Oct 11, 2011, 4:31:24 AM10/11/11
to java...@googlegroups.com, Kevin Wright
On Tue, 11 Oct 2011 10:24:11 +0200, Kevin Wright
<kev.lee...@gmail.com> wrote:


> - All generics are contravariant by design. Want to use a
> Collection<Double> as a Collection<Object> then try and add a String?
> With
> dart you can! A great tribute to ArrayStoreException, because now you can
> get the equivalent failure everywhere, in all your types...

True. But if you make them covariant, there's the wildcard thing. Can
somebody please explain me whether is it possible to have covariant
generics *without* all the corner cases that are often bashed in Java?
Also, if I understand your point, we have anyway a runtime check
(ArrayStoreException) that in Java is currently unfeasible because
generics arent' reified. Right?

ricky.c...@gmail.com

unread,
Oct 11, 2011, 2:49:33 AM10/11/11
to java...@googlegroups.com
A check that in Java is unnecessary because Java's type system is sound.. in that area.
Sent from my BlackBerry® wireless device
--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.

Chris Koerner

unread,
Oct 11, 2011, 8:28:14 AM10/11/11
to java...@googlegroups.com
I think the greatest value of Dart is that its new and thus allows faster iteration than Javascript. I'm interested in seeing where it goes and what tooling Google will make for it. I'm Leery of it because I can't help feel that Google will just drop it to the curb if they get tired of it. 

work only

unread,
Oct 11, 2011, 10:28:28 AM10/11/11
to java...@googlegroups.com
Yep with you on that and I know most of the languages on your list.

Dart is just not that import to me.

Chris Koerner

unread,
Oct 11, 2011, 10:31:13 AM10/11/11
to java...@googlegroups.com

Ruben Reusser

unread,
Oct 11, 2011, 11:16:52 AM10/11/11
to java...@googlegroups.com
It seems interesting that dart leaves out all access to files, databases and screens in their library as well as any kind of native access. Seems it's more targeting the client side and not so much the server side of things. I don't really see how one would write a large server side application in Dart.

Ruben

clay

unread,
Oct 11, 2011, 12:11:09 PM10/11/11
to The Java Posse
On Oct 11, 3:24 am, Kevin Wright <kev.lee.wri...@gmail.com> wrote:
> The three biggest problems I see are:
>
> - It has nulls, in 2011.

++

Ideally, you have a Haskell-like approach where you have a Maybe/
Option system and there is no universal null value.

Scala unfortunately has a global null value and it would be hard to
remove that without hampering JVM compatability.

But Dart, doesn't seem to be taking on that kind of baggage. This is a
relatively greenfield language with a legacy free VM, I don't see why
they would need to support null.

Kevin Wright

unread,
Oct 11, 2011, 12:17:12 PM10/11/11
to java...@googlegroups.com
On 11 October 2011 17:11, clay <clayt...@gmail.com> wrote:
On Oct 11, 3:24 am, Kevin Wright <kev.lee.wri...@gmail.com> wrote:
> The three biggest problems I see are:
>
> - It has nulls, in 2011.

++

Ideally, you have a Haskell-like approach where you have a Maybe/
Option system and there is no universal null value.

Scala unfortunately has a global null value and it would be hard to
remove that without hampering JVM compatability.

Yup.  Can't run on the JVM and use Java libs without supporting nulls, unfortunately.

This makes it rather fun trying to use something like mockito and watching all your lovingly crafted Options throw an NPE...

Fabrizio Giudici

unread,
Oct 11, 2011, 12:59:17 PM10/11/11
to java...@googlegroups.com
On Tue, 11 Oct 2011 16:31:13 +0200, Chris Koerner <ches...@gmail.com>
wrote:

> Ouch..
>
> http://blogs.perl.org/users/rafael_garcia-suarez/2011/10/why-dart-is-not-the-language-of-the-future.html
>

With "ouch" do you mean the poor quality of the blog post, right?

"The spec has even a chapter on factories (static constructors). (Oh my,
factories? it's like 1997 and design patterns all over again!) I should
note that the integration of popular design patterns at the syntax level
is disappointing: design patterns tend to emerge to work around a language
design's weaknesses. Embracing them is a bit like admitting a design
failure up front."

Please explain me this. For what I've understood, Dart factories are just
syntactic sugar to define a default implementation of an interface. I
don't understand the elaboration about design patterns and "design
patterns to work around a language weakness".

"Another example: Ovid pointed me at the NoMoreElementsException, and
added: "didn't Java programmers learn years ago that you throw exceptions
for exceptional things and not for expected things?"

To me this is bullshit, because exceptions are just part of the outcome of
the method execution. You can choose to use them only for exceptional
purposes, as well as going the opposite direction. A withdraw() method
throwing NotEnoughMoneyException is not exceptional (especially for me in
this period) but can make perfectly sense.

At this point I gave up reading. After all, it's so clear that the
language of the future is Perl.

BTW, up to that point I've read several assertions about the fact that
Dart would loose runtime information about types, which it's not how I
understood it, but I might be wrong (but: if Dart has got reified
generics, how can it loose type info at runtime?).


Generally speaking, I find that the picky review of such details of a
language is a really boring approach to comment about it. Given that Dart
is aimed at becoming a better JavaScript, I'd like to see people
discussing on whether the two claims by Dart guys (about JavaScript being
too flawed to scale) are reasonable or not. For instance, I've not read so
far which points for which JavaScript wouldn't scale for JIT performance
have been fixed by Dart.

Cédric Beust ♔

unread,
Oct 11, 2011, 1:31:50 PM10/11/11
to java...@googlegroups.com
A Perl enthusiast who's written three blog posts in two years says he doesn't like a new language and we should pay attention because...?

Anyway, even if I focus on the message and not the messenger, I can't say I see a lot of value in this post, why did you find it noticeable?

-- 
Cédric




Josh Berry

unread,
Oct 11, 2011, 1:48:46 PM10/11/11
to java...@googlegroups.com
On Tue, Oct 11, 2011 at 1:31 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> A Perl enthusiast who's written three blog posts in two years says he
> doesn't like a new language and we should pay attention because...?
> Anyway, even if I focus on the message and not the messenger, I can't say I
> see a lot of value in this post, why did you find it noticeable?

Don't know why, but I found how you managed to turn an admission of an
ad hom into an insult rather amusing. :)

As for the post, I found the slant on the "feable type system" a good
spin on it. It does sound like they are encouraging more of a "lint
based" approach to typing.

I found the criticism of where you could have done "if (foo)
foo.bar()" before but now you can't because only false is false, is a
valid annoyance. I'll miss that idiom from javascript. If he is
correct about 2 + "2" being an exception whereas "2" + 2 being
concatenation, that is annoying. (I recall the pain this caused when
+ was added to List in Scala.)

I agree that the complaint about an exception is hollow, if you don't
know where it is used.

Cédric Beust ♔

unread,
Oct 11, 2011, 2:03:22 PM10/11/11
to java...@googlegroups.com
On Tue, Oct 11, 2011 at 10:48 AM, Josh Berry <tae...@gmail.com> wrote:
On Tue, Oct 11, 2011 at 1:31 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> A Perl enthusiast who's written three blog posts in two years says he
> doesn't like a new language and we should pay attention because...?
> Anyway, even if I focus on the message and not the messenger, I can't say I
> see a lot of value in this post, why did you find it noticeable?

Don't know why, but I found how you managed to turn an admission of an
ad hom into an insult rather amusing.  :)

Er... wha?

Rereading what I wrote, I see fact, fact, a question and a personal opinion. Where do you see any attack?!?

-- 
Cédric

Josh Berry

unread,
Oct 11, 2011, 2:21:12 PM10/11/11
to java...@googlegroups.com

I guess it is that I did not see the transition from an ad hom tone in
the first part where you were belittling perl and the blogger, to no
tone where you asked why the person found this interesting. You even
called out how you were making a direct ad hom attack, which seems to
signal that you were acknowledging the negative tone of the beginning.

Moving past that, though, and getting back on topic. Having only
false as false does seem odd. Especially with no way to coerce other
items into false. This is especially true in a system that will not
flag a compile error when you put something in that isn't going to
work, ever. Amusing that they went unsound to allow some stuff with
generics, but then open up comparable holes elsewhere in the system.

Same goes for the string conversion for concatenation, but no other
conversions, evidently. Seems a comparable mistake to the one made in
java. I would imagine it will be just as annoying there, as well.

Cédric Beust ♔

unread,
Oct 11, 2011, 2:26:01 PM10/11/11
to java...@googlegroups.com
Sorry to insist but I feel pretty strongly about this kind of accusation.

On Tue, Oct 11, 2011 at 11:21 AM, Josh Berry <tae...@gmail.com> wrote:

>> On Tue, Oct 11, 2011 at 1:31 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
>> > A Perl enthusiast who's written three blog posts in two years says he
>> > doesn't like a new language and we should pay attention because...?
>> > Anyway, even if I focus on the message and not the messenger, I can't
>> > say I
>> > see a lot of value in this post, why did you find it noticeable?
>>
>> Don't know why, but I found how you managed to turn an admission of an
>> ad hom into an insult rather amusing.  :)
>
> Er... wha?
> Rereading what I wrote, I see fact, fact, a question and a personal opinion.
> Where do you see any attack?!?

I guess it is that I did not see the transition from an ad hom tone in
the first part where you were belittling perl and the blogger

Where do I belittle Perl?!? Where do I make fun of the blogger? You're seeing things.
 
, to no
tone where you asked why the person found this interesting.  You even
called out how you were making a direct ad hom attack

Again, there was no hominem attack, unless you think that "A tennis expert just made a comment on a football game" is an insult toward the tennis expert.

Seriously.

-- 
Cédric

Josh Berry

unread,
Oct 11, 2011, 2:31:01 PM10/11/11
to java...@googlegroups.com
On Tue, Oct 11, 2011 at 2:26 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> Sorry to insist but I feel pretty strongly about this kind of accusation.

No worries, though I really didn't mean this to be a major complaint.
I really was amused by my reading. You called out that you were
making an ad hominem when you said "even if I focus on the message and
not the messenger." That is the definition of these arguments.

In fact, pointing this out, I am starting to feel like I'm just being trolled.

Serge Boulay

unread,
Oct 11, 2011, 6:52:50 PM10/11/11
to java...@googlegroups.com

The more interesting question will be whether Apple, MS, Mozilla will embed the Dart VM in their browsers.

On Tue, Oct 11, 2011 at 11:16 AM, Ruben Reusser <rub...@gmail.com> wrote:
It seems interesting that dart leaves out all access to files, databases and screens in their library as well as any kind of native access. Seems it's more targeting the client side and not so much the server side of things. I don't really see how one would write a large server side application in Dart.

Ruben

--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.

Cédric Beust ♔

unread,
Oct 11, 2011, 7:00:00 PM10/11/11
to java...@googlegroups.com
On Tue, Oct 11, 2011 at 3:52 PM, Serge Boulay <serge....@gmail.com> wrote:

The more interesting question will be whether Apple, MS, Mozilla will embed the Dart VM in their browsers.

This is where the dual approach (generate Javascript or run on a VM) is very clever: browsers that refuse to embed the Dart VM will be running Dart code more slowly than those that do, thereby providing a strong incentive to support the VM.

-- 
Cédric

phil swenson

unread,
Oct 12, 2011, 10:27:38 AM10/12/11
to java...@googlegroups.com
coffeescript's approach just seems more pragmatic.  compiles to javascript - works on everything.  plus it's simply a cleaner, nicer syntax.

it doesn't pass the "cool" test.  it looks like a rehashed java.  my gut says dart fails to get any uptake.

2011/10/11 Cédric Beust ♔ <ced...@beust.com>

Russel Winder

unread,
Oct 12, 2011, 10:55:05 AM10/12/11
to java...@googlegroups.com
On Wed, 2011-10-12 at 08:27 -0600, phil swenson wrote:
[ . . . ]

> it doesn't pass the "cool" test. it looks like a rehashed java. my gut
> says dart fails to get any uptake.

Or, like Go, Google pumps it so much that it is forced into being taken
up no matter that it is not the right solution to the right problem?

signature.asc

Russel Winder

unread,
Oct 12, 2011, 11:10:26 AM10/12/11
to java...@googlegroups.com
On Wed, 2011-10-12 at 08:27 -0600, phil swenson wrote:
> coffeescript's approach just seems more pragmatic. compiles to javascript -
> works on everything. plus it's simply a cleaner, nicer syntax.
>
> it doesn't pass the "cool" test. it looks like a rehashed java. my gut
> says dart fails to get any uptake.

James doesn't like Java so creates Groovy.

Martin doesn't like Java so creates Scala. James now wishes he'd
invented Scala instead of Groovy

RedHat doesn't like Java so invents Ceylon, not to be confused with Sri
Lanka.

JetBrains doesn't like Java so invents Kotlin.

Google doesn't like Java so invents Dart.

I think I see a pattern. Actually one of two:

Everyone is scared of Oracle's ownership of Java (well the trademark and
patents anyway) and wants to own their own language so as to enhance
diversity and divergence.

Everyone wants to be a hero and invent the next monopoly language.
Presumably with the aimed for lock in to create dependants and hence a
sure income stream. This is, of course, the standard model in
technology and especially computing.

Let us hope that the Tower of Babel effect does not take place as it did
(analogously) with UNIX in the 1980s.

signature.asc

Josh Berry

unread,
Oct 12, 2011, 11:38:14 AM10/12/11
to java...@googlegroups.com
On Wed, Oct 12, 2011 at 11:10 AM, Russel Winder <rus...@russel.org.uk> wrote:
> Everyone is scared of Oracle's ownership of Java (well the trademark and
> patents anyway) and wants to own their own language so as to enhance
> diversity and divergence.

I think that mucks with the timeline of most of these languages.
Weren't a good many of them started under Sun's reign. (And you left
out clojure.)

Not to mention you are ignoring the vast progress MS has made in
language design in the .NET world. It isn't shocking that many in the
JVM world finally started realizing that, yes, Java has stagnated
heavily for a long time now. It isn't beyond hope, per se. Just very
stagnate.

Russel Winder

unread,
Oct 12, 2011, 12:00:35 PM10/12/11
to java...@googlegroups.com
On Wed, 2011-10-12 at 11:38 -0400, Josh Berry wrote:
[ . . . ]

> I think that mucks with the timeline of most of these languages.
> Weren't a good many of them started under Sun's reign. (And you left
> out clojure.)

Groovy was 2003, Scala 2004, after that things get hazy :-)

I am not sure the Sun/Oracle thing matters much, except that Sun itself
had stagnated such that it was choked with pond weed, whereas that is
unlikely ever to happen to Oracle -- at least in the same way.

Clojure is a realization of what many claim to be the only programming
language that you ever need, and that the history of programming
languages is one of people failing to realize that car, cdr and cons are
the only operations you ever need -- or at least that s-expressions are
the only expression one needs to express any expression.

> Not to mention you are ignoring the vast progress MS has made in
> language design in the .NET world. It isn't shocking that many in the
> JVM world finally started realizing that, yes, Java has stagnated
> heavily for a long time now. It isn't beyond hope, per se. Just very
> stagnate.

Hasn't M$ decided that C++ is actually a good thing and that CLR was
probably an aberration caused by lack of Intel.

signature.asc

Cédric Beust ♔

unread,
Oct 12, 2011, 12:02:12 PM10/12/11
to java...@googlegroups.com
On Wed, Oct 12, 2011 at 7:27 AM, phil swenson <phil.s...@gmail.com> wrote:
coffeescript's approach just seems more pragmatic.  compiles to javascript - works on everything.  plus it's simply a cleaner, nicer syntax.

it doesn't pass the "cool" test.  it looks like a rehashed java.  my gut says dart fails to get any uptake.

Statistically, you are very likely to be correct, but I think the simple fact that Chrome will be shipping with a Dart native VM (or so I assume) probably gives it better odds of success than competing technologies.

Remember that the bar here is not to replace Java but Javascript. This is a different game with different parameters.

Personally, I am nothing short of stunned to realize that most of the web that we see today is held together by millions of lines of Javascript.

-- 
Cédric

Cédric Beust ♔

unread,
Oct 12, 2011, 12:05:08 PM10/12/11
to java...@googlegroups.com

On Wed, Oct 12, 2011 at 8:10 AM, Russel Winder <rus...@russel.org.uk> wrote:
Everyone is scared of Oracle's ownership of Java (well the trademark and
patents anyway) and wants to own their own language so as to enhance
diversity and divergence.

I really don't think this is the driver for all the JVM based languages we are seeing. Obviously, all the pre-Oracle acquisition languages (Groovy, Scala, Fantom, Gosu) were not created because of Oracle, but I would argue that even those that were created after the acquisition happened just because their respective authors simply want to create a better language than Java.

New languages are typically created much more for technical than business reasons.

-- 
Cédric

Josh Berry

unread,
Oct 12, 2011, 12:09:24 PM10/12/11
to java...@googlegroups.com
On Wed, Oct 12, 2011 at 12:02 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> Remember that the bar here is not to replace Java but Javascript. This is a
> different game with different parameters.

Similarly, the bar is not to create a good language, but to get people
using it. :) I feel comfortable claiming that dart could be a
complete step backwards in every way, and there is still a chance it
would succeed quite well if google puts enough muscle behind it.

Josh Berry

unread,
Oct 12, 2011, 12:12:20 PM10/12/11
to java...@googlegroups.com
On Wed, Oct 12, 2011 at 12:00 PM, Russel Winder <rus...@russel.org.uk> wrote:
> Clojure is a realization of what many claim to be the only programming
> language that you ever need, and that the history of programming
> languages is one of people failing to realize that car, cdr and cons are
> the only operations you ever need -- or at least that s-expressions are
> the only expression one needs to express any expression.

:) Fair enough. I admit that s-expressions are highly attractive to
me, years later now that I finally understand them. (Well, years
later now that I think I understand them.)

I admit to being lured by the abstractions put forth by many of the
Haskel folks, too. Applicatives and the like are very interesting.
Hopefully I can get to understand them faster than I did lisp.

Cédric Beust ♔

unread,
Oct 12, 2011, 12:15:56 PM10/12/11
to java...@googlegroups.com

On Wed, Oct 12, 2011 at 9:00 AM, Russel Winder <rus...@russel.org.uk> wrote:
Hasn't M$ decided that C++ is actually a good thing and that CLR was
probably an aberration caused by lack of Intel.

I don't know where you got that idea. It's pretty clear to me that Microsoft decided to move away from C++ the very first day they started working on C#, circa 2001. And they've been very successful at it (you would be hard pressed to justify starting a Windows project in C++ these days).

-- 
Cédric

Cédric Beust ♔

unread,
Oct 12, 2011, 12:19:20 PM10/12/11
to java...@googlegroups.com
Totally agree. I haven't looked in details at Dart but the surface looks good to me, at least good enough that I might be interested in coding in Dart while I've always found good excuses to avoid Javascript.

I'm still puzzled by Dart's allowance of dynamic typing, though. What's the rational here? Saving a few keystrokes just so you can prototype faster? This doesn't make much sense. I suspect Gilad might be behind this, although I have to say I'm pleasantly surprised by the non-Smalltalk look of Dart so far, so it looks like he accepted to give up some of his beliefs in the spirit of pragmatism, which is laudable.

-- 
Cédric

phil swenson

unread,
Oct 12, 2011, 3:01:12 PM10/12/11
to java...@googlegroups.com
I'm still puzzled by Dart's allowance of dynamic typing, though. What's the rational here? Saving a few keystrokes just so you can prototype faster? This doesn't make much sense.

this is what I think you don't get:  most web devs like dynamic typing.  

hang out on hacker news for a bit and check out all the dart trashing.  there was more a few days ago than now, but there is still some going on.   maybe the startup/bleeding edge types aren't the target audience though?

I personally think the anti-static typing people don't realize that static typing doesn't have to suck because they've only seen sucky implementations (java).  to convince these guys, they need something that is statically typed but isn't so verbose/ugly (not dart).

Josh Berry

unread,
Oct 12, 2011, 3:10:25 PM10/12/11
to java...@googlegroups.com
On Wed, Oct 12, 2011 at 3:01 PM, phil swenson <phil.s...@gmail.com> wrote:
>
>
>> I'm still puzzled by Dart's allowance of dynamic typing, though. What's
>> the rational here? Saving a few keystrokes just so you can prototype faster?
>> This doesn't make much sense.
>
> this is what I think you don't get:  most web devs like dynamic typing.

I think people just like it when things work as well as they can.
When building a bike, you are likely to try riding it a few times
before it is really "ride-able." With what is commonly called dynamic
typing, you can typically do this. With static typing, if it won't
stand, it won't run. Period.

In this regard, I admit I would like an optionally static/dynamic
split. Imagine testing a few additions to a visitor/node tree where
you purposefully didn't completely all implementations of the methods
because you just aren't there yet and don't care. (If you have
several visitors, might want to just try one or two at a time, for
example.) This is certainly doable with a lot of upfront planning
regarding modular codebases, but it would be a lot easier if you could
just say "don't enforce this now."

Obviously, this is all starting with "I think." So, your mileage will
vary. I'm interested in how far off the mark I am, though.

Ricky Clarkson

unread,
Oct 13, 2011, 8:55:54 AM10/13/11
to java...@googlegroups.com
I don't do a lot of upfront planning, and extremely rarely wish I
could run my badly-typed code.

The only time is when I'm in the middle of a massive refactor and I'm
worried that I've changed behaviour accidentally.

The bigger problem is that I'm in the middle of a massive refactor. I
generally step back at this point and find a way to decompose it into
smaller refactors.

I think dynamic typing is generally helpful when you are beginning in
programming, when your mistakes can simply be deleted instead of
supported for years to come.

After that point, types are useful, even in Java where they're
verbose, or C where they're limited (no generics).

Unfortunately some of the OO techniques don't gel very well with
types, because types tend to make implicit complexity explicit.

For instance in JavaScript you could have a list of employees and
remove all but the developers then pass that to a method that expects
a list of developers.

Doing the same with types is a pain, but because what we're doing is
complex rather than types being complex.

E.g., if the list gets modified on another thread we could end up
sending a list of accountants to do a development team's job.
JavaScript would just blow up, but a typed language would force the
programmer to write the code in a safe way. And that can mean changing
the design for the better. Instead of modifying the list, create a
new one or a view to a version of the original if memory is tight.
Stepping to C# gratuitously:

WeNeedDevs(from e in employees where e is Developer select e as Developer);

The type system is happy and the program is better, but it requires a
change in thinking, and perhaps it's that that the Rubyists, etc.,
don't want to entertain. They prefer the freedom of a car without
brakes.

> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to java...@googlegroups.com.
> To unsubscribe from this group, send email to
> javaposse+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
>

--
Sent from my mobile device

--
Skype: ricky_clarkson

Kevin Wright

unread,
Oct 13, 2011, 9:04:38 AM10/13/11
to java...@googlegroups.com
My stance (unsurprisingly) is going to be the complete opposite.  The problem described is one that actually becomes easier in a strongly-typed language, so long as you also have the necessary functional constructs (specifically, lambdas and pattern matching).

I'd defy anyone to come up with a dynamically-typed equivalent to this Scala snippet that's as simple, comprehensible, and as effortlessly thread-safe:

    val developers = employees collect { case d: Developer => d }

Ricky Clarkson

unread,
Oct 13, 2011, 9:14:19 AM10/13/11
to java...@googlegroups.com
(loop for e in employees when (is-developer e) collect e)

Josh Berry

unread,
Oct 14, 2011, 11:51:55 AM10/14/11
to java...@googlegroups.com
Ok, so seems we are left with the unanswered question of why do people
prefer dynamic typing? My only thought is still that I'd like to have
something work as well as it can without having to fill out
boilerplate that just isn't relevant yet (or possibly ever).

Kevin Wright

unread,
Oct 14, 2011, 12:05:33 PM10/14/11
to java...@googlegroups.com

You've just specified a very good reason to have type inference, full dynamic typing isn't a requirement to kill the boilerplate - The belief that static typing must be heavyweight is mostly perpetrated by Java.

ricky.c...@gmail.com

unread,
Oct 14, 2011, 11:24:04 AM10/14/11
to java...@googlegroups.com
Typing is not about boilerplate. For instance, LINQ in C#, or Haskell, or even but less commonly Scala, can beat languages like Python and Ruby on boilerplate.

You have a skewed idea of typing equalling boilerplate, which I would guess comes from Java, C and other similar languages. It's the same fallacy as 'all mustachioed men are gay because of the YMCA video', when what those of us who studied history know is that all mustachioed men are Hitler.
Sent from my BlackBerry® wireless device

Josh Berry

unread,
Oct 14, 2011, 12:41:58 PM10/14/11
to java...@googlegroups.com
Apologies for not saying that I realize not all static typed items
have to have "type" boilerplate. I've become a huge fan of inference.
Hell, I even like Haskel and Scala. That said, even with that, there
tends to be more boilerplate in statically typed languages than in
dynamic.

The open question is "why do some folks like dynamic typing?" My
proposed answer was it can get out of your way better than static
typing. You shot that down. I'm still curious for the answer. So
far, the only answer either of you have put forward is "people that
like dynamic typing just don't know the good languages for static
typing." Is that really the best answer we have?

ricky.c...@gmail.com

unread,
Oct 14, 2011, 12:20:38 PM10/14/11
to java...@googlegroups.com
The answer is that they just don't care. If it appears to work then it works. If it fails later on different input then we'll fix it. YAGNI. Proof and test are so closely-related in our heads that in a number of spoken languages there's one word for both concepts.

Any type system will reject some programs that would never fail, e.g.,

int a = currentYear < 1950 ? 2.5 : 3;

That's a silly example but there are cases where it seems the type system just wants to annoy you, if you neither understand nor care how types work.

There's always more and more research done into type systems.. How far can we go in finding errors statically while not requiring too many hints from the programmer and while being able to finish in a reasonable amount of time?

If you believe a type system only catches trivial problems, that's likely what you'll observe. If you take care to give the type system the information it needs (e.g., using a Color type instead of an int) it will help you out a lot more, especially when refactoring.

Cédric Beust ♔

unread,
Oct 14, 2011, 1:23:53 PM10/14/11
to java...@googlegroups.com
On Fri, Oct 14, 2011 at 9:41 AM, Josh Berry <tae...@gmail.com> wrote:
That said, even with that, there tends to be more boilerplate in statically typed languages than in
dynamic.

Still not seeing it, unless you get more specific. I would agree with:

"There tends to be more boiler plate in statically typed languages that don't support type inference than dynamic languages".
 
But as soon as a statically typed language supports type inference, I'm really not convinced that it has more boiler plate than a dynamically typed language (obviously, type annotations don't count as "boiler plate", we're talking about things such as "List l = new ArrayList()").

-- 
Cédric

Josh Berry

unread,
Oct 14, 2011, 1:33:02 PM10/14/11
to java...@googlegroups.com
On Fri, Oct 14, 2011 at 12:20 PM, <ricky.c...@gmail.com> wrote:
> The answer is that they just don't care. If it appears to work then it works. If it fails later on different input then we'll fix it. YAGNI. Proof and test are so closely-related in our heads that in a number of spoken languages there's one word for both concepts.

I don't know, I just find that a less than compelling answer.
Especially when considering lisp offshoots. I don't think it is a
lack of caring on their part.

Josh Berry

unread,
Oct 14, 2011, 1:35:30 PM10/14/11
to java...@googlegroups.com
On Fri, Oct 14, 2011 at 1:23 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> But as soon as a statically typed language supports type inference, I'm
> really not convinced that it has more boiler plate than a dynamically typed
> language (obviously, type annotations don't count as "boiler plate", we're
> talking about things such as "List l = new ArrayList()").

Type annotations certainly count. Hell, anything that is "just a
standard part of a program and has to be present" counts. As an
example, setting up the tables and such in squeryl is something I feel
safe calling boilerplate. ActiveRecord showed many in the world that
you could have done that through reflection on a table.

Are there advantages to having that boilerplate? Of course there are.
Doesn't mean it isn't boilerplate. (That is, you can't eliminate
all boilerplate, by nature of the definition of boilerplate. It isn't
that java has any boilerplate that annoys so many, it is that it has
so much boilerplate.)

Cédric Beust ♔

unread,
Oct 14, 2011, 1:39:19 PM10/14/11
to java...@googlegroups.com
Ok this is getting a bit silly, but to me, boiler plate is something that the compiler could infer without my help.

ArrayList a = new ArrayList();

The first ArrayList is boiler plate.

var a = new ArrayList();

ArrayList is not boiler plate here, and you'll need it in dynamically typed languages as well. Except for languages that can read your mind, obviously.

-- 
Cédric




phil swenson

unread,
Oct 14, 2011, 1:43:40 PM10/14/11
to java...@googlegroups.com
I agree with Cedric on this one (there is a first time for everything!)

unfortunately, dart doesn't have type inference.

bruce eckel's wrote a post on this very subject: http://www.artima.com/weblogs/viewpost.jsp?thread=328540


2011/10/14 Cédric Beust ♔ <ced...@beust.com>

Josh Berry

unread,
Oct 14, 2011, 1:55:45 PM10/14/11
to java...@googlegroups.com
On Fri, Oct 14, 2011 at 1:39 PM, Cédric Beust ♔ <ced...@beust.com> wrote:
> Ok this is getting a bit silly, but to me, boiler plate is something that
> the compiler could infer without my help.

I'm using boilerplate in the "any text that is or can be reused in new
contexts or applications without being changed much from the original"
concept from wikipedia. Libraries actually do more to reduce
boilerplate than type inference, I would think. Consider the benefits
of map/filter/fold over your standard imperative loops.

ricky.c...@gmail.com

unread,
Oct 14, 2011, 1:37:05 PM10/14/11
to java...@googlegroups.com
If you talk about lisp, consider that most lisps offer runtime patching, conditions and even let you step in and manually or automatically provide a value to use as the result of a failed evaluation.

I.e., like Erlang, the emphasis is more on handling errors than preventing them.
Sent from my BlackBerry® wireless device

-----Original Message-----
From: Josh Berry <tae...@gmail.com>
Sender: java...@googlegroups.com
Date: Fri, 14 Oct 2011 13:33:02
To: <java...@googlegroups.com>
Reply-To: java...@googlegroups.com
Subject: Re: [The Java Posse] Dart unveiled

ricky.c...@gmail.com

unread,
Oct 14, 2011, 1:38:54 PM10/14/11
to java...@googlegroups.com
Consider the boilerplate you need to use map and filter in Java.
Sent from my BlackBerry® wireless device

-----Original Message-----
From: Josh Berry <tae...@gmail.com>
Sender: java...@googlegroups.com
Date: Fri, 14 Oct 2011 13:55:45
To: <java...@googlegroups.com>
Reply-To: java...@googlegroups.com
Subject: Re: [The Java Posse] Dart unveiled

Russel Winder

unread,
Oct 15, 2011, 6:49:08 AM10/15/11
to java...@googlegroups.com
On Thu, 2011-10-13 at 14:04 +0100, Kevin Wright wrote:
[ . . . ]

>
> I'd defy anyone to come up with a dynamically-typed equivalent to this
> Scala snippet that's as simple, comprehensible, and as effortlessly
> thread-safe:
>
>
> val developers = employees collect { case d: Developer => d }

How is this effortlessly thread safe unless each data structure has a
lock and so you have whole data structure locking.

To answer the challenge:

Python:

developers = [ e for e in employees if isinstance(e, Developer) ]

Groovy:

final developers = employees.filter { it instanceof Developer }


which of course gives rise to the problem of what collect, filter, map,
reduce, inject, etc. mean in each language, as each language that has
them uses them with different semantics :-((

signature.asc

Russel Winder

unread,
Oct 15, 2011, 6:50:07 AM10/15/11
to java...@googlegroups.com
On Wed, 2011-10-12 at 09:15 -0700, Cédric Beust ♔ wrote:
[ . . . ]

>
> I don't know where you got that idea. It's pretty clear to me that
> Microsoft decided to move away from C++ the very first day they
> started working on C#, circa 2001. And they've been very successful at
> it (you would be hard pressed to justify starting a Windows project in
> C++ these days).

Not the message Herb Sutter is putting about . . .

signature.asc

Kevin Wright

unread,
Oct 15, 2011, 6:57:19 AM10/15/11
to java...@googlegroups.com
On 15 October 2011 11:49, Russel Winder <rus...@russel.org.uk> wrote:
On Thu, 2011-10-13 at 14:04 +0100, Kevin Wright wrote:
[ . . . ]
>
> I'd defy anyone to come up with a dynamically-typed equivalent to this
> Scala snippet that's as simple, comprehensible, and as effortlessly
> thread-safe:
>
>
>     val developers = employees collect { case d: Developer => d }

How is this effortlessly thread safe unless each data structure has a
lock and so you have whole data structure locking.


Simple, if employees has already been defined as:

    val employees = Seq(employee1, employee2, employee3, ...)

Or similar, then extracting developers can't be anything *but* thread-safe - such is the nature of immutable collections.  Better yet, we could do this:

    val employees = ParSeq(employee1, employee2, employee3, ...)

or

    val employees = Seq(employee1, employee2, employee3, ...)
    val developers = employees.par collect { case d: Developer => d }

and it's automatically run in parallel.

 
To answer the challenge:

Python:

 developers = [ e for e in employees if isinstance(e, Developer) ]

Groovy:

 final developers = employees.filter { it instanceof Developer }


which of course gives rise to the problem of what collect, filter, map,
reduce, inject, etc. mean in each language, as each language that has
them uses them with different semantics :-((

--
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



--
Kevin Wright
mail: kevin....@scalatechnology.com
gtalk / msn : kev.lee...@gmail.com
vibe / skype: kev.lee.wright
steam: kev_lee_wright

"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra

gafter

unread,
Nov 11, 2011, 2:12:06 AM11/11/11
to The Java Posse
On Oct 11, 12:31 am, "Fabrizio Giudici"
<Fabrizio.Giud...@tidalwave.it> wrote:
> Can somebody please explain me whether is it possible to have covariant
> generics *without* all the corner cases that are often bashed in Java?

Yes, it is possible. See C#. It has "declaration site" variance. In
C# you put "out" on the type parameter in your interface instead of
Java's "? extends" where your interface is used.

Kevin Wright

unread,
Nov 11, 2011, 3:22:10 AM11/11/11
to java...@googlegroups.com

I am *another* language, a bit closer to home. I'm perfectly at home on the Java platform and also use declaration site variance (a simple trick for me, thanks to the much-derided type erasure on the JVM).

I was written by the same guy as wrote the current generation of javac and who created Java's generics (though not the wildcards, as he'd be keen to point out)

I lack many of Java's difficult corner cases, especially in the type system; yet oddly I take a lot of undue criticism for being (allegedly) complicated.

What am I?

Matthew Farwell

unread,
Nov 11, 2011, 3:27:34 AM11/11/11
to java...@googlegroups.com

Fabrizio Giudici

unread,
Nov 11, 2011, 4:48:57 AM11/11/11
to java...@googlegroups.com, Kevin Wright
Can I see a quick and simple example in C# and Scala?


--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it

Reply all
Reply to author
Forward
0 new messages