5 ms·
Multi-methods really are a lot of fun, but I'm missing the Trait system (instead of the object hierarchy) that makes Rust so modular. I know that there are some
by xiphias2 8y ago
Multi-methods really are a lot of fun, but I'm missing the Trait system (instead of the object hierarchy) that makes Rust so modular. I know that there are some tries to put it into Julia, but none of them is well supported.
- vanderZwan 8y agoI thought Tim Holy's Trait Tick was considered the de facto way to use traits in Julia? https://github.com/mauro3/SimpleTraits.jl https://github.com/mauro3/SimpleTraits.jl
- xiphias2 8y agoMaybe it works great, but the syntax doesn't feel native to me, and I don't see it used in the standard library, which means that it's not embraced by the language developers.
- deleted 8y ago[deleted]
- StefanKarpinski 8y agoHoly Traits are used extensively in the standard library (for iteration and collections among other things).
- 3JPLW 8y agoNot many folks use the macros that those macro-trait packages define, but the technique itself is in widespread use throughout the core language and standard library. That's where it was first posited and implemented, in fact: https://github.com/JuliaLang/julia/pull/8432 https://github.com/JuliaLang/julia/pull/8432 (and see the link to the "trait trick")
- xiphias2 8y agoGreat, thanks!