O'Reilly logo

Mastering Julia by Malcolm Sherrington

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Metaprogramming

Julia has been designed to tackle problems arising in science and statistics. It follows the route of traditional imperative languages. It is not a functional language, such as Haskell, OCaml, and Clojure, but since it incorporates a Scheme interpreter, it is possible to create runtime macros rather than the preprocessor style ones found in C/C++.

Macros are useful in efficiently generating boilerplate code, and we have already made use of the @printf macro, which emulates the C-style printf() function.

If a true functional approach is required, the reader is directed to the Lazy.jl package, which implements lazily evaluated lists plus a library of functions to use them and many well-designed macros. So, to get a grasp of Julia metaprogramming, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required