Julia is moving in the direction of having a static sub-language and even things like enforceable interface/etc. However, if we are not VERY careful, we can lose one big advantage that Julia has, easy generic.
Duck typing allows easy, intuitive generic code, for example, if you want to print foo, you do
function print_foo(x)
println(foo(x))
end
However, with strict interface, here goes something like…
function print_foo<fooable T>(T x)
printable foo_of_x = foo(x)
println(foo_of_x)
And it errors out anyway because how do you know that foo(x) is printable?
If you specify that foo must return a printable type… well… issues again, because what if you want to foo other types? Or you wanna do something like…
fooable<printable>
And then it gets complicated. What if the foo of the object is another type which is itself also fooable and so on?
And then there are all sorts of abstract algebra that can solve problems, but introduce lots of complexity or unfamiliarity.
We already have safe languages like Rust/etc.
What Julia offers is fast, generic, easy code. That is something I believe we should hold on for dear life. A fully type-inferred Julia is a lot like GC-ed, convenient C++. Both languages have lots of supports for fast generic. C++ has sfinae/decltype/etc. Julia has dynamically typed semantic that compiles down to static code with multiple dispatch. C++ has template. Julia has parametric types.
So, with that in mind, how do we address the safety of the language then?
P.S. This topic might be too broad. Once we get the directions going, we can split this thread into multiple threads and close this thread down. I’m just concerned about the future of Julia generic.