News for hackers. Stuff that matters.
Re:The Development of Erlang (1997) by linkdd on Thursday June 03, 2021 @07:24AM (#27379571)
Erlang's syntax is so simple I've been able to read the source code of RabbitMQ before even knowing the language.

Quickly going through https://learnyousomeerlang.com/ to discover OTP, processes and supervisor and you're ready to code.

After learning Erlang, and writing some basic stuff with it, I discovered Elixir and had nothing to learn except:

  - "defmodule" instead of "package"
  - "@callback" / "@behaviour" instead of "callback" / "behaviour"
  - ":an_atom" instead of "an_atom"
Re:The Development of Erlang (1997) by dqv on Thursday June 03, 2021 @10:03AM (#27381511)
There are a few more concerning proplists/keyword lists: [{:x, "y"}], [x: "y"], ["x": "y"], and x: "y" are the same thing (if in args). Erlang dictates one syntax for this instead ([{x, <<"y">>}]) (ok you COULD say that technically 'x' works too)

The pinning operator x = :x; {^x, y} = {x, "y"}

Exceptions are slightly different.

There are a few others that made me realize "oh shit I need to learn Erlang first."

Re:The Development of Erlang (1997) by linkdd on Thursday June 03, 2021 @10:44AM (#27382146)
My point was that Erlang and Elixir aren't that different. You can totally not use the syntactic sugar for proplists, it will still work the same.

Therefore saying "you need to learn 2 languages" isn't correct. It's like saying Javascript/Typescript are 2 different languages. Well yes, but if you're fluent with Javascript, you'll be able to read typescript, and if you're fluent with Typescript, chances are that you are fluent with Javascript too.

But I agree that one should learn Erlang first, because most of the documentation about Elixir seems to assume that you already know Erlang/OTP.

Re:The Development of Erlang (1997) by dnautics on Thursday June 03, 2021 @10:25AM (#27381827)
there are a handful of things that make elixir way more ergonomic. For example, in a really big codebase if you want to zoom to a function definition you just have to search "def/p function_name". Aliasing is very nice, though confusing if you are coming from a language where module names are first class (and not just atoms) like Julia.
Re:The Development of Erlang (1997) by saba2008 on Thursday June 03, 2021 @10:59AM (#27382352)
In Erlang function definitions are '^function_name' in virtually every case.
Re:The Development of Erlang (1997) by dnautics on Thursday June 03, 2021 @11:24AM (#27382713)
Adds a mental step for those of us who do not default to regex searches (there are sometimes good reasons not to)