Re:Julia 1.9.0 lives up to its promise
by sundarurfriend on Saturday May 13, 2023 @05:18PM
(#35932834)
> But it's also a weakness because the first time you start up a REPL and call a bunch of functions, each of those functions has to be compiled from scratch, which takes a long time (google “Julia time to first plot”).
But also to further clarify on this, the context of the article is that Julia 1.9 makes it so that for code in packages, the package authors can set up a "call a bunch of functions" section in the package itself, and the compiled results of those calls will be stored as native code. So anything from those parts will have much lower "time to first X".
This is a strength, as the only thing you have to do to get the performance of fully compiled code (modulo things like GC and bounds checking) is make sure your functions are “type stable”, i.e., their type information can be determined statically. (In fact, in Julia you get better performance by writing more, smaller functions because you'll have more regions within which the types are statically inferrable.) But it's also a weakness because the first time you start up a REPL and call a bunch of functions, each of those functions has to be compiled from scratch, which takes a long time (google “Julia time to first plot”).
Julia has other niceties such as very flexible math (promotion between every pair of numeric types) and a lisp-like macro system with homoiconic code, which make writing numerical code and scientific algorithms highly ergonomic.