Hacker News new | comments | show | ask | jobs | submit login

I like Steve's PL posts a lot, but I don't understand why he has to hate on static type systems so much. I appreciate and use both dynamic and static languages all the time, and both have their own respective strengths and weaknesses. There are some problems for which a static type system is extremely helpful, and others where no type system can really express the problem well. To say that a whole active branch of CS that affects the most popular languages in current use is worthless is a little presumptuous of him.

If anything, his analogy between the impracticality of fully deterministic NLP and H-M type inference is weak. You want static typing to be deterministic and quickly resolved, or else you'll get nasty C++-like compile times. (Of course, it also has to be smart and consistent, or you just get something that will just make you go through the motions for little gain. Smart static typing can be very useful, but dumb static typing is a waste of time.)

I understand people hating on static typing, though - when most people think of static typing, they think of C++ and Java. I didn't see the point of static typing until I learned OCaml, and that still has room for improvement. (OCaml + Haskell-style typeclasses + error messages that weren't obviously transliterated from French as an afterthought would be a nice start.) There are only a few languages with well-designed static type systems, and the most obvious one insists on being all indie rock about it ("avoid success at all costs").

error messages that weren't obviously transliterated from French as an afterthought would be a nice start

Don't worry too much about this one. I am French, and the phrasing of OCaml's error messages is just as strange before the transliteration.

Hah, nice to know. :)

The Haskell / indie rock comparison is remarkably cogent. It makes all the more ironic that I think it really was better in 2005 before it got 'popular', before the age of dons and reddit-spam monad tutorials.

It's unfortunate that OCaml sucks as hardcore as it does, seemingly everything they added to ML is either useless or harmful (except for camlp4), but unfortunately even fewer people use ML. SPJ expressed interest in a new Haskell-replacement with eager evaluation, but I don't see that coming anytime soon.

I don't think OCaml "sucks hardcore", I just find it a bit frustrating, the same way that Common Lisp is not as good as my ideal Lisp (which doesn't exist, and therefore isn't burdened with any compromises). I'd still rather use it than several other languages. Everything has quirks.

To me, it seems that the purpose of a most compilers for statically typed languages is to either generate a lot of type information (*ML, Haskell etc.), or require lot's of redundant typing (the keyboard kind) (Java etc.), only to throw it all away during compilation. This makes no sense at all to me.

Being able to throw away the static type information is a good thing. (Also Haskell throws away less than, say, Ocaml.)

The static types in Haskell are a way to mechanically prove certain propositions about the program. You do not need to conserve the proof during runtime---because your very aim was to statically ensure runtime properties.

Static typing means structuring your code in a way that the language itself can mechanically verify some of your assumptions. Certain attributes can be exhaustively proven, rather than requiring "lots of redundant typing (the keyboard kind)" to write out test cases.

Why would you think all of it is thrown away during "compilation", and when you say "compilation" which phase are you referring to?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact