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

It is not just about Erlang, but any language+runtime which has been designed upon a well-known set of sound principles (immutability, share-nothing, message-passing).

As long as order of evaluation does not matter (for a pure-functional code) some [major] parts of a program could be evaluated in parallel by runtime without any changes in the code (especially when a high-order function composition - map/filter/reduce/etc is the primary pattern). So, Haskell, for example, will do it too.




> So, Haskell, for example, will do it too.

By "will do it" you mean "would, in theory, support a compiler that parallelized significant amounts of idiomatic code with no source changes"? Maybe. I don't think any existing Haskell compiler does that, though.


I've had GHC automagically parallelize tree-traversal code before. However, I think in general you have to put a bit of work in to it.

Of course, you could theoretically just write an actor library that did the exact same thing as erlang.


Haskell will do what? Automatic parallelization of code?

The big difference between Erlang and Haskell is that Erlang fundamentally encourages the programmer to think in terms of individual processes that communicate by message-passing. Programmers have also been taught that spawning processes is cheap so idiomatic Erlang code typically have tons of them.


> Programmers have also been taught that spawning processes is cheap so idiomatic Erlang code typically have tons of them.

The green threads in Haskell are just as cheap, in some cases, cheaper than Erlang's processes. Haskell programmers are similarly encouraged.

Concurrency and parallelism are pretty easy in Haskell.

http://chimera.labs.oreilly.com/books/1230000000929

http://hackage.haskell.org/package/slave-thread


Yes, indeed. Marlow's book is really good one.


I love my haskell brethren dearly, but haskell isn't organized structurally around an essentially-mandatory fundamentally concurrent, debuggable, quasi-preemptive core like OTP. Not that it won't get there eventually (cf. Cloud Haskell) but it's more than just being able to run concurrent threads. Note: this is not a language flame, just a personal opinion/observation, and I love and welcome correction.


Haskellers like to pick and choose their abstractions. That's why we have MVar and TVar (STM) and IVar and locks/semaphores and unbounded channels and bounded channels and software transactional channels and green threads and Async and OS threads…

You're going to see what Erlang did atomized, implemented piecemeal, and reconstructed. Cloud Haskell burnt too much goodwill in pursuit of a mostly pointless feature.

That's how we ended up with slave-thread…the beginnings of supervisor trees.

Haskellers would rather pick and choose. It's worked well so far.


Let us know when you get to 9-nines on a distributed application.


You are right. Haskell is an academic research vehicle while Erlang is a pragmatic "industry-strength" (i hate these buzzwords, but they are useful generalizations) functional language.

In theory, we could re-write almost any part of OTP in Haskell, in practice, however, "runtime is hard" and the biggest selling point of Erlang is that its runtime and standard library (OTP) has been evolved for almost 20 years and is based on the same principles of a functional language (except, perhaps lazyness by default) as Haskell.

In other words, while Haskell is a "playground for researches of type theory in context of programming languages and compilers" Erlang/OT is a "telecom industry-standard toolkit".

A close analogy, in my opinion, could be the pair of Scheme/Racket and CL. The first was mostly an academic teaching and research tool, while second is a pragmatic (but unfortunately bloated) tool-set.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: