3 ms·
Interesting interview, though I must admit I can't stand the format of the site - I always copy the whole transcript into Emacs, m-x fill-individual-paragraphs,
by silentbicycle 17y ago
Interesting interview, though I must admit I can't stand the format of the site - I always copy the whole transcript into Emacs, m-x fill-individual-paragraphs, and read it there.
This part really jumped out at me:
"If you do generic programming in Haskell, you can write a
paper about it. If you do generic programming in Erlang, it's 4 lines - one for lists, one for tuples, one for basic values."
I'd like to hear from someone with more Haskell experience (it's not my thing), but it helps here that Erlang matches and dispatches by structure, not types per se. It's common to use a tagged tuple, like { point, 1.5638, -2.4144 }, for informal type annotations, but they're not mandatory.
Another significant difference between Erlang vs. Haskell and OCaml is that since Erlang is dynamically typed, it can far more easily accommodate incremental changes without having to stop it. Doing static validation of changing types in a running, distributed system adds major complexity, with many of the same problems as handling schema changes in a database. Erlang's design reflects that it's probably simpler to let it fail and put effort into recovering gracefully, rather than trying to make it bulletproof.
- plinkplonk 17y agoThis bit was interesting. "With Haskell you've been always thinking it's side effect free, right? Writing a function is side effect free. In Erlang just the fact of passing a message is a side effect. Don't you find it a bit of a problem or a difficulty when programming with Erlang? Most of my Erlang programming is side effect free. I think I probably write very unusual Erlang programs that look a lot like Haskell ones. Now and then, I do write side effecting code. For example, when I use the random number generation libraries that comes with Erlang, it has a side effecting interface. It's very tempting when you are building something on top of the library with a stateful interface to build code on top of that that also has a stateful interface. " I find that one of the key advantages of programming in Haskell is that you think in terms of the minimum stateful interaction your program needs and most of the program is not "side effecting code"
- Agent101 17y agoThere is nothing stopping you using tagged tuples in haskell. I don't think it is done so much because type signatures are very useful and cross:: (Num b)=>(a,b, b) -> (a, b, b) -> (a, b, b) is more wordy than cross :: (Point p) => p -> p -> p. You can use newtypes but then you lose the genericness.
- jganetsk 17y agoDynamic typing is merely a mode of use of static typing. All you have to do is add one line of code to your Haskell program: data Dyn = I Int | C Char | S [Char] | F (Dyn -> Dyn) | P (Dyn, Dyn) Now you can do matching "by structure" in Haskell just as easily is you can in Erlang.