Earlier quoted context omitted.
The new `maybe ... end` looks nice.
At first sight it looks like Elixir's `with` expression.
Erlang/OTP 25.0 Release
11–20 of 125 posts
Re: Erlang/OTP 25.0 Release
#12Re: Erlang/OTP 25.0 Release
#13Have there been benchmarks of the JIT vs say JS or the JVM?
Re: Erlang/OTP 25.0 Release
#14Have there been benchmarks of the JIT vs say JS or the JVM?
Re: Erlang/OTP 25.0 Release
#15Have there been benchmarks of the JIT vs say JS or the JVM?
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
#16Earlier 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.
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
#17Earlier 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.
Re: Erlang/OTP 25.0 Release
#18Earlier 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.
Re: Erlang/OTP 25.0 Release
#19Earlier 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.