Live data from Hacker News

Erlang/OTP 25.0 Release

erlang.org

11–20 of 125 posts

Re: Erlang/OTP 25.0 Release

#11
post #6
post #3

Earlier quoted context omitted.

The new `maybe ... end` looks nice.

At first sight it looks like Elixir's `with` expression.

It is very much that. The Erlang team have not been too proud to steal good ideas from Elixir. Elixir has been a good source of fresh thinking for the BEAM ecosystem which has helped both the Erlang and Elixir side.

Re: Erlang/OTP 25.0 Release

#13
post #7

Have there been benchmarks of the JIT vs say JS or the JVM?

Erlang JIT is still very simple, unlike highly optimized super complex V8 jit. It's faster than non-jit erlang, sometimes twice as fast, but nowhere near nodejs-fast. Erlang team don't have resources to make and maintain such complex beast. (everything said here is about raw performance)

Re: Erlang/OTP 25.0 Release

#14
post #7

Have there been benchmarks of the JIT vs say JS or the JVM?

The JVM is nearly as fast as hand optimised C, this is not intended to be that fast, rather a simple bedrock to build further optimisations into. Immutable everything also will limit performance as will the focus on latency at the cost of everything else. Not sure of actual performance compared to JVM though, I wonder if it’s as far away as I expect…

Re: Erlang/OTP 25.0 Release

#15
post #7

Have there been benchmarks of the JIT vs say JS or the JVM?

If you are allowed to write e.g., a Java program and run it on the JVM, the speedup will typically be on the orders of magnitude in favor of the JVM. Static type systems and extensive optimization matter.

However, chances are you have an Erlang program, and it's quite large. In this case, the speedup compared to the older bytecode interpreter is good for many programs. It is performance you get "for free" by upgrading.

The underlying reason for picking something like Erlang is robustness. Java isn't really built for this kind of programming, and the JVM doesn't directly facilitate it either.

Re: Erlang/OTP 25.0 Release

#16
post #11
post #6

Earlier quoted context omitted.

At first sight it looks like Elixir's `with` expression.

It is very much that. The Erlang team have not been too proud to steal good ideas from Elixir. Elixir has been a good source of fresh thinking for the BEAM ecosystem which has helped both the Erlang and Elixir side.

The Erlang 'maybe' expression expands on what 'with' allows in Elixir, mostly because the 'with' construct allows a list of conditional patterns and then a general 'do' block, whereas the Erlang 'maybe' allows mixed types of expressions that can either be conditional patterns or any normal expression weaved in together at the top level.

It is therefore a bit more general than Elixir's 'with', and it would be interesting to see if the improvement could feed back into Elixir as well!

The initial inspiration for the 'maybe' expression was the monadic approach (Ok(T) | Error(T)) return types seen in Haskell and Rust, and the first EEP was closer to these by trying to mandate the usage of 'ok | {ok, T}' matches with implicit unwrapping.

For pragmatic reasons, we then changed the design to be closer to a general pattern matching, which forced the usage of 'else' clauses for safety reasons (which the EEP describes), and led us closer to Elixir's design, which I felt was inherently more risky in the first drafts (and therefore I now feel the Erlang design is riskier as well, albeit while being more idiomatic).

So while I did get inspiration from Elixir, and particularly its usage of the 'else' clause for safety reasons, it would possibly be reductionist to say that "the good ideas were stolen from Elixir." The good ideas were stolen from Elixir, but also from Rust, Haskell, OCaml, and various custom libraries, which have done a lot of interesting work in value-based error handling that shouldn't be papered over.

I still think these type-based approaches represent a significantly positive inspiration that we could ideally move closer to, if it were possible to magically transform existing code to match the stricter, cleaner, more composable patterns that they offer.

In the end I'm hoping the 'maybe' expression still provides significantly nicer experiences in setting up business logic conditions in everyday code for Erlang user, and it is of course impossible to deny that I got some of the form and design caveats from the work done in the Elixir language already :)

Also as a last caveat: I am not a member of the Erlang/OTP team. The design however was completed and refined with their participation (and they drove the final implementation whereas I did the proof of concept with Peer Stritzinger and wrote the initial EEP), but the stance expressed in my post here is mine and not the one of folks at Ericsson.

Re: Erlang/OTP 25.0 Release

#17
post #11
post #6

Earlier quoted context omitted.

At first sight it looks like Elixir's `with` expression.

It is very much that. The Erlang team have not been too proud to steal good ideas from Elixir. Elixir has been a good source of fresh thinking for the BEAM ecosystem which has helped both the Erlang and Elixir side.

That's good. I didn't come to the BEAM ecosystem from Ruby, so I prefer Erlang's syntax to Elixir's.

Re: Erlang/OTP 25.0 Release

#18
post #11

Earlier quoted context omitted.

It is very much that. The Erlang team have not been too proud to steal good ideas from Elixir. Elixir has been a good source of fresh thinking for the BEAM ecosystem which has helped both the Erlang and Elixir side.

That's good. I didn't come to the BEAM ecosystem from Ruby, so I prefer Erlang's syntax to Elixir's.

I was the same initially, but now having onboarded multiple people on to Elixir projects, the more familiar type of syntax does ease the first week or so of getting your head round things.

Re: Erlang/OTP 25.0 Release

#19
post #11

Earlier quoted context omitted.

It is very much that. The Erlang team have not been too proud to steal good ideas from Elixir. Elixir has been a good source of fresh thinking for the BEAM ecosystem which has helped both the Erlang and Elixir side.

That's good. I didn't come to the BEAM ecosystem from Ruby, so I prefer Erlang's syntax to Elixir's.

You’re not alone. I value the conciseness of Erlang.

Re: Erlang/OTP 25.0 Release

#20
I taught myself Erlang last year and loved it until I tried to write an application. The OTP documentation, while voluminous, was confusing and seemed to have important omissions, and I found little if any community.
Post reply on HN