The Problem with Julia that makes me want to leave - First run Times

Savy!

Definitely try 1.10, this is the Julia version that finally made Makie usable for me.

julia> @time using GLMakie; plot(rand(10))
  2.916235 seconds (4.18 M allocations: 447.190 MiB, 10.54% gc time, 1.28% compilation time: 53% of which was recompilation)
10 Likes

You werenā€™t annoying [This was supposed to be a private message, anyway actually ok, and maybe good it wasnā€™t.] and it seems awesome what youā€™re doing already. And Manim, I didnā€™t know of, only 3Blue1Brown, who apparently made it, not only his animations with, so I learned something from you and others about e.g. it. FYI: Heā€™s now in the Julia community, or at least teaching Julia. As I stated, itā€™s not either or, use Python with and e.g. Manim.

Thatā€™s not something Iā€™ve seen happen, or I donā€™t see those .pyc files so Iā€™m not sure happens for all code, or just packages(?). Anyway doesnā€™t happen for Julia code, only packages are precompiled, and I would like that changedā€¦

1 Like

It used to show up in the same directory but they reasonably changed it to a separate cache.

Not sure how far that can go. Executables are a bit more flexible, you could compile something as isolated as a function specialization. But for loading code into a session or composing with other code somehow, you need a module. Youā€™d also want the cache to update upon source and environment changes, and at that point you have a package. .pyc files update as well, but I think (not sure) that they donā€™t need to update when imported dependencies do because the bytecode doesnā€™t assume anything about the dependencies to make optimizations.

Well well wellā€¦ Iā€™m loving it hahaha! Yayyy!

5 Likes

From the perspective of a guy who first programmed on punch cards and had to wait overnight for my deck to run on the mainframe (all the time walking barefoot to school in the snow uphill both ways), thereā€™s a tradeoff view of the latency.

Think of it as a the difference between watching an hour of a streaming series versus spending the same hour watching Tik-Tok. Different, right? Tik-Tok gives quick bursts and leads to a quick trigger finger for scrolling to the next. The reason is the dopamine rush of seeing what happens next. After tearing lose, thereā€™s very little that can be recalledā€”it was all a rush. The series, on the other hand, is setting context constantly to enable understanding of the characters, the environment that they are struggling, in one way or another, to overcome, and the directions in which the navigation of the environment and the development of the charactersā€™ inner lives and outer circumstances tend. Although an episode may end with a cliff hanger until next week, the anticipation experienced comes with built-in deferred gratification. That process isnā€™t driven by just the novelty anticipation circuits involved in stirring up the dopamine. Although the emotional circuits may be humming in the background, there is also some prefrontal cortex cognitive involvement as well. The simmering of the mixed ingredient serves up a rich stew to be savored.

My early experience didnā€™t lead on to a career in software development, but it shaped my later language learning and what Iā€™ve discovered in moving between compiled and interpreted languages is that the difference is similar. Specifically, in debugging, I react to errors differently. In interpreted languages, Iā€™ll try something, it throws an exception and Iā€™ll search first for a stupid typo and if thatā€™s not it the fallback amounts to ā€œwell, maybe this will work.ā€ In compiled languages, Iā€™m damned well not going to fall for stupid typos because of the time penalty and when I do get a more substantial error, I make sure that I understand exactly what the error means before I try fixing it with shots in the dark. Thatā€™s my human nature.

One thing that helps to offset the time-to-first-compile cost for me is to start a session in a project with a warmup script that runs what amounts to a series of hello-worlds for the functions that Iā€™ve got developed to date for it. That way, new stuff in the session only needs to be compiled.

6 Likes

Now imagine if we took that warmup script and cached all the compilation the occurred while doing so. That is the system image and that is what PackageCompiler.jl will help you build:

1 Like

Good to know. Iā€™m going to try adding a provisional compiled version like this to projects. Great measure twice cut once advice.

Now I donā€™t even know what to say to that :sob:. But well, again, you guys areā€¦ right! I was a little stupid (a lot ig). Ooooo andā€¦ wouldā€™ve been quite something in the early days of programming eh?
I see weā€™ve come a long way, I only meant to convey my feelings about how Julia compares to other languages. Although now Iā€™ve come to an understanding that each of them has their own purpose, and while Julia is a slight bit behind in TTFC itā€™s not that much of a deal breaker, given the computational speed. Also, things are always improving and there are ways to speed things up!

1 Like

Soo THAT is what it does!
Ahhh! Now I get it! Thank you!

Just trying to pass on hard lessons, the way old guys like to do. Youā€™ll be doing the same no doubt. :grin:

1 Like

Wait, you can compile plain old Julia code too?

What is the purpose of Modules then (apart from being able to mention what you want to export and have the naming right)? I never really understood that.

You gotta first define all your functions and stuff. Add the Module and export statements. Then include the file, which you can do with others too and finally call it as a module as well?
How do you use modules if it isnā€™t for being able to compile them? (In the documentation you provided, they compiled a simple julia code, not a module.)

(sorry this is wondering a bit off topic)

59 posts were split to a new topic: Investigating large latency on Windows

+1 on gamedev ā€“ I think Julia would be great for games! Iā€™ve used it for simulations for tabletop role playing systems and it was a lot of fun for that.

2 Likes