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

Status update, November 2024

Hi all! This month I’ve spent a lot of time triaging Sway and wlroots issues following the Sway 1.10 release. There are a few regressions, some of which are already fixed (thanks to all contributors for sending patches!). Kenny has added support for softwa…

via emersionNovember 21, 2024

Key Transparency and the Right to be Forgotten

This post is the first in a new series covering some of the reasoning behind decisions made in my project to build end-to-end encryption for direct messages on the Fediverse. (Collectively, Fedi-E2EE.) Although the reasons for specific design decisions sho…

via Dhole MomentsNovember 21, 2024

The Ethereum MEV Bots are a scam

Several months ago, I wrote this article: The Fascinating Ethereum MEV Bot Scam, where I dived deep into the technical aspects of a scam that has been circulating for years on platforms like X.com and YouTube. These scams revolve around deploying smart…

via Christian Visintin BlogNovember 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

Generated by openring-rs

favicon here hometagsblogmicrobio cvtech cvgpg keys