Why Julia?
Julia was designed from the ground up for scientific computing. It walks like Python, runs like C, and makes high-performance numerical work feel natural. The reasons it exists say a lot about what data scientists actually need: approachability without sacrificing speed.
Set up the Julia runtime
Julia cells need the julia executable on your PATH:
brew install julia # macOS
sudo apt install julia # Debian / Ubuntu
sudo dnf install julia # Fedora
sudo pacman -S julia # Arch Linux
# or download the official installer from https://julialang.org/downloads/
Verify with julia --version, or run mars notebook doctor to check every runtime at once.
Walks like Python
Julia's syntax is intentionally familiar to Python and MATLAB users. No semicolons, no type annotations required, and a REPL that encourages exploration:
function moving_average(values, window)
totals = Float64[]
for i in 1:length(values)
chunk = values[max(1, i - window + 1):i]
push!(totals, sum(chunk) / length(chunk))
end
return totals
end
A Python user can read this and understand most of it immediately. The differences are minor and intentional: Julia uses 1-based indexing, push! for in-place mutation, and end instead of indentation. The learning curve is shallow enough that many Julia tutorials start with "if you know Python, you already know Julia."
Runs like C
The same function runs at near-C speed because Julia compiles through LLVM. The hot loops become native machine code, not bytecode interpretation. A tight numerical loop in Julia does not need to delegate to a C extension — it is compiled to native code from the start.
This changes the tradeoffs:
- No performance tax for loops. You can write a naive algorithm and it will be fast enough for many workloads.
- No boundary between "Python code" and "C code." The same language handles high-level orchestration and low-level optimization.
- Just-in-time compilation. Functions are compiled on first use, so startup is slower but repeated calls are fast.
Julia's designers realized that data scientists write loops, not just high-level library calls. Making those loops fast without leaving the language is a real productivity win.
Multiple dispatch
Julia's signature feature is multiple dispatch: the language chooses which method to call based on the types of all arguments, not just the first one.
area(rectangle::Rectangle) = rectangle.width * rectangle.height
area(circle::Circle) = π * circle.radius^2
This makes code generic and extensible. You can add a new type with an area method without touching the original functions, and the language will route calls correctly. Python can do this with single dispatch and some metaprogramming, but Julia makes it the default and the fast path.
Multiple dispatch enables:
- Composable libraries. Different packages can extend the same functions without coordination.
- Generic algorithms. One implementation works on many types automatically.
- No inheritance hierarchies. You don't need to structure your types around a shared base class.
The ecosystem is growing
Julia is younger than Python, but its ecosystem has matured rapidly:
- DataFrames.jl — tabular data manipulation
- Flux.jl — machine learning with automatic differentiation
- DifferentialEquations.jl — solving ODEs and PDEs
- Makie.jl — plotting and visualization
- JuliaPy — calling Python from Julia
Each package benefits from Julia's performance and multiple dispatch. A plotting library can define methods for custom types without knowing them in advance, and a differential equation solver can accept any array-like type.
What Julia costs
The same design choices that make Julia fast create trade-offs:
- Compilation latency. The first call to a function triggers JIT compilation, which can be slow for complex functions. Warm runs are fast, but startup time is higher than interpreted languages.
- Package loading time. Julia packages can take time to precompile on first use, especially when using many dependencies.
- Smaller community. The ecosystem is growing but still smaller than Python's; fewer libraries and less Stack Overflow knowledge.
- 1-based indexing. Coming from Python or R requires adjusting mental models for array and string indexing.
None of this made Julia a bad choice — it made it a different choice, optimized for performance-first development without sacrificing the REPL experience.
Try it in Project Mars
Julia cells evaluate inside the MarsKernel module in a persistent session. The last expression of a cell is displayed via its MIME representations, display() publishes rich mime bundles, and readline() asks the kernel for input.
# Cells share the MarsKernel module; the last expression displays automatically.
sepal_lengths = [5.1, 4.9, 4.7, 4.6, 5.0]
sum(sepal_lengths) / length(sepal_lengths) # -> 4.86
# display() publishes MIME bundles; `ans` holds the last displayed value.
display("MarsKernel: hello from Julia")
ans
Where Project Mars fits
Project Mars does not ask you to choose Julia over Python. It supports both in the same notebook environment, so you can use the right tool for each cell. What Project Mars offers with Julia is:
- A persistent Julia subprocess with stateful execution
- Interactive
readline()for user input - MIME bundle output for rich rendering
- Variable inspection and diagnostics
- A notebook where the Julia code stays fast and readable
Julia is where Python's approach (dynamic, interpreted) meets C's performance (compiled, native speed). Project Mars is where that approach lives in a multi-language notebook with Rust, Python, R, and C++ alongside it.
Julia proved that data scientists want speed without leaving the REPL. Project Mars is for the workloads where that speed matters.