Hacker Newsnew | comments | show | ask | jobs | submit login

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?


Applications are open for YC Winter 2016

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