| Crates.io | seqlings |
| lib.rs | seqlings |
| version | 1.0.2 |
| created_at | 2026-01-23 22:53:39.508597+00 |
| updated_at | 2026-01-23 22:53:39.508597+00 |
| description | Interactive exercises for learning Seq, a stack-based programming language |
| homepage | |
| repository | https://github.com/navicore/seqlings |
| max_upload_size | |
| id | 2065604 |
| size | 416,911 |
Interactive exercises for learning Seq, a stack-based programming language.
Inspired by Rustlings, Seqlings guides you through Seq's concepts with hands-on exercises that you complete in your editor.
You need the Seq compiler (seqc) installed and available in your PATH.
See the patch-seq installation instructions for setup details.
git clone https://github.com/navicore/seqlings
cd seqlings
cargo run
This starts watch mode - Seqlings monitors your exercise files and provides instant feedback as you edit them.
Starting over: If you want to reset all exercises to their original state, run git checkout . from the seqlings directory.
# I AM NOT DONE marker when finished| Command | Description |
|---|---|
seqlings |
Start watch mode (default) |
seqlings list |
Show all exercises with completion status |
seqlings hint |
Get a hint for the current exercise |
seqlings hint <name> |
Get a hint for a specific exercise |
seqlings verify |
Check all exercises at once |
seqlings next |
Skip to the next exercise |
seqlings reset |
Reset current exercise to original state |
seqlings reset <name> |
Reset a specific exercise |
The exercises cover Seq from basics to advanced topics:
| Section | Topics |
|---|---|
| 00-intro | Hello world, comments, numbers |
| 01-stack-basics | push, dup, drop, swap, over, rot |
| 02-stack-advanced | nip, tuck, 2dup, pick, roll |
| 03-arithmetic | i.add, i.subtract, i.multiply, i.divide |
| 04-floats | Float literals and f.* operations |
| 05-comparison | =, <, >, <=, >=, <> |
| 06-boolean | and, or, not |
| 07-conditionals | if/then/else |
| 08-words | Defining words (functions) |
| 09-recursion | Recursive patterns, TCO |
| 10-quotations | Higher-order programming with [ ] |
| 11-types | Type system basics |
| 12-type-conversions | int->string, string->int, etc. |
| 13-strings | String operations |
| 14-variants | Union types and pattern matching |
| 15-lists | list.map, list.filter, list.fold |
| 16-maps | Key-value dictionaries |
| 19-io | Console I/O |
| 20-files | File operations |
| 21-args | Command-line arguments |
| 22-os | Environment and system info |
| 23-time | Timestamps and timing |
| 24-channels | CSP-style concurrency |
| 25-spawn | Green threads (strands) |
| 26-tcp | Network programming |
| 27-std-imath | Integer math stdlib |
| 28-std-fmath | Float math stdlib |
| 29-weave | Generator patterns with strands |
| 30-encoding | Base64, Hex encoding/decoding |
| 31-regex | Regular expressions |
| 32-compression | Gzip and Zstd compression |
| 33-crypto | SHA-256, HMAC, AES-GCM, Ed25519 |
| 34-http-client | HTTP requests and JSON APIs |
Seq is a stack-based, concatenative language. Values go on a stack, and words (functions) consume and produce stack values.
# Push values onto the stack
10 20
# i.+ pops two values, pushes their sum
i.+ # Stack: ( 30 )
# Define a word (function)
: square ( Int -- Int )
dup i.*
;
# Use it
5 square # Stack: ( 25 )
Stack manipulation:
dup # ( a -- a a ) Duplicate top
drop # ( a -- ) Discard top
swap # ( a b -- b a ) Exchange top two
over # ( a b -- a b a ) Copy second to top
rot # ( a b c -- b c a ) Rotate third to top
Quotations are deferred code blocks:
[ dup i.* ] # A quotation (not executed yet)
5 [ dup i.* ] call # Execute it: result is 25
Lists are created from strings:
"apple banana cherry" " " string.split # Creates a 3-element list
[ string.to-upper ] list.map # Transform each element
Unions define algebraic data types:
union Option { Some { value: Int }, None }
42 Make-Some # Create a Some variant
Make-None # Create a None variant
# Pattern match
my-option match
Some { >value } -> value
None -> 0
end
seqlings hint - When stuck, get a hintseqc repl)Found a bug or want to improve an exercise? PRs welcome!
If you find gaps in the Seq language itself, please open issues at patch-seq.
MIT