News for hackers. Stuff that matters.
Re:Announcing TypeScript 0.9.1 by seanmcdirmid on Wednesday August 07, 2013 @06:45AM (#6171906)
C has very simple types and allows for untyped operations very easily. Say you cast some ptr of type void* to Foo*: at least in Python you would get a dynamic type error if the cast was incorrect; in C you are lucky if your program immediately crashes.

C has some static type safety, and virtually no run-time type safety. Java on the other hand, has a lot of static type safety, is completely memory safe (barring bugs in the implementation), and checks all coercions dynamically. Python has what Java has dynamically, and nothing statically, but it is still 10 times better than what C has!

Re:Announcing TypeScript 0.9.1 by harrytuttle on Wednesday August 07, 2013 @07:32AM (#6172067)
That's what we have valgrind, test cases and decent software engineers for.

Java don't forget suffers as do other languages from lots of nasty things related to types including invalid casts, null reference exceptions etc. When these go phut in production, you're usually in the same situation.

Re:Announcing TypeScript 0.9.1 by pkinsky on Wednesday August 07, 2013 @10:02PM (#6176938)
Java is not a good example of a statically typed language. Null pointer exceptions just don't happen in idiomatic Scala. For example, let's say I have 3 functions a,b and c, each with signature Int => Option[Int]. Any one of these can return Some[Int] or None.

Options, like all collections, can be chained together as such:

   for {
      x <- a(1)
      y <- b(x)
      z <- c(y)
   } yield z
this expression is of type Option[Int], and will never throw a null pointer exception. (Futures can be chained together with identical syntax)
Re:Announcing TypeScript 0.9.1 by seanmcdirmid on Wednesday August 07, 2013 @11:10PM (#6177151)
> Null pointer exceptions just don't happen in idiomatic Scala.

But match exceptions do.

Anyways, if I had to choose between unsound static type checking and sound dynamic type checking, I would definitely choose the latter.

Re:Announcing TypeScript 0.9.1 by happy_dino on Thursday August 08, 2013 @08:46AM (#6178529)
> But match exceptions do.

I'd call that non-sense.