The lispy nature of Elixir

Found this interesting article:

2 Likes

It is indeed very lispy and that’s a beautiful thing, but I do think that not actually being homoiconic robs the users of certain freedoms. Because it’s necessarily tied to a certain syntax and this syntax has to have certain forms as well as keywords, a user will never be able to truly be on a level playing field with the language creators, barring forking the compiler. There are certain syntactic forms that you simply can’t introduce to Elixir (which some would argue is a good thing, I suppose, considering it does have a syntax). A homoiconic language doesn’t have that issue.

Edit:

To emphasize: Not having homoiconicity and a way to affect the reader/parser means that your language can never be as democratic as a platform like Racket, for example, which gives everyone who uses it exactly the same tools as the language/platform creators.

5 Likes

I think calling Elixir homoiconic stretches the meaning of the word quite far. You could call most languages homoiconic in that case. The thing in Elixir is that you have quote/unquote which allows you to avoid having to explicitly write the AST (yes there is one) in macros. Try writing macros without them and you grasp the true meaning of homoiconic. :wink:

7 Likes

Look at most of my macro libraries. :wink:

/me is very comfortable with the Elixir AST

4 Likes

Oh. We, protein-based life forms, are not so comfortable using AST directly. :slight_smile:

6 Likes

Heh, it’s really really easy, inconsistent, but easy. :slight_smile:

3 Likes

It’s interesting to compare the Erlang AST and the Elixir AST. The Erlang one is extremely specific and (almost) every syntactic construction as its own representation in the AST while the Elixir one has (in most cases) a more generic structure. When you are working with the Elixir AST you still have to recognise and specially handle each different case even if they look the same.

This is the same for lisp where everything is (what-to-do arg-1 arg-2 ...) which of course is the AST itself.

4 Likes