Hacker News new | ask | show | jobs
by PrayagS 1318 days ago
> After programming in elixir/erlang for ~8 years

Are Elixir and Erlang very similar? Do they belong to the same family?

3 comments

Elixir compiles to bytecode for the Erlang VM (BEAM). I would put it in the same relationship category as Clojure and Java or Kotlin and Java. Different language but there's a lot of synergy in the libraries/ecosystem/etc. If something goes wrong in your Elixir application it would be a really good idea to understand Erlang and BEAM.
I can't speak to Kotlin, but Clojure : Java :: Elixir : Erlang doesn't seem like a great analogy. Clojure and Java have very different philosophies, while Elixir has virtually identical semantics to Erlang.
Kotlin : Java :: Elixir :: Erlang

Clojure : Java :: LFE : Erlang

Mayyyybe. LFE is still much closer to Erlang than Clojure is to Java.
Yeah, I learned LFE a few years back after years of (sadly only) hobby Erlang programming. I don't think anything in it surprised me. It felt very much like: What if Erlang's syntax were replaced with sexprs and we used Lisp-y style macros? Clojure's relationship to Java is nowhere near the same.

Knowing Erlang + Scheme and CL, LFE like exactly what I expected, with a strong Erlang vibe. Knowing Java + Scheme and CL, Clojure felt nothing like Java except that it could access Java classes and objects.

Fundamentally the BEAM is very opinionated with a limited range of possible language designs that would work with it. No mutability, e.g.

I love the opinionated, constrained nature of Erlang and the BEAM, vs the kitchen sink approach of Java and the JVM.

Maybe Scala : Java :: Elixir : Erlang
I'm not too sure - scala really has a crazy number of language features, which makes the scope of it way bigger. I'd say kotlin : Java is closer :)
At its core, Elixir is effectively a wrapper of Erlang but with small tweaks/wrappers of the core library, Ruby-ish syntax, piping with `|>`, Mix project management, Hex package management, ExUnit for testing, and several other quality of life improvements. Elixir can easily call Erlang code, which is not easy the other way around. The biggest difference is that Elixir has a vibrant community, big projects like Phoenix, LiveView, and Livebook.
I would even say Elixir IS Erlang, so is LFE.