# List of most desired features for Julia v1.x

**URL:** <https://discourse.julialang.org/t/list-of-most-desired-features-for-julia-v1-x/4481>\
**Category:** Community\
**Tags:** gripes, suggestions\
**Created:** [June 27, 2017, 3:27am UTC](https://discourse.julialang.org/t/list-of-most-desired-features-for-julia-v1-x/4481 "2017-06-27T03:27:19Z")\
**Posts on this page:** 1\
**Showing post:** 124

<div class="post-metadata">

**Author:** ![klacru](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klacru/32/27890_2.png) [@klacru](https://discourse.julialang.org/u/klacru)\
**Post date:** [August 14, 2017, 6:46am UTC](https://discourse.julialang.org/t/list-of-most-desired-features-for-julia-v1-x/4481/124 "2017-08-14T06:46:54Z")

</div>

I want to add a my personal list of desired features. I don’t restrict to 1.0, maybe some are 2.0+.  
Most ideas were evoked by the arguments in [discourse #5278](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278) and the links therein.

- **Type system**  
Keep the type system simple and elegant as it is now. Types and inheritance should remain the only relevant inputs for method dispatching.

1. _Abstract types_ (stateless, no instances) and _concrete types (structs)_ (optionally statefull, instanciable) shall be the only “type-like” constructs of the language. Other related features (known as traits, interfaces, protocols,…) could be added as optional properties to the types. I will go into details later.
2. Allow _method signatures_. That could be parametric subtypes of `Function`. e.g. `Function{Int, AbstractVector{T}} where T...`. Used for dispatching: `function f(g::Function{Int}) ...`. The signature does (not) include function name?
3. _Interfaces/protocols_  
Optionally add method signatures as members of `abstract type` and `struct`.  
Syntax e.g. `struct S ... fname::Function{Int} end`.  
Semantics: check after end of compilation the existence of specified methods.  
Warnings, if missing methods (signature including name).
4. _Abstract multiple inheritance_.  
Syntax e.g. `struct N <:A<:B ...` or `abstract type N <:A::B::C` … where `A,B,C` are already defined types.  
Semantics: For the purpose of dispatching replace chain of supertypes by linearized list of set of all supertypes. This concept is stolen from `Scala`, see also here: [linearization](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278/16).
5. Allow _singular inheritance from concrete types_. That means, new concrete types can be defined by extending existing concrete types, _if they do not add own state_.  
Syntax e.g.: `struct N <:S[<:A...] < end` where `S` is has state, `N` has no own data fields, `A` additional abstract.  
Semantics: The new type shares state and layout with the old one (methods of course). Implicitly define default conversion function `N(::S)`.  
Example: `struct RichString <: String; blow_up::Function{RichString} end`. Conversion: `RichString("abc")`.
6. Implement _implicit conversions_. In the case of concrete inheritance (5.), in a restricted context treat all objects `x::S` as `N(x)`. That would, together with (5.), cover an essential property of _trait_s. [discourse](https://discourse.julialang.org/t/why-does-julia-not-support-multiple-traits/5278/33)  
Example: `blow_up("def")`
7. Implement _automatic delegation_ to methods of data members.  
Syntax e.g. `struct S ...; delegate data::T ... end`.  
Semantics: add all methods of T (known by interface definitions in T) to the method list of S and use them at runtime. Resolve conflicts by defining breadth/depth-first search. This contributes also this old problem: [type mixin #816](https://discourse.julialang.org/t/add-type-mixins-to-overcome-subtype-limitations/816/)

- **Type stability**  
Improve support for type stabilty.

1. make the `{Core.Inference|Base}.return_type[s]` methods first class (documented, in`Base`).
2. make the output more exact. For example `return_type(cmp, (Real, Real))` should be `Int64` and not `Any`.

_to be continued_

---

_[View the full topic](https://discourse.julialang.org/t/list-of-most-desired-features-for-julia-v1-x/4481)._
