News for hackers. Stuff that matters.
Re:Unpacking Elixir: Concurrency by jolux on Friday August 25, 2023 @09:27AM (#37261469)
Note that Erlang has maps since OTP 17, which I believe are implemented more efficiently than dicts.
Re:Unpacking Elixir: Concurrency by jerf on Friday August 25, 2023 @10:37AM (#37262214)
Good point, though I think my point about user types still holds. It is very difficult to create any efficient user types of your own with the primitives Beam provides.
Re:Unpacking Elixir: Concurrency by jolux on Friday August 25, 2023 @10:50AM (#37262363)
Yeah, the lack of user-defined types is definitely one of the biggest downsides of the BEAM.
Re:Unpacking Elixir: Concurrency by throwawaymaths on Saturday August 26, 2023 @01:43AM (#37270221)
Elixir builds types out of maps (using the struct) and you can build multiple dispatch operations over types using Protocol. If you want to pretty print your user types, you can implement the Inspect protocol.