Precompille can't be fully recursive, because the types of a Julia program
might depend on runtime values. Dispatch is performed on the runtime types,
and they might not be fully determined when only the types are given as an
argument to the function.
eg. the return type of
*get_my_array(dims::Vector{Int}) = Array(Float64, dims...)*
depends on the value (length) of dims, which can not be inferred from the
type.
In such cases there will be too many code paths for precompille to handle.
It might be possible to create a @precompille macro that lets you
precompille all the code paths that will (at present time) be executed if
the statement were to be executed, but it will be a pure performance
optimization for benchmarking, and likely to give wrong results in edge
cases.
Ivar
kl. 14:15:55 UTC+2 mandag 26. mai 2014 skrev Matt Bauman følgende:
>
> I don't think precompile is recursive. That is, it'll compile the function
> you ask it to, but it doesn't do anything about the functions that are
> subsequently called. It might be nice to add that capability as an option.
>
> (I'm on my phone so I can't check, so I may be wrong).
>