Erlang’s syntax is a weakness. Almost nobody looks at the Erlang syntax and falls in love with it at first sight. No, it takes time to learn it and understand how good it is. You need to sell Erlang to people without showing the Erlang syntax. If you do show it, then you need to hide the parts that feel alien. Function calls are OK. Recursion, not so much. Maps are OK. Records, not.
It’s too bad Erlang syntax is such a sticking point for people. Despite looking funny, Erlang syntax is is a huge strength. It takes all of 1 hour to grok almost entirely. In this sense, Elixir is a step backwards. All the syntax that attracts the “oh it looks like Ruby” crowd is complicating the language and making it harder to learn. Unfortunately, I think the software industry is too immature (is any industry mature enough?) to admit they like certain syntax just because it makes them feel good rather than fulfilling the utilitarian function of writing correct programs.
[Comment removed by author]
My comparison is Erlang vs Elixir, though. Not Elixir vs Ruby. Being less insane than Ruby is not a challenge, but Elixir is still more complicated than Erlang.
It does all this while acting as a strong selling point for new adopters.
This is exactly my point, though. The Erlang syntax is weird and that seems to be enough to dissuade adopters, despite it being quite utilitarian.
It certainly doesn’t seem to be making anything harder to learn.
In a world where Python and Ruby are considered easy, I do not believe this is a powerful statement.
I think that Erlang’s syntax has some warts even if you’re strictly comparing it to other languages with fairly lightweight syntax. In particular, whenever I use Erlang I find myself mentally comparing it to ML-family languages and wishing that the syntax was similar.
I think the software industry is too immature (is any industry mature enough?) to admit they like certain syntax just because it makes them feel good rather than fulfilling the utilitarian function of writing correct programs.
Absolutely agree. Programmers believe their job is to write code, when in actuality it is to write as much as necessary.
We have a long way to go.
I wrote a large internal application in Erlang at an old job of mine.
“I wrote it in Erlang?”
“It’s like Lisp, but…”
“Oh, God I hate Lisp! The syntax is terrible!”
“Erlang’s syntax is way different. It’s kinda like Prolog.”
“That’s even worse!!!”
Lisp syntax isn’t terrible. If you know how compilers work, you know in Lisp you write ASTs directly. It’s actually the easiest syntax out there.
If you don’t know what ASTs are and what compilers are doing, that may be inexperience, but if you don’t care and don’t want to know, you shouldn’t be writing code.
That said, I disagree that one language is “like” another because of syntactic similarity. By that logic, C is like C++ and C++ is like Java, when they’re actually completely different languages.
I wasn’t saying “Erlang is like Prolog” because of its syntax. I was saying Erlang’s syntax was like Prolog’s syntax. And Erlang is “like Lisp” in that it supports first-class functions, garbage collection, that sort of thing.
Then there’s Lisp Flavored Erlang if you prefer parentheses :D
I tried Erlang a long time ago, and didn’t think much of the syntax one way or the other.
I guess I’ve used enough languages that different syntax doesn’t bother me. I choose languages by how well they support the semantic concepts I need to use. Unless the syntax gets in the way of that somehow, then I don’t really care about it.
In my experience, erlang’s syntax while foreign to most developers isn’t much of an actual stumbling block. However, it’s difference from most languages does give developers an easy excuse to not consider it.
We are a fad driven industry with a penchant for throwing the baby out with the bath water every 5 years.
As a result, people become skeptical of touted complexity reductions in using languages such as erlang.
It’s not until those rough edges are smoothed a bit (elixir), that the benefits of the language become easier to convey.
Meanwhile languages with less complete concurrency solutions but lower barriers to entry (golang) gain huge followings in short amount of time (and with good reason).
Anecdotally, I know of a few people who have gone from elixir->erlang, and I hope the good work that Jose has done continues to make conversions.
Erlang is confusing and annoying. What would it look like, to have an ALGOLish syntax, but not otherwise change anything? I guess since it is dynamically typed you’d be looking at something sitting in the triangle formed by Bash, JS and Python.
It would probably look something like elixir, but is it really better? Atoms now have rabbit droppings, but worse: A lot of algorithms lose their obvious symmetry, e.g. elixir, v. erlang – and although you can write elixir almost like you would write erlang, it’ll always be longer and you will lose the increased approach-ability offered by using a worse syntax
Atoms are that way because (I think) they are similar-ish to symbols in Ruby, which also use :. Also, people don’t seem to want to type variable names with uppercase first letter, so something had to be done.
I’m kind of over arguing for Erlang’s syntax. Maybe I hang around Elixir people too much, but a big part of the community just flatly disregards it as “old” and “ugly” without room for debate.
Atoms are also similar to Lisp symbols, which do not use :.
I’m one of those people who think Elixir is old and ugly, and I don’t think it’s worth debating. Iverson already explained what’s wrong with this decades ago, and I’m convinced the reason people like ALGOLish syntax has more to do with their own vanity than things that should be important to programmers (like the ability to produce quality software).
The syntax of Ruby/JS/&c are generally less succinct that Haskell, Erlang and friends. I grant that.
If we were to say, “atoms now have colons” or “atoms now have one additional character” it makes the trade-off much clearer.
Erlang syntax is confusing for a variety of reasons. It’s not uniformly confusing – there are good things about it in places – but even the comma, semicolon, period thing is a good example of something pervasive and perplexing. (It makes much more sense in Prolog, whence it is inherited.)
The author says that one way to convince people of trying Erlang is by hiding its weaknesses (e.g. its syntax) and focusing on its strenghts (e.g. its performance). He gives MongoDB as an example, essentially saying that the folks of MongoDB originally went to meetups and showed benchmarks to people, instead of focusing on its high unstability.
I’d say that I’m a bit mitigated on this. The problem is that despite its weaknesses, MongoDB presented far more concrete advantages to people, directly from the start. Those advantages were obvious. But the same may not apply to Erlang.