Live data from Hacker News

Ask HN: Is Erlang an albatross to Elixir adoption?

news.ycombinator.com

41–50 of 109 posts

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

#41

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…

Devil's advocate:

What would it take to programmatically port/transpile the core of Erlang's ecosystem to Elixir?

Pick the killer app to serve as the root node (Phoenix?) and walk back to the leaves (OTP, popular libraries, etc). Do a 1-time cutover of literally everything. Fork/port ERTS (incl BEAM) to make Elixir-native and rebrand it. Etc.

While I generally agree that "rewriting as bad" there is something to be said about the importance of _ease_ when bootstrapping and scaling an ecosystem. You're either stealing mindshare from an established ecosystem, or you're capturing new minds as they come in.

IMO Elixir/OTP is too radically different from other very-large ecosystems to benefit from transfer learning for junior/mid-level people (great similarity w/other smaller fringe ones, like Ruby, Clojure, etc, but that won't get us there), and the most senior people fall into the "it's all the same at the end of the day" trap and don't put in the energy absent some strong business driver. So you really need to reduce even the shallowest cognitive bumps to get escape velocity.

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

#42
post #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 att…

> perf hasn't really been a focus for Erlang until about 1.5 years ago.

The core maintainers have been working on JIT/perf for 10-years.

You can see Lukas own described 10-year journey documented below.

https://drive.google.com/file/d/1hHCs90kDX_wJ9AbLzGNu5bZKdIV...

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

#43

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.

> 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.

well of course, if you're coming from an Erlang perspective, Elixir is a language that solved/solves a problem that doesn't exist. This is a valid view, but OP's thread is specifically asking as an Elixir dev with the perspective that Elixir solves a problem, rather than introduces one.

Recognizing that different perspectives exist isn't bad (and in many cases is very good), but it doesn't feel super constructive in a thread that precludes those perspectives. It seems a little like forum questions saying something like, "how do I do X on Windows?" and somebody replies, "Install OS X."

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

#44
post #25
post #3

I feel like this is an issue with all superset languages or however you want to call them and should be taken into account by anyone learning one of these. You can't really learn Elixir without also learning _some_ Erlang, you can't really learn TypeScript without learning some Javascript, you can't really learn Clojure without picking up some Java. The platform/base language is abstracted away to some extent but not…

> You can't really learn Elixir without also learning _some_ Erlang I'd argue that you end up learning a good bit about OTP, Erlang's standard library, and some stuff about the VM but very little Erlang in practice. Although if you know about BEAM, and some of the standard library there isn't much "Erlang" to learn after that. It doesn't seem to leak into Elixir the way Java does in Clojure, and the surface area of E…

Yeah Erlang idioms are what make Elixir so powerful, but you basically don't have to touch actual Erlang. I've messed around, just because I felt like I should have some appreciation for the work Erlang developers put in, but the Elixir wrappers are good enough it's almost never necessary. Even if you need an Erlang library, you're just calling the functions and the docs are usually pretty good.

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

#45

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…

Is it a bit of extra complexity? Yes.

Does it cause friction for new devs? No - I can't think of any mainstream Elixir use cases that require Erlang libraries, with the exception of math operators like `:math.sqrt/1`. Chris' comment here is the golden example of this.

And anyway, what does the user get in exchange for that extra layer of complexity? A unique high-concurrency VM with easy-to-use primitives that would require huge gobs of code and lots of added dependencies in other languages.

It's a small tradeoff. My own experience is that the benefits far outweigh the complexity cost.

It sounds like OP mostly objects to the oldschool textfile documentation aesthetic of a lot of Erlang core and libraries, which is fine, but the overwhelming majority of new Elixir devs doing web applications and data processing will never encounter this.

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

#46
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…

Erlang excels at the 'hard' parts of the problem space having to do with complex distributed ultra reliable systems, the 'number crunching' bits are offloaded to specialist languages because the underlying language model that Erlang uses does not lend itself for the kind of optimization that JS, Go, PHP etc have available to them simply because their runtime model is so completely different. The biggest issue from wh…

> One of the more elegant ways to do such interop is to isolate your number crunching code to a separate process group

Or, if you want to maximize perf inside some hot section of code (say, a game-engine renderer) while also retaining Erlang semantics for how it interacts with the rest of the system, you can write your code as a "threaded NIF" — a native thread (in C or Rust or whatever) that sends messages back over to the arbitrary Erlang processes in its address-space (not just its owner process!) as it works.

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

#47
post #34
post #17

Earlier quoted context omitted.

> 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.

+100 — the heart of the problem

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

#49

Earlier quoted context omitted.

Although I also have issue w/the Elixir docs, they tend to have more explanations in them than the Erlang ones. Marginally :) I am one who came not from Ruby, btw. My roots come from a variety of things including Smalltalk, C, C++, Perl (dare I admit), Java, Javascript and Python, among those most influential on my life (and in that order). I'm really happy w/Elixir, finally getting back to a better true object orien…

Reminds me of this blog post: "The Most Object-Oriented Language" => https://blog.noredink.com/post/142689001488/the-most-object-...

Yep :) Anybody familiar with the roots of OO will understand how wildly Java/C++ and their ilk went off the rails. It wasn't intended as a code organizational system. It's about encapsulation of needs, actors, and sending messages back and forth.

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

#50
post #46

Earlier quoted context omitted.

Erlang excels at the 'hard' parts of the problem space having to do with complex distributed ultra reliable systems, the 'number crunching' bits are offloaded to specialist languages because the underlying language model that Erlang uses does not lend itself for the kind of optimization that JS, Go, PHP etc have available to them simply because their runtime model is so completely different. The biggest issue from wh…

> One of the more elegant ways to do such interop is to isolate your number crunching code to a separate process group Or, if you want to maximize perf inside some hot section of code (say, a game-engine renderer) while also retaining Erlang semantics for how it interacts with the rest of the system, you can write your code as a "threaded NIF" — a native thread (in C or Rust or whatever) that sends messages back over…

What concerns me is I see people talk about using NIFs like no big deal.

BUT, they come at the cost of potentially bringing down the entire Erlang runtime. People use Erlang, more times than not, because they want a fail-safe runtime ... so recommending NIFs shouldn't be taken lightly.

Just my 2 cents.

Post reply on HN