julia-language
Skill0 starsChanged 3 days agoMITView on GitHub
Julia the language where it bites numerical code: dispatch as a design tool, the type system's three pain points, broadcasting, metaprogramming, and the package and interop boundary. Use when writing or restructuring Julia.
In this repository55 other files it gives its agents.
- advanced-optimizationSkill
- bayesian-inferenceSkill
- bayesian-pinnSkill
- bayesian-ude-workflowSkill
- catalyst-reactionsSkill
- continuum-mechanics-and-rheologySkill
- control-theorySkill
- creating-julia-appSkill
- debugging-toolkitSkill
- differential-equationsSkill
- differentiationSkill
- equation-discoverySkill
- experiment-trackingSkill
- fem-feaSkill
- julia-graph-neural-networksSkill
- julia-ml-and-dlSkill
- julia-model-deploymentSkill
- julia-paper-implementationSkill
- julia-pro-helpSkill
- julia-pro-modeSkill
- julia-reinforcement-learningSkill
- modeling-toolkitSkill
- neural-pdeSkill
- nonlinear-dynamicsSkill
- numerical-methods-implementationSkill
- package-development-workflowSkill
- performance-tuningSkill
- physical-learning-systemsSkill
- playbook-debugSkill
- playbook-model-validateSkill
- playbook-package-releaseSkill
- playbook-paper-implementSkill
- playbook-perfSkill
- playbook-test-specSkill
- principle-both-sidesSkill
- principle-breakingSkill
- principle-file-is-truthSkill
- principle-gateSkill
- principle-limitsSkill
- principle-loud-failureSkill
- principle-one-stepSkill
- principle-proof-listSkill
- principle-rebuttalSkill
- principle-runtime-surfaceSkill
- principle-three-boundsSkill
- principle-three-clocksSkill
- scientific-visualizationSkill
- sciml-and-diffeqSkill
- setup-julia-proSkill
- signal-processingSkill
- simulation-and-hpcSkill
- statistical-physicsSkill
- symbolic-mathSkill
- web-development-juliaSkill
- zarr-cloud-arraysSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
When you do generate, macroexpand(@__MODULE__, :(@m x)) and @macroexpand are the debugging tools, and esc hygiene is the bug source.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Julia language
The language decisions that change numerical results or speed, and nothing else. Each of these is a place where Julia's defaults are right for most code and briefly surprising for the rest.
Dispatch is the design tool
abstract type AbstractSolver end
struct ImplicitEuler <: AbstractSolver end
step(::ImplicitEuler, f, y, dt) = y .+ dt .* f(y) # a method, not a flagA boolean flag implicit=true inside one function costs a branch, a compile-time specialisation you did not choose, and a reader's attention. A method on a type costs none of those and shows up in methods(step).
The cost of dispatch: a call on an abstractly typed container is dynamic. Put a function barrier at the boundary — the outer function may be type-unstable, the inner one called per element still specialises.
The type system, in the three places it bites
- Containers.
Vector{Any}andVector{Real}defeat specialisation. Annotate the container's element type, not the argument:f(x::Vector{Float64})blocks reuse;f(x::AbstractVector{<:Real})does not. - Fields. A struct field typed
Anyboxes on every access. A parametric fieldstruct S{T}; a::T; endspecialises perT. - Returns. A function that returns
Float64on one branch andnothingon another returnsUnion{Float64,Nothing}everywhere.@inferredis the test.
Broadcasting and its traps
. fuses loops, which is why x .+ y .* z allocates once. Three traps:
- Broadcasting over a
Tridiagonalor aSparseMatrixCSCdensifies silently — checktypeofbefore@btime, not after. @viewsturns a slice into a view; without it every slice copies.- A comprehension is often faster than a broadcast chain when the body branches, because
.cannot short-circuit.
Metaprogramming, used sparingly
@generated and @eval earn their keep in three places: unrolling a small fixed-size loop, building a specialised Jacobian, and defining a family of methods from a table. Everywhere else they cost compile time and produce errors that report the macro's line rather than yours.
When you do generate, macroexpand(@__MODULE__, :(@m x)) and @macroexpand are the debugging tools, and esc hygiene is the bug source.
Package and interop boundary
Project.tomlwith a bounded[compat]entry per dependency; a package that accepts any version breaks on the next minor.- Python interop: PythonCall.jl for a stable, typed boundary; PyCall for compatibility with old code. A Python call in a hot loop crosses the boundary per call — hoist it.
- C and Fortran:
ccallfor a stable ABI,Clang.jlto generate the bindings,Libdlfor the library path.
Depth
references/julia-mastery.md— the idioms behind dispatch, traits, parametric structs, and macro hygiene.references/core-julia-patterns.md— broadcasting, comprehensions, closures, stdlib.references/ecosystem-selection.md— which package, when two do the same job.references/interop-patterns.md— Python, C, Fortran, Rust.references/debugging-julia.md—@code_warntype,Cthulhu,@infiltrate.
Performance as a separate concern: ../performance-tuning/SKILL.md.
Done when
The container's type parameters are chosen so the hot path stays concrete, and @code_warntype (or @descend for the nested call) shows no Any or Union in the inner loop; behaviour differences are expressed as method dispatch rather than as branches on a flag; and the allocation count of one iteration is known from @time.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

