News for hackers. Stuff that matters.
Re:Ask HN: Language Focus by tome on Saturday August 03, 2013 @07:28AM (#6151806)
Personally I do not enjoy using poorly-typed languages (C, C++, Java) and prefer the flexibility of untyped languages (Python). However I even more prefer the flexibility and strength given by powerfully-typed languages (Haskell, and I suppose Scala, OCaml, F#).

Don't confuse typing with rigidity.

Re:Ask HN: Language Focus by seanmcdirmid on Saturday August 03, 2013 @07:52AM (#6151837)
Java as a poorly typed language along with C and C++? Wow. Java's type system isn't "flexible", but its far away from unsafe.
Re:Ask HN: Language Focus by tome on Saturday August 03, 2013 @11:13AM (#6152305)
I wasn't claiming anything about safety, but now you mention it, yes it is unsafe. Nullability is one example.
Re:Ask HN: Language Focus by seanmcdirmid on Saturday August 03, 2013 @12:32PM (#6152521)
This is like claiming a scratch and decapitation are the same thing. Haskell is unsafe too, then, there are plenty of dynamic hazards even with BSDM static typing in place.
Re:Ask HN: Language Focus by tome on Saturday August 03, 2013 @02:04PM (#6152771)
Not sure how to respond rather than just to say I am of the polar opposite opinion.
Re:Ask HN: Language Focus by seanmcdirmid on Saturday August 03, 2013 @09:22PM (#6154159)
Probably.

Let's put it this way. Let's say your example of bad leaders was Hitler, Mao, Stalin...and Jimmy Carter. Surely they all made mistakes, but one of them doesn't belong in the "set" of the others. Java does provide safety at run-time in the case of dynamic hazards, the same cannot be said for C/C++. C/C++ are a different level of evil lacking even run-time safety, so its weird, and perhaps intellectually dishonest, that you would lump them all together as "unsafe." Anyways, there is a name for this trope [1,2].

Now take your safest language, I guess that would be Haskell, even Maybe doesn't eliminate all dynamic hazards, especially if there is no way to cover from the Nothing case (it just makes you check everything, it doesn't eliminate the problem).

[1] http://tvtropes.org/pmwiki/pmwiki.php/Main/ArsonMurderAndJay...

[2] http://tvtropes.org/pmwiki/pmwiki.php/Main/AllCrimesAreEqual

Re:Ask HN: Language Focus by tome on Sunday August 04, 2013 @04:58AM (#6155085)
I didn't put Java in the same group as C and C++ regarding safety. I just pointed out that they are all "poorly typed" by which I mean they have rigid, inflexible, awkward to use typing.

I agree that Java is safer than C and C++, mostly by virtue of not having pointers. However I would say that Haskell is safer than Java by a far greater degree than the degree that Java is safer than C and C++. You can encode many, many more invariants in types.

As to Haskell being unsafe, of course it is to some degree, since you can't encode, say, termination in the type system. But I'd have to know what specific examples you have in mind before responding further.