[ANN] Swirl.jl - Interactive Julia Learning in the REPL 
Hi everyone! ![]()
I’m really happy to introduce Swirl.jl, an interactive platform that teaches Julia programming right inside the REPL. It’s inspired by the excellent swirl package for R, which has helped thousands of people get started with R programming.
Why Swirl.jl?
When I was learning R, swirl made the experience engaging and accessible; you could learn by doing, right in your console, with immediate feedback. I wanted to bring that same experience to Julia.
swirl for R has been a tremendous success in lowering the barrier to entry for R learners and I hope Swirl.jl can play a similar role in helping more people adopt Julia.
What is Swirl.jl?
Swirl.jl is an interactive tutorial system that runs entirely in the REPL and there are no external tools needed. You type Julia code, get instant feedback, and learn by doing.
After trying it out, feel free to give it a
on GitHub!
Quick Demo
julia> using Swirl
julia> swirl()
============================================================
| Welcome to Swirl for Julia! 🌀
============================================================
Available courses:
1. Julia Basics
Select a course: 1
Lessons in Julia Basics:
1. [ ] Basic Math and Variables
2. [ ] Types and Functions
3. [ ] Vectors and Arrays
Select a lesson: 1
--- Question 1 of 7 ---
Let's begin! Julia can be used as a calculator. Try adding 5 + 3.
julia> 5 + 3
8
✓ Correct!
--- Question 2 of 7 ---
Now try multiplication. What is 7 * 6?
julia> hint
💡 Hint: In Julia, multiplication uses the asterisk symbol: *
Type: 7 * 6
julia> 7 * 6
42
✓ Correct!
How It Works
Everything happens in the REPL:
- Real Code Execution: Your code runs in the actual
Mainmodule, so variables persist between questions and you can use any Julia features or packages - Intelligent Evaluation: The system evaluates your expressions and checks if they produce the expected result, not just exact string matching
- Natural Interaction: You can explore and experiment - multi-step questions work naturally. For example, you can enter multiple commands on a single line by separating them with
;(e.g., define a variable and then use it in the same line). - Smart Hints: When you type
hint, you get detailed -and hopefully educational- explanations, not just “type this.” - Auto-Save Progress: Your progress is automatically saved after each question, so you can stop and resume anytime even after ending the current REPL session.
Technical Details
Under the hood:
- Questions are evaluated using
Core.eval(Main, ...)so your code runs in the same environment as your REPL - The parser handles multi-statement code (semicolon-separated) and checks only the final result
- Progress is serialized to
~/.swirl_julia/progress/for persistence - The system supports different question types: messages, code evaluation, and multiple choice
Features
Interactive Learning - Type real Julia code, get immediate feedback
Structured Lessons - Work through well-designed courses
Auto-Save Progress - Never lose your place
Smart Hints - Detailed help when you’re stuck
Multiple Question Types - Mix of explanations, code, and quizzes
Custom Courses - Install courses from GitHub, URLs, or local directories
Flexible Navigation - Easy menus with back/exit commands
Progress Management - Reset and retake lessons anytime
Current Status
The package includes a Julia Basics course covering:
- Basic Math and Variables
- Types and Functions
- Vectors and Arrays
Call for Contributors!
This is where I need your help!
The current course is quite minimal, just 3 lessons with a handful of questions each to demonstrate the system. The current built-in course is quite basic, just enough to showcase what the system can do. It would be exciting to see the Julia community help expand it into something comprehensive for Julia beginners. Even adding a few more questions to existing lessons or creating new lessons on basic topics would be incredibly valuable!
Each lesson (should) include(s) carefully crafted questions with detailed, educational hints.
Immediate needs:
- More questions for the existing Julia Basics lessons
- New lessons on basic Julia topics (e.g., loops, conditionals, strings, dictionaries, etc.)
- Better coverage of fundamental concepts (e.g., types and type composition)
- More diverse examples and exercises
Longer-term vision:
Besides adding new lessons to the Julia Basics course, Swirl.jl can also host new, independent courses. Imagine having new courses on:
- Julia for Python/R/MATLAB users
- DataFrames.jl and data wrangling
- Plotting (Plots.jl, Makie.jl)
- Statistics and machine learning
- Package development
How to Contribute
The system is designed to make course creation straightforward. A course is just a Julia file that organizes lessons, each made up of individual questions:
Course(
"Course Name",
"Description",
[
Lesson("Lesson 1", "Learn X", [
Question("Try 1+1", :code, 2, "Type: 1+1"),
# ... more questions
])
]
)
I’ve included templates for creating courses and lessons in the repository to help you get started. You can:
- Create entirely new courses
- Expand the existing Julia Basics course
- Improve hints and questions
- Add advanced topics
Installation
using Pkg
Pkg.add(url="https://github.com/atantos/Swirl.jl")
Then just:
using Swirl
swirl()
Learn More
GitHub Repository: github.com/atantos/Swirl.jl
README: Full documentation and examples
Why This Matters
Learning programming should be interactive and engaging. Just as swirl helped make R more accessible, I hope Swirl.jl can help more people discover and learn Julia.
The REPL is Julia’s superpower. It’s fast, interactive and it’s where we do our work. Why not make it a powerful learning environment too?
A personal motivation: I’m particularly interested in helping people from the Humanities learn Julia. Interactive tools like Swirl.jl can help them build confidence with the language and then, hopefully, discover powerful packages for their work such as the recently created TextAssociations.jl package for calculating n-gram associations in texts/corpora, which will be submitted to the Julia registry soon. Making Julia accessible is essential for expanding its adoption in the Humanities and the Social Sciences, especially among people with non-traditional programming backgrounds.
A note on development: Swirl.jl was developed with significant assistance from Claude 4.5, which made the development process incredibly productive.
TL;DR: Interactive Julia tutorials in your REPL, inspired by R’s swirl. Currently includes one short course (Julia Basics) and welcomes community contributions to expand content and help more people learn Julia!


