3 ms·
If you seriously look at the Erlang syntax you will find it is very simple, concise and consistent. We wanted to keep it simple. Yes, it different from most OO
by rvirding 11y ago
If you seriously look at the Erlang syntax you will find it is very simple, concise and consistent. We wanted to keep it simple. Yes, it different from most OO languages, most functional languages look different, but that is not surprising as the semantics of Erlang and other functional languages are very different from the semantics of your typical OO and imperative languages like Jave, Ruby and C. If it is doing different things why should it look the same? That would just be confusing.
Also, if you again look seriously at the syntax you will see there is actually very little Prolog in it, most of that disappeared along the way when it became functional. What is left are variables, atoms and lists. Records are a bit messy although they are very logical and consistent (again) but no one has come up with an alternative that works. They also fit the language semantics.
Also I personally don't see the problem with learning another syntax. I know and have used about 9-10 so far so what is really the problem?
And I rather like Prolog syntax, it simple, concise, consistent and truly homoiconic though with operators.
- YeGoblynQueenne 11y ago>> And I rather like Prolog syntax, it simple, concise, consistent and truly homoiconic though with operators. I first got interested in Erlang because of its Prolog-like syntax. I was a little bit disappointed when I realised it doesn't actually use unification. That would have been a great feature- why was it left out of the language, I wonder?
- masklinn 11y agoBecause logic programming wasn't the goal of erlang?
- rvirding 11y agoIt was originally in the original Erlang interpreter written in Prolog but you could use it for back-doors in the communication so we removed them. If you sent an unbound variable in a message then the receiving process could reply by binding the variable. We wanted all communication to be explicit. I agree though that unification is cool. And I still like Prolog and other logic languages, and have implemented Prolog in Erlang, of course. We also gave some thought to laziness but felt it just didn't fit as for the type problems in which we were interested. For those problems when things are done is critical, not just that they are eventually done. That would have meant a lot explicit evaluation which defeated the point of laziness.
- deleted 11y ago[deleted]
- cbd1984 11y agoThe downfall of Prolog's syntax is its weird rules surrounding whitespace and indentation. A few braces and a little more Algol or Lisp wouldn't have killed you, you know. Of course, Python followed the same strange ideas, so I guess they're well-ingrained now.
- rvirding 11y agoI don't know of any rules in Prolog surrounding indentation and the only whitespace rule I know of is that you cannot have whitespace between a functor and the left paren of its arguments. What have I missed?