Chapter 6. More on Types, Methods, and Modules
Julia has a rich built-in type system, and most data types can be parameterized, such as Array{Float64, 2}
or Dict{Symbol, Float64}
. Typing a variable (or more exactly the value it is bound to) is
optional, but indicating the type of some variables, although it is not statically checked, can gain some of the advantages of static type systems as in C++, Java, or C#. A Julia program can run without any indication of types, which can be useful in a prototyping stage, and it will still run fast. However, some type indications can increase the performance by allowing more specialized multiple dispatch. Moreover, typing function parameters makes the code easier to read and understand. The robustness of ...
Get Getting Started with Julia now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.