Comment by lpil
1 day ago
This is the same as Elixir, you need to specify what Erlang function to use in that language if you want to use Erlang code. The only difference is that Gleam has a more verbose syntax for it.
1 day ago
This is the same as Elixir, you need to specify what Erlang function to use in that language if you want to use Erlang code. The only difference is that Gleam has a more verbose syntax for it.
In Elixir you just call the Erlang function directly. It's basically the same as calling an Elixir function, just with a different naming convention.
In Gleam, you first have to declare the function type and THEN you can call the function directly.
This is probably the lightest way you can bridge between statically and dynamically typed languages, but it's not the same as Elixir.
Sorry, I've been unclear.
The runtime behaviour and cost of calling an Erlang function is the same in Elixir and Gleam, however the syntax is more verbose in Gleam as it asks for type information, while in Elixir this is optional.