Skip to content

Comment on Elixir v0.5.0 released

Comments

I am quite excited about this project. When I was looking at Erlang the syntax totally turned me off, but the rest of it is awesome.

If you're talking about the comma-semicolon-period thing, it seemed strange and foreign to me as well--until I realized that , and ; are just && and || with different reactions under unification. Basically, Erlang's grammar is defined such that any expression works with all the spaces stripped out--so it has to have some other way to encode things that would normally use the juxtaposition or line-separatation "operators" of other languages, in a more explicit way. Erlang's case statement, for example--and by extension its multiple-function-definition-under-pattern-matching--is basically one long ternary operator chain: (a?b:(c?d:(e?f:g))), and so forth.

What didn't you like about it? I remember hating the syntax when I first start but forgot why.

After I worked through the initial aversion, the syntax no longer feels worse than say, Python, it is just different. In fact, I wouldn't give up Erlang's pattern matching functionality for anything and I miss that feature in any other language I use.

The one thing that really bothers me about its syntax is all the different line terminators. It makes moving around patterns painful.

I sort of dislike other aspects too, but nowhere near as much.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.