Swim sets,
written as code.
A language for swim training, parsed by Rascal. Edit a lane, then race it.
Take your marks.
Desktop and web, today
Rascal- Kotlin
- Compose
- Java
- Node.js
- Gemini
Read a set
8×100 free fast @1:30
8 x swim 100 m freestyle
hard pace 75 rest 15 s
interval(8,
swim(100, freestyle(),
hard(), 75),
15)
- Distance
- 800 m
- Swimming
- 10:00
- Rest
- 1:45
- Send-off
- 1:30
Build a session
easy moderate hard kick or drillDrag the red line
At the wall
0 / 0 m 0:00
- Distance
- 0 m
- Swimming
- 0:00
- Rest
- 0:00
- Session
- 0:00
Agents
Three Gemini agents in the desktop app. Nothing they write is used until Rascal parses it.
Plain English in, SwimmingDSL out. Parse errors go back to the model, up to three attempts.
- Request
Easy 400 to warm up, then eight hard 100s on 1:15 with 15 seconds rest, 200 easy to finish.
- Attempt 1
session tuesday { swim 400 m easy 8 x swim 100 m freestyle hard pace 75 rest 15 s swim 200 m freestyle easy }Parse error at line 3, column 2
- Attempt 2
session tuesday { swim 400 m freestyle easy 8 x swim 100 m freestyle hard pace 75 rest 15 s swim 200 m freestyle easy }Parsed: 1,400 m
A chat about the session in the editor. Every message carries the Rascal analysis, so advice starts from measured numbers.
--- CURRENT SESSION ANALYSIS ---
Total distance: 1400 m (1.40 km)
Sessions: 1
Styles: {freestyle: 3}
Intensities: {easy: 2, hard: 1}
Rest: 1 period, average 15 s
--- CURRENT DSL CODE ---
session tuesday {
swim 400 m freestyle easy
…
Multi-week plans, +7% distance a week. Each session is parsed; failures fall back to Rascal's own generator.
Run it
Java 17+. The agents need a Gemini API key.
git clone https://github.com/Carlixgonzam/swimmingdsl
cd swimmingdsl/kotlin-app
export GEMINI_API_KEY="your_key"
./gradlew run
Web server setup: WEB_SERVER_SETUP.md