Does Elixir make other languages obsolete?

I think Lisp made all languages obsolete, including every language invented in the 50-or-so years since. Apparently, people feel free to ignore that fact :slight_smile:

(it is interesting that the number of languages you can sensibly use seems to be growing, and growing fast. I wonder where that will take us).

Lisp is very versatile, but unfortunately until today not very fast. :stuck_out_tongue_winking_eye:

Homoiconicity is a wonderful property to have, but other than that I’d like to say that there are many functions of Lisp that have been added to other languages. In some definitions, one might consider Elixir a Lisp-2 and Haskell a strongly-typed Lisp-1. The same is true for other (functional) languages.

EDIT: Maybe the best thing that might happen to a language is that the important features of that language are incorporated into other languages as well, as this shows that these features are considered to be useful by a larger group of people, and therefore probably applicable to a larger set of problems.

No, we definitely don’t ignore Lisp’s superiority, that is why we have LFE (Lisp Flavoured Erlang) so we can run Lisp on top Erlang/OTP.

LFE gives you the best of both Lisp and Erlang, at the same time.

This may be the wrong forum to state that: https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=sbcl&lang2=erlang - SBCL trounces Erlang so I assume Elixir as well (I couldn’t use elixir as 2nd language, not yet on the benchmarks shootout?). :wink:

And yes, imitation is the best form of flattery. The problem is often that language authors don’t have a good grasp of what they’re imitating (I think Ruby, for example, got a lot of stuff about Smalltalk wrong). So sometimes it feels like we stumble in the dark.

1 Like

I keep looking at it - and keep concluding that Elixir’s macro system is powerful enough for me (and close enough to being homoiconic that I consider Elixir “a Lisp”, whatever that may mean). I’m curious though, is LFE seeing much use? It smells like a niche (Lisp on Erlang) inside a niche (Lisp).

Actually this is wrong, it is an old persistent myth from way back in the 60s and 70s when Lisp was interpreted. It is now compiled of course. For what it does, and for what it has been used for, Lisp is fast. At least as fast as Erlang/Elixir. :smile:

I would be very careful in claiming that you consider Elixir to be a Lisp. While Elixir definitely has a macro system at the same time it is definitely not homoiconic which is one of the strengths of Lisp. Same with Haskell. It is not more lisp-like than most other languages.

2 Likes

This is an interesting topic, although largely irrelevant for practical purposes ;-). If I read Wikipedia’s definition of homoiconicity I’d be tempted to say that Elixir would meet the definition.

As someone who works with Elixir macro’s and the AST a LOT, it absolutely is not homoiconic.

Elixir’s language is NOT in the form of its syntax tree.
Elixir’s language is NOT reversible from it’s AST (I.E. you can generate valid AST that is entirely unrepresentable in Elixir ‘The Language’ but is still entirely valid and works as AST).

3 Likes

You beat me to it. There is one sentence in the wikipedia page which pretty much rules out Elixir, and most other languages,

If a language is homoiconic, it means that the language text has the same structure as its abstract syntax tree (AST) (i.e. the AST and the syntax are isomorphic).

There aren’t many languages where you literally writing data structures when you code. I have only used 2 groups: lisps and logic languages like prolog.

Of course, how interesting it is whether a language is homoiconic is something you can debate forever, but it does tend to make writing macros easier.

3 Likes