Keep writing Kalm
You built a CLI that reads a file, counts lines and whitespace-separated words, handles errors, and tests its core behavior.
Your final project contains these files:
src/main/kalm/stats/
App.kalm
Counting.kalm
Statistics.kalm
Summary.kalm
Input.kalm
src/test/kalm/stats/
StatisticsTests.kalmTry a small extension
Add a character count to Statistics and update summarize and its tests. Keep I/O separate from counting so your tests can use small in-memory inputs.
Pick your next topic
- Read the Handbook for deeper explanations.
- Try contracts and forwarding.
- Explore async functions and resource cleanup.
- Add Maven or Gradle to your project.
You built a single-file script that reads a file, counts lines and whitespace-separated words, and handles input errors. Your program lives in App.kalms and runs with kalm shell -f App.kalms.
Try a small extension
Add a character count to Statistics and update summarize. Keep input handling separate from counting so you can experiment with small in-memory values.
Move into project mode
Switch the navbar to Kalm to follow the project path, publish reusable APIs, accept command-line arguments, and add native tests.
- Read the Handbook.
- Explore async functions and resource cleanup.
- Return to the learning path.