erlang OMG Erlang Really Does Suck

I posted the other day quite facetiously that Erlang sucked based entirely on a stupid web statical graph.

Of course, I got a few hits so I investigated the sources. I found this cool blog posting about the shortcomings of Erlang. You can tell the dude really does like Erlang but has a few issues. I have no idea why, other than venting, this cat is writing this as Erlang isn’t going to change anytime soon and definitely not changing a fundamental issue like line terminators.

I would also like to give the dude props for knowing his language history and calling Javascript an Algol based language.  Ya don’t see that every day.

Erlang is based originally on Prolog, a logic programming language that was briefly hot in the 80′s. Surely you’ve seen other languages based on Prolog, right? No? Why not? Because Prolog sucks ass for building entire applications. But that hasn’t deterred Erlang from stealing it’s dynamite syntax.

The problem is, unlike the C and Algol based languages, Erlang’s syntax does away with nested statement terminators and instead uses expression separators everywhere. Lisp suffers the same problem, but Erlang doesn’t have the interesting properties of a completely uniform syntax and powerful macro system to redeem itself. Sometimes a flaw is really a strength. And sometimes it’s just a flaw.

Because Erlang’s expression terminators vary by context, editing code is much harder than conventional languages. Refactoring — cutting and pasting and moving code around — is particularly hard to do without creating a bunch of syntax errors.

Consider this code:

blah(true) ->
foo(),
bar();
blah(false) ->
baz().

Lets say I want to reorder the branches:

blah(false) ->
baz();
blah(true) ->
foo(),
bar().

Or change the order which foo() and bar() are called.

blah(true) ->
bar(),
foo();
blah(false) ->
baz().

What’s the problem? Note in each example the bar() lines, they have a different character ending each line: bar(); bar(), bar().

In Algol based languages the statement terminators are the same everywhere (usually semi-colon, newline or both). The Javascript version:

function blah(flag) {
if (flag) {
bar();
foo();
} else {
baz();
}
}

Erlang expression separators vary context to context and it’s simply more mental work to get right.

Damien Katz: What Sucks About Erlang

logo OMG Erlang Really Does Suckp.s. You may be familiar with the name of this Coding Wizard, Damien Katz, he’s the creator of CouchDB which seems to be getting some good press these days. Oddly enough, it’s written in Erlang…(now I know why I sensed he liked Erlang)

I clipped some stuff on Drizzle from ReadWriteWeb and that same article mentioned CouchDB in the same list.

CouchDB is a free, open-source, document-oriented database. Derived from the key/value store, it uses JSON to define an item’s schema. CouchDB is meant to bridge the gap between document-oriented and relational databases by allowing “views” to be dynamically created using JavaScript. These views map the document data onto a table-like structure that can be indexed and queried.

At the moment, CouchDB isn’t really a distributed database. It has replication functions that allow data to be synchronized across servers, but this isn’t the kind of distribution needed to build highly scalable environments. The CouchDB community, though, is no doubt working on this.Is the Relational Database Doomed? – ReadWriteWeb

More information on the scaling or not scaling of CouchDB can be found here:

At the moment, CouchDB runs best on a single machine with multiple machines for a cluster using replication to synchronise data. Erlang allows a VM to run on multiple machines and we do not yet take advantage of that fact. This is an area that is worth investigating. The road map is at http://incubator.apache.org/couchdb/roadmap.html … scaling parts are Future Feature work. A couple of people have voiced interest in contributing there especially the database partitioning, but nothing has come out of that yet. Configuring distributed systems – Couchdb Wiki

p.p.s. Any excuse is a good excuse to show another picture of Master Shake.

the drizzle2 OMG Erlang Really Does Suck

Glue Huffing Chickens Picked These Posts: