5 ms·
Check out the Elixir "protocol" feature, it's similar to interfaces: https://elixir-lang.org/getting-started/protocols.html https://elixir-lang.org/getting-star
by lindgrenj6 6y ago
Check out the Elixir "protocol" feature, it's similar to interfaces: https://elixir-lang.org/getting-started/protocols.html https://elixir-lang.org/getting-started/protocols.html
- Grimm1 6y agoI was just about to say, protocols fill the interface slot pretty well
- QuinnWilton 6y agoProtocols + the Typeclass library [0] makes for some of the most extensible Elixir code I've worked with. [0] https://github.com/witchcrafters/type_class https://github.com/witchcrafters/type_class
- sb8244 6y agoHi Elixir friend! Have you done a blog post on this by chance? I'd be really interested in reading one.
- QuinnWilton 6y agoI haven't, but the creator of the library (Brooklyn Zelenka / @expede) has given a few excellent talks that reference her libraries. This is a personal favourite: https://www.youtube.com/watch?v=JD0FJTmuV_Q https://www.youtube.com/watch?v=JD0FJTmuV_Q
- biggestlou 6y agoI've used protocols, and they are useful as a kind of bare minimum interface/implementation abstraction. But they're nowhere even close to something like Rust traits. Which is totally fine given Elixir's goals.
- AlchemistCamp 6y agoI'm pretty deep into Elixir and have been learning a bit of Rust on the side this year, so this is interesting. Could you elaborate a bit?