

LtU on Dart - sorenbs
http://lambda-the-ultimate.org/node/4377#comment

======
rayiner
Reading LtU makes me sad that an entire generation of computer science
students were raised to think programming language design is coextensive with
type system design.

Not that I think that Dart is particularly creative from a PL design
standpoint, but I read the complaints about covariant genetics and think: who
cares about the type system? It's optional after all!

~~~
nandemo
I don't think LtU is all about type system design. There are plenty of
discussions about parsing, semantics, programming language implementation and
so on.

And type system is optional? Besides Assembly, I can't think of any widely
used programming language that is untyped.

Yes, there are plenty of languages with weak typing or dynamic typing, but
that's very different from no typing at all.

~~~
rayiner
I mean there are articles on LtU about typing parsers, expressing semantics
through typing, etc. Which is fine its a forum with a specific niche, what is
sad is that niche has come to totally dominate PL design in academia.

And at least the static type system in Dart is optional. Yet all I hear about
Dart is digs at its static type system. Can't express non-nulity, has
covariant generics, etc. Who really cares? It's designed to throw up a warning
when you pass a string to Math.min, not to allow expressing every static
invariant possible through the static type system.

~~~
chc
The reason people are deriding it is because it's touted as a feature of the
language, but it's really a very unhelpful and relatively powerless type
system. Enforcing non-null is more useful than warning me if I pass a string
to Math.min. The amount of time I've spent debugging strings passed to
Math.min (so to speak) is a rounding error next to the time I've spent weeding
out unwanted nulls.

Imagine if I were to put out a language with great fanfare given to the fact
that it has a built-in string type. What would your reaction be?

------
jazzyb
The user neelk states that one of the bad things about the language is "Null.
In 2011." Can someone clarify for me why having null in a language is bad
(other than how dereferencing/calling-a-method on null in most languages
results in your program crashing)? Come to think of it, I'm not even aware of
a language without null.

~~~
losvedir
My dabbling in Haskell has given me a new perspective on null.

Previously, to me "null" was just "that other value that a variable gets if
the function doesn't work or something unexpected happens." It was useful if
ugly. I didn't fully grasp how much that null possibility permeated my code,
since I didn't know any other way.

However, in Haskell, if something is an integer, it really is an integer of
some sort. Null is not allowed.

So if you're writing a function that works with numbers, you really have to
think about what are valid inputs and outputs. If you're working with a
function whose domain really is all integers, then you can indicate that with
a Integer -> Integer function, and you're on rock solid ground.

However, if you're writing a function like, e.g. square root, where the domain
is not all integers, then you have to worry about what happens if you get a
negative one. Now you can _choose_ to bring in "null" as an allowable value,
but it will have to be explicitly indicated and dealt with. Your function, for
all the world to see, will be Integer -> Maybe Integer, and then any other
function that uses that function will be forced to deal with the fact that a
null might happen.

~~~
timclark
This is Haskell esoterica, any value can set as undefined an equivalent value
to null. However, you never see code using undefined as null since Maybe a is
so much clearer.

~~~
jganetsk
undefined and null are quite different. It's impossible to test for undefined.
You cannot expect (x == undefined) to return true. It would result in
exception, in fact. You can only safely make a value undefined if you
guarantee it won't be used.

------
sambeau
It's great to see LtU linked-to on HN. It was also cool to see the link back
from LtU to HN.

~~~
ot
Here it is:

<http://lambda-the-ultimate.org/node/4377#comment-67585>

------
devin
Anyone wanna bet this is the article no one reads because it's not link-bait
enough? Sorry for being so cynical, but I can't help myself.

