Live data from Hacker News

Ask HN: Is Erlang an albatross to Elixir adoption?

news.ycombinator.com

31–40 of 109 posts

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#31
The phenomenon you're talking about, imo, doesn't have anything to do with Erlang or Elixir.

All languages have limits to what you can do natively. There will always be some tasks where you will cross a language barrier from "your" language to another. To me, the question is: "Is the area that Elixir covers big enough to recommend?" and I think the answer is yes.

I do not think most programmers need to learn Erlang to use Elixir - but I think programmers will often encounter Erlang and can decide to learn it (or look for a different library that's pure Elixir). I am sure that there are individual programmers who would learn pure Elixir, but get 'scared away' by Erlang...but I doubt they are hurting the language ecosystem in a meaningful way. Focusing on this would both be optimizing something that does not, in general, matter - and would be trying to achieve an impossible goal.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#32
post #13

Yes, it absolutely is. The few times I did work with Elixir I came across a few instances where I had to use libraries that had not been ported over to Elixir yet so I had to deal with Erlang. It wasn't fun. That being said, I think it's only one of the issues affecting Elixir adoption. Elixir, while undoubtedly a great language, is not very easy to use. The docs have a huge focus on the language and its syntax, but…

did you have an aha moment that finally made it all (genservers and entry points) make sense? if so, what was it?

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#33

I think it's important to differentiate between groups, because it is definitely possible (and normal) in some situations not to ever need to understand Erlang or know anything about it. If you are building a Phoenix web app, you can go many years and never run into non-trivial/non-obvious Erlang (excepting perhaps a small thing here or there, although many of those have Elixir wrappers now). I've also heard similar…

> I don't think it's "an albatross" but it's certainly not ideal.

I find the whole framing problematic. To call the foundation that you are building on and that you seek to displace an albatross is missing the option that it could easily be seen as being the other way around.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#34
post #17
post #13

Yes, it absolutely is. The few times I did work with Elixir I came across a few instances where I had to use libraries that had not been ported over to Elixir yet so I had to deal with Erlang. It wasn't fun. That being said, I think it's only one of the issues affecting Elixir adoption. Elixir, while undoubtedly a great language, is not very easy to use. The docs have a huge focus on the language and its syntax, but…

> I had to use libraries that had not been ported over to Elixir yet so I had to deal with Erlang Why do these libraries need to be ported to Elixir at all?

IIRC they don't, but as someone who doesn't know Erlang, the Erlang documentation was really hard to read and the APIs differed from other Elixir libraries.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#35

It's the same way that the Java/JVM prevents Clojure being picked up more. To figure out Clojure's errors you need to be familiar with Java/JVM (most of time). Elm is a great example of a language that doesn't suffer from being written in Haskell, you basically completely unaware of it and not required to dip your toes into Haskell's ecosystem.

In my experience (7+ years of using Clojure) this is caused by the misunderstanding of what Clojure actually is: it's a LISP designed for the JVM, you cannot escape the host and pretend it's not there. In return you get access to one of the biggest software ecosystems and pull any library from Maven Central etc. Coming from Ruby/Go/JS to Clojure was definitely harder than I expected but rather than fighting "this stu…

> It's a LISP designed for the JVM

Honestly, this should be the Clojure tagline. Would solve a lot of the confusion. To be truthful, I never pictured it that way, but to be fair I think Clojure sells itself as more than that.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#36
post #14

Earlier quoted context omitted.

One of those is not like the other. JavaScript and TypeScript are almost interoperable. You don't have to relearn the semantics of the language to use a JavaScript library in TypeScript. It's is an extremely light superset compared to Clojure, Scala, Elixir, Kotlin, etc.

Typescript requires an intermediate step though. We had the Typescript vs JS debate when starting out with pianojacq.com and I was pretty strongly committed to doing it in plain JS and not to have any tooling dependencies or build step. Which I think is the one thing that makes JS at least moderately interesting: that it is a language that in theory does not require any tooling beyond the browser. Of course, the day…

I agree that just JavaScript is okay for simple applications. In fact I didn't use TypeScript for a really long time because getting the tooling going can be cumbersome at first.

TypeScript shines with complex webapps. Having the typing prevents a whole class of issues and helps with refactoring quite a bit.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#37
post #22

Raw performance is the actual albatross. IMHO, the low raw performance of Erlang is what's holding it back from mass adoption. (Even marquee Erlang/Elixir users like Discord, still have to use Rust NIFs to overcome the slow Erlang runtime) People have a hard time understanding how Erlang can have such: high concurrency, low latency & tight standard deviations ... when people are just accustom to looking at raw perfor…

> While BeamASM (JIT) is very exciting, the reality is that the Erlang runtime has only speed up by ~25% over the last decade

Yes... because perf hasn't really been a focus for Erlang until about 1.5 years ago. Various (usually academic) third parties have contributed big performance-enhancing patchsets (the earlier JIT; Dialyzer and then HiPE based on Dialyzer analysis; etc.) but these have then languished, with attempts to further development on them slowing to a crawl over time. The patchsets were just "too big to be digested properly"† by a team of core maintainers who 1. didn't write the code, and don't fully understand it, and 2. who aren't CS academics themselves.

Each of these indigestible patchsets was eventually dropped, throwing away any follow-on in-tree work done to it, and dropping perf back to where it was before said patchset was introduced.

The new work is in-tree, done ground-up by the core maintainers themselves, and so is actually showing linear improvements in speed. This not only includes runtime speed, but also the batteries-included addition of long-ignored performance-oriented features, like atomic counters and fast global readonly modules (and the runtime itself being gradually rewritten in terms of these!)

† This is exactly why, in the Linux kernel, big patchsets aren't accepted as-is, but rather are required to be broken down into small changes that 1. can add value on their own, and 2. can be molded to fit the design philosophy of the kernel on their own. This is why e.g. the "containers" patch from OpenVZ was never pulled in; but instead, each bit of it was gradually reworked into the cgroups + namespaces code that powers Linux containers today.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#38

Earlier quoted context omitted.

In my experience (7+ years of using Clojure) this is caused by the misunderstanding of what Clojure actually is: it's a LISP designed for the JVM, you cannot escape the host and pretend it's not there. In return you get access to one of the biggest software ecosystems and pull any library from Maven Central etc. Coming from Ruby/Go/JS to Clojure was definitely harder than I expected but rather than fighting "this stu…

> It's a LISP designed for the JVM Honestly, this should be the Clojure tagline. Would solve a lot of the confusion. To be truthful, I never pictured it that way, but to be fair I think Clojure sells itself as more than that.

But it's more than that. It has different data structures, operators and semantics from Lisp - stuff which goes beyond just a simple retargeting to the JVM. It also provides an integration into/on top of the JVM, but also stuff like persistent functional data structures, avoids OOP, ... It's opinionated.

Lisp and Scheme on the JVM exist, too.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#39

As the creator of Phoenix, I've never written an Erlang program fwiw. That said, I frequent the Erlang docs and most seasoned Elixir developers will do the same because the standard library is a wealth of features, and the documentation while not 2022 polished, remains a remarkable resource. > I don't know what a solution is, but perhaps a concerted effort to create a documentation and library ecosystem that never li…

Highlighting an important distinction Chris makes: there's a huge difference between needing to learn to read/understand the basic syntax of a language and needing to learn to write it.

When writing Elixir, yes, you'll be exposed to Erlang syntax/docs sooner or later. But you're not writing Erlang, so you never need to learn how to:

  - Compile more than a couple lines of Erlang into a function
  - Create an Erlang module/file
  - Learn Erlang's build tooling
  - Cold recall its syntax
Creating something functional from scratch in a language is 100x (1000x?) more challenging than learning how to roughly read it.

I've been programming full-time in Elixir for a couple years. All told, I think I spent 3-5 hours one afternoon learning the basics of Erlang's syntax so I could better read the docs. Haven't had to think about it consciously since.

Re: Ask HN: Is Erlang an albatross to Elixir adoption?

#40
post #14

This is why I've always just settled for the 'root' language and try to stay away from derivatives even if those offer a lot of goodies the 'root' does not offer. So no Typescript, Clojure or Elixir for me. I also think that the main attraction of an eco system is how long term stable it is and usually the second layer is less long term stable than the foundation. And usually such a 'derivative' language only serves…

One of those is not like the other. JavaScript and TypeScript are almost interoperable. You don't have to relearn the semantics of the language to use a JavaScript library in TypeScript. It's is an extremely light superset compared to Clojure, Scala, Elixir, Kotlin, etc.

True, though I think part of this is also recognizing that the more the semantics diverge, the more potential upside there is.

Not that JavaScript-with-types isn't a compelling pitch for TypeScript— it totally is. But that's a benefit that is primarily geared toward scale and safety, whereas Clojure is a completely different kind of language from Java. Maybe I'm just arguing essentially the same point here, that Clojure is always going to be a niche, but the core of it is that if your problem domain demands using a Lisp, and you have other reasons to want to be on the JVM, then it's likely that the cost of having to pick up some Java is going to be well worth it.

Post reply on HN