> 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.
This should be a lesson learned by all that boost about Scala, Kotlin, Clojure, F#, C and C++ replacements, JavaScript replacement, without bothering to learn the underlying infrastructure they are build upon.
Many times the X is going to replace Y advocacy, is a bit hard to achieve when the platform was designed for Y and will never go away from Y, for its whole lifetime.
Re:Elixir Gotchas
by miloandmilk on Wednesday June 26, 2024 @08:24AM
(#40799163)
Agreed, even with f# a first class citizen in the .net world, written, maintained and distributed by Microsoft, I still have needed to gain a working knowledge of c# to properly interact with the .net libs and third party libs (which I absolutely need to do as the f# ecosystem is tiny compared to c#). So at the end of the day I needed to learn two languages to atain my goal of learning one enough to be useful.
Disclaimer - I am still learning both - I am no expert on either - and I am still strugling!
(Calling erlang from elixir much eaiser!)
Re:Elixir Gotchas
by travisgriggs on Wednesday June 26, 2024 @09:20AM
(#40799726)
Elixir is peculiar in this regard because Elixir adherents outweigh erlang adherents maybe 10:1.
I really wish that someone would magically transpile all of ERTS so the documentation syntax was uniform.
Elixir is almost more of a guest syntax than it is a diff language.
Re:Elixir Gotchas
by out_of_protocol on Wednesday June 26, 2024 @07:18AM
(#40798689)
Also, elixir team decided to deprecate single-quotes for charlists. No more single quotes (charlist, only for erlang interop) vs double quotes (binary string, used everywhere in elixir) surprises
Re:Elixir Gotchas
by josefrichter on Wednesday June 26, 2024 @07:12AM
(#40798649)
Everyone should read https://learnyousomeerlang.com
Re:Elixir Gotchas
by facundo_olano on Wednesday June 26, 2024 @10:03AM
(#40800196)
+1 I'd say it's a great read even if you don't plan to do much Erlang or Elixir programming.
Re:Elixir Gotchas
by josefrichter on Wednesday June 26, 2024 @02:27PM
(#40802933)
exactly
Then, when you have code in production, https://www.erlang-in-anger.com/ (from the same author)
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.