[erlang-questions] Erlang Syntax - again

Justin T. Sampson justin@REDACTED
Wed Mar 12 11:20:21 CET 2008


Funny... Having only written smallish programs in both Haskell and
Erlang, and having read through some library and example code from
each, I've gotta say most of the Erlang code I've seen has been easier
to understand than the most of the Haskell code I've seen, so my own
impression is that Erlang syntax is nicer than Haskell syntax. It's
partly cultural, of course -- I see a lot more single-letter variable
names in Haskell, which maybe is an academic thing -- but syntax
features like the ability to jam random punctuation together and call
it an operator doesn't help.

As for semantics, the computer scientist in me really really likes the
purity and laziness in Haskell, and Erlang's non-pure semantics turned
me off for a while; but when I realized that Erlang does at least keep
all values immutable, the beautiful concurrency model tipped the
scales for me to start checking it out... The one last semantic thing
that bugged me in Erlang turned out to be a misconception: Seeing
references to functions like io:format made me think they were direct
I/O calls, which was disappointing because I hoped that all
side-effects would be done through message passing (to satisfy my
craving for some kind of "purity"). But recently I took a look at the
source code for the io module, and lo-and-behold, it's message
passing! Yay. :)

Okay, anyway, there's another newbie datapoint for y'all. ;)

(Almost all my professional work has been in Java, and now a project
in PHP, which is sad, because my concentrations in college were
programming languages, compiler design, and the theory of
computation... I like Java better than any of the other "mainstream"
languages because at least it has a defined concurrency semantics,
even if it's too low-level; so I've been able to amuse myself with
building higher-level concurrency abstractions, including working on
Prevayler... And prodding people over and over on project after
project to please please properly synchronize all access to shared
state, because you really don't know what's going to happen when that
race condition pops up when you're not looking so it's really not
worth the perceived performance benefit you think you're going to get
because "sychronization is slow" etc., etc., ...)

Cheers,
Justin


On Tue, Mar 11, 2008 at 10:07 PM, Paul Mineiro
<paul-trapexit@REDACTED> wrote:

> Re: syntax vs. semantics, from someone who recently learned the language.
>
>  I got the semantics.  It's why I pushed through the warts in the syntax;
>  and coming from Haskell, there were alot of things that were not as nice.
>  Most of them have already been mentioned, no need to rehash.
>
>  Now I'm used to it, and in 3 months our little startup has a cloud
>  computing infrastructure that I only dreamed about at my large company
>  job, and we never go down thanks to hot code deployment.  So Erlang does
>  not suck.  However I hope it does not rest on its laurels either.  Good
>  syntax makes life more pleasant.
>
>  -- p



More information about the erlang-questions mailing list