News for hackers. Stuff that matters.
Re:Beam/Erlang/Elixir Concept Explanations by ralmidani on Sunday September 12, 2021 @01:46PM (#28503187)
I honestly don’t see why a beginner couldn’t learn Elixir. You can start with if/else, and later learn how to do things more elegantly with pattern matching. You don’t have to use processes and GenServers right away (and even afterwards, you can use a library/framework which provides an abstraction). The ecosystem has many advanced features and use cases, but simple programs are not much harder to write than they are in Python or Ruby.

In some ways, getting programmers to start out thinking about “everything as an expression” and immutability-by-default might help them write elegant and robust code earlier in their journeys.

Re:Beam/Erlang/Elixir Concept Explanations by joelbluminator on Sunday September 12, 2021 @03:04PM (#28503855)
> but simple programs are not much harder to write than they are in Python or Ruby.

Even if they are just a bit harder it makes it a questionable choice for a beginner. And let's not forget the huge amount of Stackoverflow answers a stack like Python/Ruby have.

> immutability by default

I don't know that beginners should think about that stuff.

Re:Beam/Erlang/Elixir Concept Explanations by dnautics on Sunday September 12, 2021 @03:57PM (#28504345)
There was a class aimed at middle school? Iirc Students where they were taught erlang and by the end of two classes they had built a crude networked chat system, which, believe it or not, gets their attention. You can't really do that so easily in any other language system.

> I don't know that beginners should think about [immutable by default].

Yeah. Beginners should not have to think about mutability. So, immutability by default is the right choice. Details like "why don't integers mutate when passed to a function versus a dict" should not ever have to be answered to a beginner.

Re:Beam/Erlang/Elixir Concept Explanations by joelbluminator on Monday September 13, 2021 @12:15AM (#28507799)
Right, no one has ever built a chat system with Node or PHP or Python...just super hard. Like importing a library and 10 lines of code hard.
Re:Beam/Erlang/Elixir Concept Explanations by scns on Monday September 13, 2021 @03:46AM (#28508845)
That is taking an off the shelf solution and adding some glue. I bet it's much easier to build such a system from scratch, using Erlang/BEAM, since communication is in its' "DNA".
Re:Beam/Erlang/Elixir Concept Explanations by joelbluminator on Monday September 13, 2021 @04:21AM (#28509026)
Erlang/BEAM is also off the shelf solution, whose to say what's the "right amount" of abstraction a beginner should use? If you really wanna teach a student what's happening in the computer have them use assembly or maybe C, that's pretty much the only way.
Re:Beam/Erlang/Elixir Concept Explanations by dnautics on Monday September 13, 2021 @10:21AM (#28511849)
yeah try doing that with a room of 12-year olds. They will immediately tune out when you don't bother to explain what "import" is, or when you have to explain how APIs work, what options are, why you need option X, why 3rd party API of your choice requires this function signature?. Dead in the fucking water.