I have to disagree on some points:

1.  Traversing the AST is not as complex as it sounds. You literally need
four clauses (and the first two can be written as proxy to the third):

def traverse({left, meta, right})

def traverse({one, two})
def traverse([_ | _] = list)

def traverse(other)


2. If we converted everything to 3 element tuples, the issue is not only
Macro.keywordify as there are also macros that match on atoms too (and on
strings too albeit less common). For instance, every Phoenix application
does it . So making everything a three-element tuple would hurt that.

3. Note that {:integer, [], 1} and {:atom, [], "foo"} would be their own
AST nodes too, as there are now new rules for what the 3 element actually
is. Sure, it is more consistent in terms of metadata, but you are not
really reducing the number of nodes. You could make them {:integer, meta,
[1]} and similar but that would mean introducing new special forms.

I definitely agree that having a fixed place for metadata would improve
certain cases but the trade-offs are much more nuanced than implied. The
current AST was not optimized for reconstruction but for developer
ergonomics and I believe the proposed standardisation would make certain
features much more bureaucratic.

*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JDiCU2-viWn06FOwLAQKTZ-ufTPdihUn8UnaTcC5ZHfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to