News for hackers. Stuff that matters.
Re:A Week with Elixir by atombender on Friday May 31, 2013 @12:46PM (#5799673)
I was quite surprised by how amicable and positive this blog post was; I expected him to have lots of objections. It's admirable that an old hand like Joe Armstrong can be so open and accepting of something that essentially sets out to improve on his lifework.

In fact, if you look at his paper on the development of Erlang [1] while at Ericsson, which is coincidentally a juicy, fascinating read, Armstrong is being very forthcoming about the struggle to develop the language, in particular developing a good syntax, and also very forthcoming about the involved parties' lack of experience with language design; in particular, the Prolog-like syntax seems less of a planned decision than a side-effect of the first implementations being written in Prolog itself, and following the path of least resistance. Also, it worked.

At any rate; it seems clear to me that Armstrong values the principles behind Erlang's design (concurrency, immutability, fault tolerance and so on) more than the actual syntax. I wonder, at this point, how amenable he would be to larger syntax changes to Erlang itself, or if he is happy with the fact that Elixir is a completely separate project.

(There is something weird about the effusive tone and surreal humour in the blog post, though. Is this his new "Erlang evangelist voice", or has he always been writing in this way?)

[1] https://docs.google.com/viewer?url=http%3A%2F%2Fwebcem01.cem...

Re:A Week with Elixir by octo_t on Friday May 31, 2013 @03:11PM (#5800712)
He really doesn't care: http://erlang.org/pipermail/erlang-questions/2013-January/07...

  "Today there is an unhealthy concentration on language and 
  efficiency and NOT on how things fit together and 
  protocols - teach protocols and not languages.
  
  And teach ALGORITHMS."
(previous HN https://news.ycombinator.com/item?id=5109052)
Re:A Week with Elixir by hosh on Friday May 31, 2013 @02:05PM (#5800196)
I started working with Erlang for work, on and off, for the past year. I had been working with Ruby for a lot longer. I too, liked the Erlang design, but the syntax is a wreck. It's also true, use something long enough and you get used to it. I've noticed long-time Erlang users tend to have this mystical ability to see the underlying elegance expressed by the Erlang syntax while ignoring the syntactic awkwardness.

Elixir brings a lot of good stuff onto the table. I hope the Elixir community incorporates the changes Joe Armstrong suggests.

One in particular: f.() makes perfect sense in the Ruby world because everything is an object (we're sending the '()' message to the 'f' object); but things are built out of functions in the Erlang world, and f() makes more sense there. There are no objects or messages to send them, so 'f.()' gets parsed as an extra dot at the end of the name. I think Armstrong's other suggestions follow in the same vein.

The point isn't to try to make Elixir have a Ruby-like syntax so much as, having distilled the syntax design principles developed in the Ruby community, apply it in Elixir.

Re:A Week with Elixir by jerf on Friday May 31, 2013 @03:22PM (#5800782)
"I've noticed long-time Erlang users tend to have this mystical ability to see the underlying elegance expressed by the Erlang syntax while ignoring the syntactic awkwardness."

It's just practice. It no longer trips me up, but I still find it klunky and unpleasant after nigh on 6 years of medium-duty usage.

    lists:map(fun (X) -> X + 1 end, [1, 2])
vs.

    map (+1) [1, 2]
Augh. Yes, I'm cheating perhaps a bit with the (+1), but Erlang syntax has enough other stuff in the way for it to still be fair in the end. For instance, the example Joe gave, where you end up with this long sequence of

    IdentifierA = operationA(ArgA),
    IdentifierB = operationB(IdentifierA, Something),
    ...
Re:A Week with Elixir by davidw on Friday May 31, 2013 @04:31PM (#5801202)
"Ant turd tokens", or .,; are a big pain in the neck when refactoring stuff. For instance

    case Something of
       {ok, Val} ->
          do_something();
       _Error ->
          barf()
    end,
The ; and the , are easy to forget about. Indeed, the , might be changed to a . if you eliminate the next expression, and those things can be easy to miss when fiddling with code.
Re:A Week with Elixir by querulous on Friday May 31, 2013 @04:51PM (#5801315)
[ fun(N) -> N + 1 end || N <- [1,2] ]
Re:A Week with Elixir by 501 on Friday May 31, 2013 @06:10PM (#5801609)
That will produce a list of 2 funs. I think you meant:

    [ N + 1 || N <- [1,2] ].
Re:A Week with Elixir by jerf on Saturday June 01, 2013 @02:44PM (#5805318)
I picked that as a simple example. Yes, I suppose I should have used a fold, or any of the other "everything else" functions that don't have syntax support. My point still stands.
Re:A Week with Elixir by tel on Friday May 31, 2013 @08:55PM (#5802129)
Comparing Haskell and Erlang syntax isn't even fair. Haskell threw homoiconicity and homogeneity way out the window in exchange for some very nice, mathematical notation.
Re:A Week with Elixir by mietek on Saturday June 01, 2013 @09:34AM (#5803870)
Erlang is hardly homoiconic, unless you mean Lisp-Flavoured Erlang.
Re:A Week with Elixir by tel on Saturday June 01, 2013 @03:27PM (#5805546)
No, it's not. I wasn't being precise. I believe Erlang to have a less complex syntax than Haskell, though, being based on Prolog.
Re:A Week with Elixir by gordonguthrie on Friday May 31, 2013 @07:10PM (#5801796)
You need to understand that fundamentally Joe Armstrong is 'a good egg'.

No higher praise is there, in my book...