Hacker News new | ask | show | jobs
by markholmes 2294 days ago
How? This is just a link to a Facebook job post.

Guess this is a good time to plug Gleam though (along with Dialyzer, which has already been mentioned), a statically typed functional programming language which compiles to Erlang.

https://gleam.run

3 comments

They don't mention how, but this is from the job description:

"Our biggest and the most challenging project is evolving Erlang into a modern statically typed programming language.

Our work is motivated by extremely successful and large-scale application of Erlang at WhatsApp."

It sounds like Elixir ;)
Elixir isn’t any more statically typed than Erlang? More modern in many ways, yes, but something like the goals of Typescript over JS are quite different.
Right, Elixir has hints rather than being truly statically typed.
Elixir's hints are identical to erlang's hints, they are just prettier and easier.

However, if you use structs extensively in elixir, with a good code editor language server, it is basically easy to eliminate most typing errors if you get into the habit of typespeccing everything (not hard with vscode)

From the Gleam FAQ

"How is message passing typed?

Gleam doesn't currently have first class support for the BEAM's concurrency primitives such as receive, send, and spawn. This is because research is still ongoing as to the best way to apply a strong type system to them while still enabling established OTP patterns. For now these primitives should be used via the Erlang FFI, making them dynamically typed.

Many OTP patterns such as gen_server are functional in nature and don't require direct use of these primitives so these behaviours can be implemented in Gleam today."

I suspect the FB language might solve this.

Hi! I'm the author of Gleam. We have type safe actor libraries now :)

I'm interested in what the WhatsApp team come up with here too! I'm not sure it's possible to "solve" this entirely though, message passing in Erlang is extremely dynamic and some of the problems are not possible to solve (i.e. distributed message passing) and will always require some unsafe type casting.

akka typed is now a thing and it works reasonable well. Though, imo, the actor pattern will always be at odds with statically typed functional programming.
Wow, gleam looks incredible. I love the syntax. Thanks so much for sticking to just double quotes!!!