3 ms·
Gleam isn't different from Erlang or Elixir in this case, all three languages implement OTP in "user land" rather than being part of the language. The only diff
by lpil 2y ago
Gleam isn't different from Erlang or Elixir in this case, all three languages implement OTP in "user land" rather than being part of the language. The only difference is how this OTP code gets distributed from the core team to you. In Gleam the BEAM ecosystem package manager is used, Elixir and Erlang leave it up to the operating system package manager, a docker container, or some other solution.
- sodapopcan 2y ago> all three languages implement OTP in "user land" rather than being part of the language I understand that, but why then is OTP then limited on Gleam? Is interop to Erlang different than it is in Elixir? Elixir doesn't offer Elixir versions of a *lot* of OTP, but its Erlang interop feels quite natural (though not seamless). Can you just farm out to Erlang in Gleam? Does Gleam's static typing hinder this at all? Of course I can look this up for myself, but figured I'd asked here for the benefit of others since you're the author of Gleam :)
- lpil 2y agoIt’s not limited in Gleam. All existing Erlang and Elixir OTP modules are usable in Gleam, and there’s also an additional set of Gleam OTP modules which provide type safety guarantees for a subset of OTP functionality.
- dqv 2y agoI think what they mean that the Gleam OTP implementation has some caveats - the two that jump out at me is not supporting named processes and not supporting all OTP system messages. Named processes, though, could be implemented like Elixir's Registry, but gleamically. Something that takes a type and returns a PID. Then the process gets named with a via-tuple that calls Gleam's registry.
- lpil 2y agoAye, but this is the same as Elixir; it doesn't have full support for OTP and you are expected to use Erlang modules when you want the rest. RE named processes, that's coming in the next release, and there's already multiple registry modules implemented in Gleam, including one funded by the Erlang Ecosystem Foundation.
- sodapopcan 2y ago> Aye, but this is the same as Elixir; it doesn't have full support for OTP and you are expected to use Erlang modules when you want the rest. Ya that's what I was asking about, mostly the interop. But I can just look it up :). Thanks, Louis!
- dqv 2y agoDidn't even think to check for registry modules. The impression I got from the Gleam OTP readme is "can't use this yet", but that was overly pessimistic of me. I really need to give it a try in my next foray out of my comfort zone.
- lpil 2y agoIt’s certainly ready for use! The HTTP server made with it is used in production and was the fastest server available on the BEAM for some time, though Elixir’s Bandit has overtaken since then.