Hacker News new | ask | show | jobs
by rdtsc 4893 days ago
> I was always scratching my head over why this place needs a period and that place doesn’t

I like Fred Hebert's (author of http://learnyousomeerlang.com/) explanation of syntax on his blog:

http://ferd.ca/on-erlang-s-syntax.html

At least the "template" explanation is most helpful to me.

> then there was just plain weird stuff like one-based indexes.

Interestingly, I don't think indexing is really that common in idiomatic Erlang. In other words when processing lists, one can split them into head and tail [H|T] or uses folds and maps.

1 comments

Thanks for the link! I hadn't seen that one before. While I think I'm already thinking in expressions, Erlang's placement of punctuation never really made a lot of sense to me. Maybe that explanation will finally clear up my confusion.

So far, I agree with the note about 0/1-based indexing. It's just not used a lot. However, I find it pretty calming that indexes will work the way I expect them to, should I ever need to use them.

Now that I think about it, these two points (syntax and indexes) are somewhat petty things to point out about the Erlang : Elixir relationship, and I feel a bit bad for repeating them in the blog post. Things like protocols are way more interesting (and hopefully, are what drives you to try out Elixir). (-:

I spent last night looking at Elixir and I really like it (at least as far as I could see in one evening).

I like Erlang and I wouldn't say Elixir is there to replace it. I see a use of Elixir for scripting or creating DSL. Also it gets a huge bonus by running on BEAM. As far as internal design (and I am speaking as an amateur here), BEAM is far superior to JVM from the reliability and concurrency point of view. So having Elixir around is helping Erlang team, kind of like many see Scala and Clojure as a way to make the Java ecosystem appealing and exciting again.