Live data from Hacker News

Learn You Some Erlang for Great Good (2013)

learnyousomeerlang.com

11–20 of 28 posts

Re: Learn You Some Erlang for Great Good (2013)

#11
post #9
post #5

For those familiar with BEAM-based languages, are there any advantages to choosing Erlang over Elixir when starting a new project?

I've used both heavily and I'd have to say no. You are in general better off with Elixir, with easy access to all Erlang and Elixir libraries, all BEAM functionality, a better package manager and build tool, and a more modern feeling / easier to learn programming language. Also starting to see a progressive type system and just a much faster developing ecosystem in general. I think by now there's also more open sourc…

Oh boy. One of the things I have been doing to test if an LLM is 'there yet' by my standards is if it can spit out solutions in elixir without hallucinating packages that don't exist to get the job done. Since I haven't tested since chatgpt 4 came out I dunno where it's at for that but always felt like a decent litmus test.

Re: Learn You Some Erlang for Great Good (2013)

#12
This book is very clearly a labor of love. He put so much work into it, much more than would have been necessary to just create a simple book about Erlang.

It's very well done and if you're at all interested in Erlang, is worth purchasing.

Re: Learn You Some Erlang for Great Good (2013)

#14
post #4

This book is nothing like the famous Haskell book of similar title. It's really hard to read, with walls of text displayed in a very small font and very little contrast. And already in the first pages it fails to explain the basic question for the newcomer: Why do I need Erlang? What can it do that other languages can't?

I haven't read the Haskell version (or at least, not more than a small portion and in a long time), so I can't comment on the comparison, but what did you find insufficient about the "So what's Erlang?" section? I think it explains the benefits quite well, though I am someone who writes BEAM code for a living :)

Re: Learn You Some Erlang for Great Good (2013)

#16
post #5

For those familiar with BEAM-based languages, are there any advantages to choosing Erlang over Elixir when starting a new project?

I’m not sure there is a huge advantage at the beginning, perhaps even a disadvantage because of the ease of use of Elixir. As you get more advanced you start using Erlang here and there to access things not in Elixir. For example, Elixir only has lists not arrays, so if you need a good indexed data structure you end up using some Erlang. Also once you start getting into Mnesia etc, Erlang is the way. All this said, s…

I guess this depends on what you mean by "end up using some Erlang".

If you mean that you end up calling certain library functions and such which are written in Erlang from Elixir.... well, yes, and you need to by design.

But I'd argue calling a function written in Erlang or from Erlang's standard libraries isn't the same as having to write Erlang code. I use Erlang's ETS, its in-memory key-value store, quite a lot from Elixir. I'm calling the Erlang ETS functions, but I'm not writing Erlang code I'm writing Elixir code which simply calls the Erlang functions. To me that isn't the same.... which for me is probably good: I know enough about Erlang to read the docs and to read Erlang code well enough by now... but not to write it; I've been writing Elixir code for years now and never had to write actual Erlang to accomplish anything. The closest would be a matchspec (kind of a matching DSL used by certain built-in Erlang databases), but I don't consider that writing Erlang, but more DSL like. I've also used Mnesia from Elixir in the same fashion: I call the Erlang libraries which are Mnesia, but I'm not writing Erlang code to do it: I'm writing Elixir code which calls Erlang libraries.

I'd disagree with the larger statement where you say, "Elixir only has lists not arrays, so if you need a good indexed data structure you end up using some Erlang." You are correct that Elixir doesn't have arrays and only lists... but that's also true of Erlang. Elixir and Erlang basically share the same primitive data types. I have to assume by "a good indexed data structure" you are referring to the previously discussed ETS which is more a K/V store than something like a data or data structure. Otherwise, you'd have to be more specific to what you are referring.

I think it's true that if you are going to write any serious amount of Elixir, you will benefit greatly from having some familiarity of Erlang. Not because you're necessarily going to write Erlang, but because Elixir was designed to be very compatible with Erlang's approaches, philosophies, and, most importantly, Erlang's runtime the BEAM. Because we do use Erlang library calls we will read Erlang documentation, frequently. We will see examples of those libraries written in Erlang, errors coming from the Erlang side, etc. None of this is to say I have to "write Erlang" to do any of this, but familiarity with Erlang doesn't hurt at all.

In the end, Elixir is simply a more expressive way to address certain kinds of problems while still reaping the benefits of Erlang and its VM, the BEAM. If you don't leave the kinds of problems to which Elixir is well suited, you will certainly encounter Erlang's standard libraries and benefit from being able to read Erlang and its documentation... but you won't really have to write it, just call its libraries.

Re: Learn You Some Erlang for Great Good (2013)

#18
post #9

Earlier quoted context omitted.

I've used both heavily and I'd have to say no. You are in general better off with Elixir, with easy access to all Erlang and Elixir libraries, all BEAM functionality, a better package manager and build tool, and a more modern feeling / easier to learn programming language. Also starting to see a progressive type system and just a much faster developing ecosystem in general. I think by now there's also more open sourc…

Oh boy. One of the things I have been doing to test if an LLM is 'there yet' by my standards is if it can spit out solutions in elixir without hallucinating packages that don't exist to get the job done. Since I haven't tested since chatgpt 4 came out I dunno where it's at for that but always felt like a decent litmus test.

I find that Claude 3.5 does a very admirable job. I only rarely see incorrect code and more frequently see recommendations for older libraries or obsolete versions of real libraries as compared to hallucinated libraries.

I've been playing with Claude 3.7 thinking and, perhaps unsurprisingly, I find it overthinks the problem or tries to do far more than I really want it to for any prompt. I expect that I'm just using the wrong tool, and probably should just use Claude 3.7.

Of course in all of this, I'm using the LLM in a "junior" capacity and I'm not giving it giant multi-faceted problems to solve: I'm giving it relatively narrow problems to solve at any one time and am guiding it through that process.

Re: Learn You Some Erlang for Great Good (2013)

#19

What are the modern hosting platforms for distributed BEAM apps? The language model seems perfect for some kind of global distributed app, but can you leverage a network already built sort of like how Cloudflare workers or Vercel edge functions work?

Fly.io for Elixir is very popular
Post reply on HN