On 06/10/2014 18:06, José Valim wrote:
> I will nitpick slightly. :)
>
> Lisp macros have a major benefit in that lisps are truly homoiconic
> so it is much easier to construct the resultant syntactic form. Also
> they allow you to create new syntax which elixir does not.
>
>
> I would say creating syntax forms in Elixir is about as easy as in
> Lisps. Because at the end of the day you just use quote and unquote. The
> difference is that in Elixir you need to type "quote" and "unquote" but
> that was a design decision for clarity, not a syntax limitation.
>
> What is definitely easier in Lisps is traversing and understanding
> because the syntax tree is then just a list and not a mixture of tuples
> and lists. In Lisp, what you see (the code) is what you get (the tree).
>
>> Also they allow you to create new syntax which elixir does not.
>
> This is misleading because you still need to abide to the Lisp syntax
> <
http://en.wikipedia.org/wiki/Syntax_(programming_languages)#Example:_Lisp>.
> You can't drop or repurpose the parentheses, you can't make it space
> sensitive. You are still limited to the syntax defined by the tokenizer
> and the parser. Of course some languages restrict more and in different
> ways than others.
>
I'm no language expert but my impression is that Elixir's macros are
similar to Python's Hylang (
http://hylang.org/) where you're
manipulating an intermediate form - the AST - whereas with Lisp it's
more direct.
gvim