Erlang vs OCaml (best niche to fit)

Hi I'd like to pick up one FP language (it's always a pain when you work in a position that does not require you learn much), and after doing some research, I felt Erlang and OCaml are the two that I'd really like to get my feet wet for the following reasons:

1) I work mainly on high-availability web server back-end system in C++. I heard Erlang is a great fix in scalability and fault-tolerance. Though I don't think my current company will have any project in Erlang, I feel Erlang may be a good language for my long term career development.

2) I have a co-worker who is really good at OCaml, I mean he is really good at it (but he does not work on that for his daily work now. He maintains several library). So I figured that he may be a good resource if I learn OCaml.

My interests are mainly on distributed systems (my current work is some midldle-ware development work) and high-performance computing (guess what, I had a couple of years graduate school research on it, in particular PDE in Financial applications -- so I always felt I may go back to do some finance modeling work maybe sometime later)

Any suggestions? Please don't suggest "learn both", as I am not that smart :-)


Ocaml is a great language -- one of my favorites -- but if your interest is distributed systems than I'd recommend going with Erlang, which is head and shoulders ahead of the other FP languages with regards to distributed systems (although there's an offshoot of Ocaml called Jocaml which has some interesting aspects).

Ocaml is weaker even when just looking at parallelism, given its underlying architecture. Both Haskell and Clojure have better stories here, imho. (That said: once you get one FP language, you'll be able to carry the fundamental principles to other languages pretty easily, and they might be useful in the future. Both Scala and Clojure could easily sneak their way into organizations by virtue of the JVM.)

I think Ocaml is a great way to get started in FP, and Erlang is not very difficult once you have the basic FP concepts down.

But the suggestion from 'aneccodeal' is fantastic-- ie, if you are interested in Ocaml and have a friend who is already strong in it, by all means develop a concurrency (perhaps MPI) library for it.

Keep in mind, however, that one of the barriers to making Ocaml concurrent is the lack of concurrent garbage collection (or so I have read).

If you have a co-worker who is "really good" with OCaml then it sounds like you have a great resource assuming that s/he is willing to answer your questions. It's always easier to learn when there's someone knowledgeable around that you can ask questions of if you get stuck.

Yes it's true that OCaml doesn't have the best story when it comes to parallelism, but there are ways to get parallelism in OCaml (fork-based seems to be the most common - checkout which includes things like parallel map: ). Also, it seems that Erlang's Actor-based concurrency is really fairly easy to duplicate in other languages. Maybe you and your co-worker could work on a project to develop an Actor-based concurrency library for OCaml? That would give you a nice learning project that you co-worker would probably find interesting enough to work on with you... in addition you could end up creating something useful for the entire OCaml community.


上一篇: 什么更高性能? Haskell或OCaml

下一篇: Erlang vs OCaml(最适合合适的位置)