Saying it again #julialang is not like #python or some other dynamic language. Using types doesn't really make your code fast

Adding type annotations serves three primary purposes: to take advantage of Julia's powerful multiple-dispatch mechanism, to improve human readability, and to catch programmer errors.

Julia’s JIT compiler makes the code fast regardless of the type-constraints. Read more here: oxinabox.net/2020/04/19/Julia-

See you don't need to type annotate #julialang like Cython to speed up things. C like speed Python like syntax :opensource: :blobcatdrool:

unless 👇

Julia avoids automatically specializing on argument type parameters in three specific cases: Type, Function, and Vararg

Follow

@abhi_jl
also unless 👇

you're defining a type i.e. a struct, in which case specifying the types does help a lot with performance. In particular, specifying non-abstract concrete types for the fields of the struct. Since this lets know how much memory your struct is going to need, which allows it to generate optimized code. See: docs.julialang.org/en/v1/manua

@athulsudheesh @digital_carver can you please elaborate what you mean by type stability here?

@athulsudheesh @digital_carver for context this thread is a follow to my conversion with Lorenz when I asked him why fastai.jl doesn't have type casting

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.