Live data from Hacker News

Erlang/OTP 27 Highlights

erlang.org

21–30 of 53 posts

Re: Erlang/OTP 27 Highlights

#21

I think I’m going to just break down and learn erlang. I’ve been interested in it for awhile but mostly work in f#. I recently started looking at gleam but I don’t think learning it with no knowledge of OTP is a good idea.

I think you can use it without OTP with very little issues,

I did write this, which is a port of the erlang design principals for gleam:

https://github.com/wmealing/gleam-otp-design-principals/blob...

Re: Erlang/OTP 27 Highlights

#22

Really like the new Erlang 27 docs https://www.erlang.org/doc/readme.html

Woah! They copied the excellent hexdocs format, this is great. https://hexdocs.pm/nanoid/readme.html

Better still—they didn’t copy ExDoc, they are using it exactly as it is! It’s really refreshing to see the sharing between Erlang and Elixir.

Having been stuck in the js world my whole career, it’s really cool to watch a community that’s rooted in collaboration instead of competition.

Re: Erlang/OTP 27 Highlights

#23

Reading about Erlang always feels like getting messages from an alternate dimension where we as an industry made much better choices in the 90s about how we write distributed software.

this. Erlang's concurrency support is one of those things you can't unsee. Going back to sequential-by-design languages (which is pretty much every other industrial quality language bar go[1]) just feels cumbersome: C/C++/C#/Python/...: "You want concurrency? Sure. We have OS processes, and threads, and this cool new async doohickey. Pick whatever you fancy! Oh, but by the way: you can't use very many processes cos t…

C++: zero-cost leaky abstraction with unlimited cognitive and development cost

Functional programming languages: Unlimited good abstractions of unknown cost

I don't feel like there's a great third option. Go is pretty good.

Re: Erlang/OTP 27 Highlights

#24

Earlier quoted context omitted.

this. Erlang's concurrency support is one of those things you can't unsee. Going back to sequential-by-design languages (which is pretty much every other industrial quality language bar go[1]) just feels cumbersome: C/C++/C#/Python/...: "You want concurrency? Sure. We have OS processes, and threads, and this cool new async doohickey. Pick whatever you fancy! Oh, but by the way: you can't use very many processes cos t…

C# tasks are lightweight, and I'd expect for per-task overhead to be significantly lower than that of Erlang's. e.g.: var delay = Task.Delay(3_000); var tasks = Enumerable .Repeat(async () => await delay, 1_000_000) .Select(f => f()); Console.WriteLine("Waiting for 1M tasks..."); await Task.WhenAll(tasks); Console.WriteLine("Finished!"); edit: consider suggesting a comparable example in Erlang before downvoting :)

Do they have isolated heaps and can they be preempted, even if they spin in an infinite loop doing some CPU intensive things?

Re: Erlang/OTP 27 Highlights

#25
post #24

Earlier quoted context omitted.

C# tasks are lightweight, and I'd expect for per-task overhead to be significantly lower than that of Erlang's. e.g.: var delay = Task.Delay(3_000); var tasks = Enumerable .Repeat(async () => await delay, 1_000_000) .Select(f => f()); Console.WriteLine("Waiting for 1M tasks..."); await Task.WhenAll(tasks); Console.WriteLine("Finished!"); edit: consider suggesting a comparable example in Erlang before downvoting :)

Do they have isolated heaps and can they be preempted, even if they spin in an infinite loop doing some CPU intensive things?

Tasks are not processes, and that would be a wrong thing to do, and so would be "isolated heaps" given performance requirements faced by .NET - you do want to share memory through concurrent data structures (which e.g. channels are despite what go apologists say), and easily await them when you want to.

CSP, while is nice on paper, has the same issues as e.g. partitioning in Kafka, just at a much lower level where it becomes critical bottleneck - you can't trivially "fork" and "join" the flows of execution, which well-implemented async model enables.

It's not "what about x" but rather how you end up applying the concurrent model in practice, and C# tasks allow you to idiomatically mix in concurrency and/or parallelism in otherwise regular code (as you can see in the example).

I'm just clarifying on the parent comment that concurrency in .NET is not like in Java/C++/Python (even if the latter does share similarities, there are constraints of Python itself).

Re: Erlang/OTP 27 Highlights

#27
The `maybe_expr' meta pattern matching fallback mechanic is nice, and can surely help avoid a lot of boilerplate code while simultaneously encapsulating the logic in a structure which is easy to read and reason about. It's also not a thing in any other programming language I've learned- C, Java/Scala/C#/C++, Go, Javascript, Tcl, Bash(lol), PHP, Forth, ML, and so on.

I had to look up it's usage though, because I'm new to both Erlang/BEAM and Elixir.

https://chiroptical.dev/posts/2024-03-04-erlang-maybe_expr.h...

Re: Erlang/OTP 27 Highlights

#29
post #2

I love the new documentation site: https://www.erlang.org/doc/apps/stdlib/lists#duplicate/2 Looks a lot like Elixir's. The previous one was functional, but a little barebones. A little colour, hyperlinking and syntax highlighting goes a long way. Also, navigation seems to be improved. I always lost my way navigating across Erlang modules to find a specific function. The entire Erlang/OTP ecosystem got a boost of mind…

It doesn’t just look like Elixir’s docs, Erlang has adopted ExDoc, Elixir’s documentation system.

Re: Erlang/OTP 27 Highlights

#30
post #24

Earlier quoted context omitted.

Do they have isolated heaps and can they be preempted, even if they spin in an infinite loop doing some CPU intensive things?

Tasks are not processes, and that would be a wrong thing to do, and so would be "isolated heaps" given performance requirements faced by .NET - you do want to share memory through concurrent data structures (which e.g. channels are despite what go apologists say), and easily await them when you want to. CSP, while is nice on paper, has the same issues as e.g. partitioning in Kafka, just at a much lower level where it…

> and that would be a wrong thing to do, and so would be "isolated heaps" - you do want to share memory through concurrent data structures (which e.g. channels are despite what go apologists say), and easily await them when you want to.

It depends on the context. In some contexts absolutely not. If we share memory, and these tasks start modifying global data or taking locks and then crash, can those tasks be safely restarted, can we reason about the state of the whole node any longer?

> CSP, while is nice on paper

Not sure if Erlang's module is CSP or Actor's (it started as neither actually) but it's not just nice on paper. We have nodes with millions of concurrent processes running comfortably, I know they can crash or I can restart various subsets of them safely. That's no small thing and it's not just paper-theoretical.

Post reply on HN