0.- Morning. After a year learning and working with âJuliaâ every day, I continue being a ânewcommerâ⌠at this time, and I am afraid that some years moreâŚ
Like a ânewcommerâ I wonderâŚ
Q1.- Could be that we are thinking that we have better performance by explicit âtype annotations on parameters on functionâ because we can find this expresion:
âThe Julia compiler is able to generate efficient code in the presence of Union
types with a small number of types [1], by generating specialized code in separate branches for each possible type.â
Types ¡ The Julia Language
Q2.- Could be that in many situations we need to be sure about what Types Julia is using in all operations into the function. Because allways we need to be certain of the results of the calculations.
An easy example:
a=123456789123
println("es ",a, " y T d a = ", typeof(a))
r2=a*a
println("es ",r2, " y T d a*a = ",typeof(r2))
r3=a*a*a
println("es ",r3, " y T d a*a*a = ", typeof(r3))
r4=a*a*a*a
println("es ",r4, " y T d a*a*a*a = ", typeof(r4))
The result here is an (error by) overflow ( in fact without any notice ) because Julia continue using the same âdefault typeâ.
es 123456789123 y T d a = Int64
es 4568175676801474313 y T d a*a = Int64
es -8268922784655733861 y T d a*a*a = Int64
es -8138388883848516015 y T d a*a*a*a = Int64
Assertion.- You should be careful with the recommendations because you do not know all the calculation scenarios in which we are working. We may be ânewcomersâ in Julia but not in the details of Scientific Calculus.
Thanks anyway.