# Why does Julia not support multiple traits?

**URL:** <https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278>\
**Category:** Internals & Design\
**Tags:** traits\
**Created:** [August 8, 2017, 11:36am UTC](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278 "2017-08-08T11:36:07Z")\
**Posts on this page:** 1\
**Showing post:** 43

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [August 14, 2017, 10:17am UTC](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278/43 "2017-08-14T10:17:59Z")

</div>

> [@tobias.knopp](#):
>
> The usual answer one gets here when asking for multiple inheritance is: we don’t need that we have holy traits.

No, I don’t think Holy-traits are seen as the “solution”, merely a stop-gap pattern until a time when traits are implemented at a language level.

Yes, I too think that _traits_ and _multiple inheritance for abstract types in which types can be added after creation_ are essentially identical. Of course, the latter is a bit of a mouth-full and would need a name: “trait” is a good one. In particular, if we semantically separate them from “interfaces”/“protocols” as you seem to suggest in point 3 and as I suggested [above](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278/12). Also, once you add interfaces and have a correspondence of them to abstract types, I think point 2 is needed. Or it would be a bit strange to have a type which implements the interface but is not a subtype of the corresponding abstract type.

And, yes, I also agree that in the end there should be one “dispatch system” and not some on types, some on traits, some on …

Last, I still think that traits of several types would be good to have: some interfaces in a multi-dispatch world will involve several types and it would be nice to encode them as a trait. To translate this into MI-speak, it would mean to add a supertype to a type tuple, say `Tuple{Int,Float64}<:SomeAbstractType`.

---

_[View the full topic](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278)._
