
A Week with Elixir - Whitespace
http://joearms.github.io/2013/05/31/a-week-with-elixir
======
sambeau
I'll take this opportunity to re-remind HN of Wadler's Law:

    
    
      In any language design, the total time spent discussing
      a feature in this list is proportional to two raised to
      the power of its position.
        0. Semantics
        1. Syntax
        2. Lexical syntax
        3. Lexical syntax of comments
    

[http://www.haskell.org/haskellwiki/Wadler's_Law](http://www.haskell.org/haskellwiki/Wadler's_Law)

------
rdtsc
I admire Joe Armstrong. He has tremendous experience and yet he is very humble
(at least, say if you compare him with Linus). He is quite up there in age,
where lots of people sort of give up and move to Florida to retirement homes.
Joe still programs, explores new languages, writes Erlang books (he has a new
one coming out soon), gives talks. You can tell from his voice he is still
passionate and excited about programming, about fault tolerance and about
distributed systems.

------
benaiah
Slight quibble: his JS example is a bit contrived. He gives the following:

    
    
        js> a = 5;
        5
        js> f = function(x) { return x+a }; 
        function (x){return x+a}
        js> f(10)
        15
        js> a = 100
        100
        js> f(10)
        110
    

Well, yes, this is true, but it's not a problem with JS' closures, it's a
problem with its variable declaration. a is declared as a global variable by
default. Yes, this is bad, and everyone knows it's bad, but it's a bit
orthogonal to closures. It's very simple to solve this in JS:

    
    
        js> a = 5;
        5
        js> f = function (x) { var a = 5; return x + a };
        function(x){var a;return x+a}
        js> f(10)
        15
        js> a = 100
        100
        js> f(10)
        15

~~~
Adrock
I'm quibbling with a quibble, but I don't agree that it's orthogonal to
closures.

Your example doesn't really demonstrate the eponymous "closing" aspect of the
closure and doesn't solve the problem that the OP is calling out. Closures are
functions that refer to non-local variables. [1] [2] Whether the language
provides lexical or dynamic scoping [3] is critical to how and when closures
can be used in that language.

[1]
[http://en.wikipedia.org/wiki/Closure_(computer_science)](http://en.wikipedia.org/wiki/Closure_\(computer_science\))
[2] [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Guid...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Guide/Closures) [3]
[http://en.wikipedia.org/wiki/Scope_(computer_science)#Lexica...](http://en.wikipedia.org/wiki/Scope_\(computer_science\)#Lexical_scoping_and_dynamic_scoping)

------
anandabits
Elixir sounds very nice! Thanks for sharing the link.

It's really exciting to see functional programming beginning to be recognized
by more and more developers. It looks like Elixir will be a great language to
help that trend grow.

------
zachallaun
Some previous discussion:
[https://news.ycombinator.com/item?id=5798049](https://news.ycombinator.com/item?id=5798049)

------
cocoflunchy
Does anyone know if the Elixir team took these comments into account? (The
post if from May 2013)

~~~
rubiquity
That is only four months ago. Elixir is a programming language, not a wrapper
to the Twitter API. I imagine Jose Valim is taking this into account. Joe
Armstrong is someone you listen to when he speaks.

