Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 2930 days ago | link | parent

Oh, and I completely forgot about typeclasses.

Typeclasses are amazing. They're similar to multimethods, but more powerful, and they have the same performance as regular functions.

You can use them to solve the expression problem, giving you a huge amount of flexibility, power, and conciseness. Or you can use them to create dynamically scoped variables which actually work correctly (unlike dynamic variables in most languages).

The thing is, typeclasses are only possible with static types. They're the main reason I changed Nulan to be statically typed.

----

By the way, I would like to point out that the static type systems in languages like Haskell is very different from the static type systems in other languages like C, C++, or Java. So even if you like/dislike one of them, you might end up liking the other. I used to lump all of the static type systems together, but I think that's a mistake.

There are bugs which are not caught by C, C++, or Java, but which are caught by Haskell. And there are programs which do not type check in C, C++, or Java, but which do type check in Haskell.



2 points by akkartik 2930 days ago | link

Yes, I wanted to say something similar in response to your phrasing that "type systems (including dynamic and static type systems) are another way to carve out the territory". When you say "dynamic type systems", in particular, I think Python and Ruby, and the modularity guarantees there seem much inferior to tests. But Haskell and the more advanced type systems might well disprove my thesis.

-----

2 points by Pauan 2930 days ago | link

You're right: dynamic type systems tend to provide very weak guarantees. But I'll still take those guarantees over silent failures.

In my opinion, static guarantees (including static types) are the best, followed by unit tests, followed by dynamic guarantees (including dynamic types).

-----