Table Of Contents

Diving into Julia: some initial observations

Published on: 2024-11-11

Julia: my introduction

Julia is a language that I've been after getting better acquainted with for a while. I won't lie, I've actually tinkered with it several times, but now I have good reason at work to go in more deeply, so I am.

I think I know enough to appreciate that Julia is an elegant and very powerful language, but I've not found the transition to a JIT compiled language easy to deal with. Primarily, this is because the best developer worklow that works is more difficult to determine. With compiled languages, you know you have to go on and get on with compiling on amendment. With scripting languages, it's more immediate to get results and understand flow of execution, almost making it too easy to throw things together and debug-as-you-go (yes, I've gotten spoilt in recent years!)

Why transition to Julia?

I am a pretty experienced programmer, having spent more time with Python, C, Java and Perl in commercial worlds than research. MATLAB I never enjoyed being proprietary and Octave, though I've used it, was only used for explicitly research experimentation and never for anything that would be automated or configuration driven.

Julia makes serious effort to be both scientific-computation adept and able to perform as a systems programming language. This is in addition to being extremely well-thought out from a language design perspective. Primarily, as I move into research computing for natural environment modelling, I'm explicitly drawn towards something that is designed, well, as a language for distributed computing on these workloads. I know enough to know that Julia is worthwhile on this front.

Challenges

For someone who is well versed at having effective workflows when programming, I hope it's helpful to highlight some things that I've struggled with.

Versions

Previously, I was using Julia 1.5+ through a manual tarball extract and/or RPM install, either symlinked or at the behest of the RPM channels.

Then came juliaup!!!

I haven't spent time using this but was jumping from 1.9 to 1.11 and it has suddenly appeared in the intervening months I wasn't paying attention. Go get JuliaUp!!!. It's basically nvm (the thing that makes NodeJS and NPM usable) for Julia and is a welcome addition.

Managing Julia versions manually is annoying, so get rid of this as a first step into the language. I'm glad it's appeared and is now taking that pain away.

Development Tooling

Pluto.jl

First and foremost, I can't get on with VS Code + Julia extensions. I find the interface wholly unappealing as someone who alt-tabs a lot. I don't like learning lots of new shortcuts to use an IDE effectively (VIM was the last time). In addition, the plotting window is horrible to look at. I'm likely missing something, but both Jupyter via IJulia and Pluto.jl seem like better options.

Starting the Pluto Notebook Server
Starting the Pluto Notebook Server.

The deciding factor having tried Jupyter is that I didn't want the burden of IJulia managing miniconda to produce a Jupyter environment to instantiate IJulia so that I can run Julia. I use Jupyter notebooks elsewhere, and this seems a bit around the houses.

So, Pluto is where I'm at!

Things I immediately like:

Running the Pluto Notebook
Running the Pluto Notebook.

The fact that it is taking advantage of the Julia ecosystem: this is a big win!

  • The reactivity of the notebooks: I'd previously tried using Observables with GLMakie (which is awesome) in VS code and this is what left me wanting!
  • The ability to embed pretty much anything into them
  • The speed: debugging might be an issue and these are notebooks, but using this doesn't stop me using a debugger seperately
  • The export functionality that allows Julia code to be linearly run straight from the notebook.
  • The level of visibility for diagnosing the startup and operation of the notebook.

Finding libraries

Initially, I was playing simply with plotting and the example notebooks. The system is managed via the Pkg.jl and relays to the packages ecosystem. The wealth of libraries in Julia is overwhelming, but that's easily overcome if you have some intended purpose behind you!

Suddenly things changed

I got distracted (life is distracted with a newborn) by lots of other things in writing this post. So over the month or so since I started it, I got frustrated with Pluto due to the onerousness of JIT happening in temporary environments constantly, as well as finding that things aren't entirely translatable directly to Julia. All in all, it wasn't a transparent development process.

Back to VSS

So I'm back to VSS, from Flatpak: the open-source version without the extra analytics. That and vim, though that's a slower game for getting things done. We'll see how things go as I employ tactics such as Revise and get into more complex projects.


Comments

Please do leave a comment. I'm moderating them manually for the moment and the Isso project I'm finding slightly experimental, but AMAZING nonetheless. I won't reset the comments database now though, so feedback will be valued!


Tags:

software  julia