by lobo_tuerto on 6/23/24, 5:10 PM with 35 comments
by sph on 6/26/24, 9:54 AM
Keyword lists, charlists vs strings (actually called binaries) [1], empty map matching all maps are obvious if you look at how they work in Erlang.
I haven't written a single line of Erlang though I can grok it pretty well by now. Knowing the entire platform is how you become a productive Elixir programmer, though it seems some devs refuse to look behind the curtains to understand the Erlang side of it, thus never truly understand the power of the BEAM platform.
---
1: I admit I still unsure about the separation of charlists and binaries. As far as I understand it, binaries are stored in their own heap to avoid copying when sending across processes, so are ideal for sharing large payloads, and charlists are not great for UTF-8 content, as they simply are a naive list of integers (hence one of the gotchas). Erlang uses charlists a lot for "string" content.
Elixir made the right choice to use binaries for strings, as they can ensure they are correctly encoded, provide high-level API to deal with the intricacies of Unicode, and still retain compatibility with Erlang by providing charlists and raw binaries for non-UTF-8 data.
by arrowsmith on 6/23/24, 7:51 PM
> The other mystery here are the 2 different syntaxes in use for charlists – single quotes ('charlist') vs. the ~c"charlist" sigil. That’s a rather recent development, it was changed in Elixir 1.15, after some discussion … > > So, it’s now less confusing but still confusing – which is why it made this list.
Charlists with single quotes are deprecated since Elixir 1.17 - the ~c[…] sigil should always be preferred.
So hopefully that will reduce the confusion!
by fredwu on 6/26/24, 9:56 AM
by robxorb on 6/26/24, 11:05 AM
https://elixir-lang.org/install.html
That is the biggest gotcha for me. There doesn't seem to be a simple installer or binary you just get up and running unlike other major languages. Is it a distribution issue with erlang or something? I'd have thought it'd be easy to package it up.
by cutler on 6/26/24, 10:42 AM