News for hackers. Stuff that matters.
Re:Damien Katz: What Sucks About Erlang by jey on Sunday March 09, 2008 @09:09PM (#132833)
Why write this:

  f(X) ->
    X1 = foo(X),
    X2 = fab(X1),
    X3 = bar(X2),
    baz(X3).
When you can write this? (I assume this is legal)

  f(X) ->
    baz(bar(fab(foo(X)))).
Re:Damien Katz: What Sucks About Erlang by mechanical_fish on Monday March 10, 2008 @08:54AM (#133100)
I think this is just toy-example syndrome. In my experience the real-world example looks more like this:

  f(X) ->
    X1 = foo(X, "Blah blah blah", true, :definitely, :ack),
    X2 = fab(X1, X, sizeof(X), X-1, bar(X, "martini"), :with_bells_on, :pdq),
    X3 = bar(X2, "fim tim lim bim whim bim bus stop"),
    baz(X3).
Try chaining that and see how readable it is.
Re:Damien Katz: What Sucks About Erlang by jey on Monday March 10, 2008 @05:38PM (#133467)
Touché.
Re:Damien Katz: What Sucks About Erlang by eru on Monday March 10, 2008 @08:39AM (#133096)
Sometimes shorter lines are easier to read. But in most of the cases you should be right. You can even be more consice by using point-free form:

  f = baz . bar . fab . foo
[Haskell syntax - sorry, I do not know enough about Erlang - but something like this should be possible.]
Re:Damien Katz: What Sucks About Erlang by Tichy on Sunday March 09, 2008 @07:27PM (#132796)
I also dislike =:= for equals (and I forgot the difference to ==, it wasn't clearly understandable for me from the book). =:= is hard to type, why not just use === like Javascript?
Re:Damien Katz: What Sucks About Erlang by Hexstream on Sunday March 09, 2008 @07:49PM (#132803)
There's a thought I've had in the back of my mind for quite some time but it seems so obvious that I think there must be a glaring flaw I'm not seeing otherwise it would already have been done extensively:

Whenever a language has a burdensome and rigid syntax, isn't there almost necessarily a way to make a good s-expression syntax to substitute it? You'd get macros free!

Re:Damien Katz: What Sucks About Erlang by gruseom on Sunday March 09, 2008 @08:38PM (#132824)
If by "good s-expression syntax" you mean a representation suitable for embedding into a Lisp, then yes: it's obvious, there's no glaring flaw, you get macros for free, and it is done extensively. There's an s-expression representation (or several) for pretty much anything you'd want to integrate with a Lisp program. Examples of common ones are HTML, SQL, and Javascript.

Where you don't see this done much is with general-purpose programming languages. This is probably because people who find s-expressions useful are already using Lisp as their general-purpose language. So it's mostly done for interoperability with other, pre-existing systems, like web browsers or C libraries. (You can see an example of the latter on slides 15 and 16 of http://www.xach.com/lisp/lispvan-2008-02-28.pdf.)

Erlang is a fascinating intermediate case. The distinctive value of Erlang is arguably not in the language, but in its runtime and libraries (including Mnesia). For this reason, the "general-purpose" caveat doesn't apply, and it's easy to see why someone might want to build a Lisp program on top of the Erlang runtime via embedded s-expressions. I seem to recall that there was a game company already doing this. If anyone knows about that or other examples, please post them here.

Re:Damien Katz: What Sucks About Erlang by lg on Sunday March 09, 2008 @08:57PM (#132830)
robert virding (of "hello, robert" erlang movie fame) released "lisp-flavoured erlang" recently. Haven't played with it yet... http://groups.google.com/group/erlang-questions/browse_threa...
Re:Damien Katz: What Sucks About Erlang by eru on Monday March 10, 2008 @08:40AM (#133097)
Hello, Dave.
Re:Damien Katz: What Sucks About Erlang by yters on Sunday March 09, 2008 @10:52PM (#132879)
Aren't all languages sexps at the parse tree level? Lisp is basically a language without the syntactic top layer.
Re:Damien Katz: What Sucks About Erlang by obdurak on Monday March 10, 2008 @10:34AM (#133140)
You could go further and say that all languages are lists of characters and wish for a language without the lexical top layer.
Re:Damien Katz: What Sucks About Erlang by davidw on Monday March 10, 2008 @03:53AM (#133043)
You basically shouldn't be using 'if' in Erlang - it's very rare that a pattern match wouldn't be a better option.

That said, I agree with him:

http://journal.dedasys.com/articles/2007/09/22/erlang

Re:Damien Katz: What Sucks About Erlang by a-priori on Sunday March 09, 2008 @08:23PM (#132822)
Most of those are minor nit-picks, but I do agree with him about string handling. Strings should be tagged. "dog" should be equal to {string, [100, 111, 103]} or something.