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

I just picked a random file in RabbitMQ to see how erlang looks like - https://github.com/rabbitmq/rabbitmq-server/blob/master/src/...

Then I thought of looking into something I might understand: https://github.com/apache/couchdb/blob/master/src/couchdb/co...

The syntax is indeed scary. Unless erlang provides features that are overwhelmingly compelling that I just cannot live without, I cannot imagine coding in it. Go seems more approachable.




s/understandable/familiar/

Go is based on C, so of course it is more familiar to many people, as most popular languages share that root (something for language designers to at least ponder). Lisps are hard to follow, too, if you aren't familiar with s-exp languages. If you had a prolog background, Erlang wouldn't feel nearly as overwhelming.

The hardest parts about understanding Erlang programs, IMO, are understanding message passing (already there with Go), supervisors, and managing state in a stateless system (the latter two aren't what I'd consider common idioms in other languages (though supervisors are easy to reason about due to operating systems). Understanding the syntax is something a short afternoon can resolve.


No idea at all why you're downvoted. I came to erlang after spending years working on a C++, actor model, message passing codebase. Unsurprisingly (although it was to me at the time) I felt quite at home.

The difficulty came from the new syntax and Erlang-style control flow. And as you say, those are entirely a matter of familiarity. I still find python to be more readable and writable, but by no means does that imply Erlang is not understandable.


To be fair, Erlang actually has much less syntax than any other language I've seriously used. It's just not C-like, for historical reasons. It's remarkably terse, but readable (after learning the basics), which is quite interesting.

I suggest flicking through Learn You Some Erlang[0] to understand some of it... don't skip the chapters on OTP, which is pretty much necessary to understand how an Erlang program is organised.

[0] http://learnyousomeerlang.com/content


You might check out Elixir. Which is, crudely framed, making the syntax less Prolog-y while still running on top of the BEAM and OTP.

http://elixir-lang.org/


It's not scary, it just doesn't look like C. It's really simple to read if you learn the basics.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: