Hacker News new | ask | show | jobs
by JulianMorrison 5495 days ago
I've played with it, it's a nice language. Don't see why people hate on it, it's not especially verbose, and the static types are actually helpful (like, you can cleanly loop over the extent of an enumerated type, for example) as well as more than usually protective (like, you can type define "inches" and "centimeters" as kinds of integer, and it won't let you mix them by accident).
1 comments

F# has units of measure too.
It goes a bit deeper than that.

Most static typed languages - C, Java, Haskell, etc are memory representation centric in their primitive types. Ada is usage centric.

You see that two ways.

First, in most languages any item with underlying implementation X can represent any legal value of X, even if it makes no sense. If you want to represent a quantity whose maximum value is one million, putting it in anything shaped like a 32-bit int will let it contain the illegal value "one million and one". Contrast Ada which will let you cap its legal range.

Second, in most languages any item with underlying implementation X can contain anything else with the same implementation. Your typedef'd int can be put into anything else int-sized. Contrast Ada, which won't permit you to mix apples and oranges if they are defined as distinct types with int storage.