favicon here hometagsblogmicrobio cvtech cvgpg keys

Julia x Zellij

Soc Virnyl Estela | 2022-12-19 | reading time: ~2min

Multiplexing workflows§

A multiplexer is a program that multiplex a screen into several splits usually separated with their own purpose and function. In this post, the multiplexers we are talking about is for the terminal.

There are many multiplexing programs that exist today such as screen, tmux, and zellij. They serve similar purposes in that each split, pane, tab or whatever they call it can specific programs to your liking e.g. running htop, editing a file, listing passwords. Other multiplexing capabilities maybe is already built-in with your terminal emulator e.g. kitty and wezterm are known to have such features.

So how does a multiplexing workflow help you improve your Julia package development?

What is Zellij?§

Zellij is one of the popular rust cli tools that exist today - a multiplexer with batteries included and soon to have plugins support. I am writing this blog with the help of zellij using a layout that runs zola. It's a simple layout you can use as you can see below.

layout {
  pane split_direction="vertical" {
    pane command="helix"
    pane split_direction="horizontal" {
      zola { args "check"; }
      zola { args "build"; }
      zola { args "serve"; }
      pane {
      	name "free-terminal"
      }
    }
  }
  pane size=1 borderless=true {
    plugin location="zellij:compact-bar"
  }
  pane_template name="zola" {
    command "zola"
    start_suspended true
  }
}

Julia x Zellij§

As you can see from the example layout from the previous section, you can finally get an idea of how to integrate julia with zellij.

layout {
  pane split_direction="vertical" {
  	pane command="helix"
  	pane split_direction="horizontal" {
  		pane {
  			name "julia-repl"
  			command "julia"
  			args "--startup-file=no" "--project=." 
  			start_suspended true
  		}
  		pane {
  			name "julia-test"
  			command "julia"
  			args "--startup-file=no" "--project=." "-e" "using Pkg; Pkg.instantiate(); Pkg.test()"
  			start_suspended true
  		}
  		pane {
  			name "free-terminal"
  			focus true
  		}
  	}
  }
  pane size=1 borderless=true {
  	plugin location="zellij:compact-bar"
  }
}

This results with the layout below:

zellij-julia-layout-template

  • Left contains your editor
  • Right contains the following:
    • Julia REPL
    • Julia Pkg.test() command
    • Terminal

This layout makes it easy for you to test and rerun commands for your Julia package development.

Now what?§

This may not be your workflow but for those who are interested in using zellij may find it a good idea to integrate this workflow for their next Julia project. Thanks for reading this short post.

Articles from blogs I follow around the net

Some Thoughts on the Twitter Mass Exodus

Another wave of Twitter users are jettisoning the social media website in favor of alternatives. Some are landing in the Fediverse (Mastodon and other ActivityPub-enabled software). Others are going to BlueSky. Some are just outright abandoning social medi…

via Dhole MomentsNovember 19, 2024

hyper in curl Needs a Champion

tl;dr - hyper in curl is nearly complete, but it needs a champion. Without a partner actively engaged that wants to enable and ship, it’s now on the path for being deprecated and removed. It needs a champion, a backing vendor or distro. Will that be you? …

via seanmonstarNovember 19, 2024

Swift observations from a reluctant Rustacean

Recently I've been thinking about Swift in terms of Rust, & have appreciated anew some of the choices made. In Rust. There's been a proliferation of X vs Y posts on the web, especially since the advent of LLM AI, so I try to resist the format. It's often e…

via Mike KreuzerNovember 16, 2024

Go Concurrency Patterns

Goroutines Channels Select Statement Wait Groups Mutex Conditions Atomic Operations Once Context Map Real Examples Goroutines The go keyword is used to start a goroutine. A goroutine is a lightweight, managed thread used by the Go runtime to run functions …

via Posts on integralistNovember 15, 2024

anarchism starts in the now: hope for a better future

there is still time

via maia blogNovember 14, 2024

Why I Will Always Be Angry About Software Engineering

Why do I bother getting angry about software? When I started writing, it came from a place of ennui — absolute despair at the amount of waste I was seeing in the technology sector since leaving university. I was paid spectacularly well, but nothing I produ…

via LudicityNovember 12, 2024

Generated by openring-rs

favicon here hometagsblogmicrobio cvtech cvgpg keys