Erlang is pragmatic
12monkeys.co.uk
12monkeys.co.uk
http://www.cs.chalmers.se/Cs/Grundutb/Kurser/ppxt/HT2007/gen...
http://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf
I find it highly readable.
- Is it useful?
- Is it fun?
Just OR these two to see if the language has justified its existence.Why do you need so much fault tolerance and concurrency? It seems to me that the regular server would only need to thread a little bit, process incoming requests, and shoot out responses. (this is assuming you're not building MySQL or a heavy duty web server)
erlang is for building heavy duty web servers. It scales down pretty well too, but there is still a learning curve.
YAWS, one of the more-popular webservers written in Erlang (that has docs, unlike Mochiweb), blows Apache out of the water when it comes to serving many users (http://www.sics.se/~joe/apachevsyaws.html). Apache can serve about 4,000 parallel sessions on the same hardware YAWS can serve at least 80,000 parallel sessions. This is due to the high level of concurrency that Erlang enables and encourages.
Another example is ejabberd, one of the most popular Jabber/XMPP servers. It takes advantage of the high concurrency also, which allows is to process many more connections than Openfire or the C-based jabberd and jabberd2.
edit: http://james-iry.blogspot.com/2009/05/erlang-is-not-function... and others seem to agree that "functional" is not the antonym of "practical/pragmatic/useful."
Going one further from the linked blog post, is OCaml functional? By Fischer's definition, yes, but I've written very non-functional (ha) code in OCaml. It's a multi-paradigm language, which happens to have very good support for functional programming, but it isn't limited to it. (I've also written very functional code in idiomatic Lua. Is Lua functional, then?) While functional programming techniques don't go against the flow of Erlang, saying it's functional is probably a bit of a stretch - its design doesn't prioritize this the way Haskell's does.
(HN favors substantial comments over one-line reactions, btw. "I didn't bother reading this" doesn't add much to the discussion.)
This might be an interesting language design methodology. Try to code up something hard (to introduce constraints) and assume you have to build a new langauge to do it. Iow ignore existing languages/libraries etc.
I've never really designed a serious language before, aren't almost all languages done this way?
Thank you. That is exactly what I meant. Whether Erlang satisfies some definition of "functional" or "OO", or "concurrency-oriented" does not matter. What matters is that it's a kick-ass platform for building scalable distributed fault-tolerant apps.
(That said, Erlang is a good introductory language for someone who wants to explore functional programming.)