June 2019
Intermediate to advanced
218 pages
5h 19m
English
Julia macros are code that can be used to write other Julia code. A macro is executed very early in the compilation process, as soon as the code is loaded and parsed.
Macros are usually used as a means to reduce repetitive code, whereby large volumes of code with a common pattern can be generated from a smaller set of primitives. However, they can also be used to improve performance in some situations. This can be achieved by moving common or constant computation to the compile time wherever possible. To see how this can work, let's look at how we can evaluate a polynomial.
Read now
Unlock full access