3 ms·
> ... practitioners experience in using the language I use and like the language. > For example base functions being untyped is exactly how good Julia library
by neolog 5y ago
> ... practitioners experience in using the language
I use and like the language.
> For example base functions being untyped is exactly how good Julia library code must look. Julia wants your code to be generic.
I don't think there needs to be a conflict between being typed and being generic, especially when traits are available. There has been a lot of advancement in flexible type systems and ad-hoc polymorphism in the last 20 years. For example, there's a lot we can say about the type of `map` or `filter`, but none of that information is specified in Julia.
- Certhas 5y agoI fully agree and have been advocating for the introduction of traits/protocols/concepts or some such thing in Julia. But the problem is not that Base is untyped in the current type system, it's that the type system is not expressive enough to talk about the information you want to talk about. Map should have type map(f : T -> U, arr : Iterable{T}) -> Iterable{U} None of that can be expressed in the Julia type system as is. There is no AbstractCallable type that functions would be subtypes of, and there is no Iterable trait (AbstractArray comes closest but without multiple inheritance of AbstractTypes you can not rely on it).
- neolog 5y agoYeah that's exactly what I'm saying.
- adgjlsfhk1 5y agoOne thing that makes this very difficult is that fancy types like this seem like they might make the specificity algorithm a complete nightmare.