I also think that checking generic programs is too difficult and a significant burden for programmers. However, if there’s a way to check specific program instances, this would be sufficient to avoid many errors. I mentioned these points in my Medium article .
Specifically, library authors could manually mark certain function instantiations to indicate that these instances have been relatively safely tested or proven. For example:
# a.jl, some generic array
f(x::AbstractArray) = …
# b.jl, some instances
@instance begin
f(x::Vector{T}) where T
f(x::Matrix{Float32})
end
Then, when calling these functions, if a specialization is not on this list, a warning would be issued. Of course, users could choose to ignore these warnings. This approach not only reduces the burden on library maintainers and users but also facilitates precompilation and testing.