Skip to content

Developer notes

Uwe Fechner edited this page Jun 6, 2026 · 14 revisions

Julia developer notes

Introduction

The following suggestions are hints. Feel free to do things differently if you have a good reason.

.bashrc file

Add the following to your .bashrc file:

alias jl='bin/run_julia'

Optional:

export USE_REVISE=false

(or true, depending on your preferences; should be true while developing a package, can be false for working on examples)

Project structure

All projects should have the following folder structure:

bin
data (optional)
doc
output (optional)
src
examples (optional)
test
Project.toml
Manifest-v1.12.toml
README.md
CHANGELOG.md

There must be NO Manifest.toml file, rename it to a name that contains the Julia version number as shown above. Add the Manifest-v1.12.toml file to .gitignore and put a copy of it, using the name Manifest-v1.12.toml.default into git.

The bin folder should contain the Bash scripts:

run_julia
install
create_sys_image (optional)

The Project.toml file should contain:

[workspace]
projects = ["examples", "test"]

All sub-projects must be listed here. Each sub-project must have its own Project.toml file and refer to the main project with a line similar to:

[sources]
RamAirKite = {path = ".."}

Replace RamAirKite with the name of the main package.

The run_julia script

Goals:

  • Set the environment variables that are needed; while this should not be needed, often it is needed in practice
  • Set the number of threads to a reasonable value for the given project and hardware, for example, one thread per fast core
  • Load Revise (optional)
  • Load Kaimon (optional); Kaimon is a server that makes development using AI tools much faster and cheaper.
  • Start Julia using a custom system image, if available

The install script

Goals:

  • make it easy and fast to have a reproducible, working installation
  • make it possible to start Julia with jl and run the examples with menu() from the REPL The install script should:
  • update the registry
  • offer a menu to select the Julia version (currently 1.11 or 1.12)
  • copy the default manifest into the active manifest and instantiate and precompile the main project and all sub-projects
  • load the packages that might trigger extra pre-compilation

After running the install script, running the examples should not trigger any further precompilation.

Clone this wiki locally