Showcase
Real applications built with Wyn - proving the "1 language for everything" claim.
wyn-grep - File Search Tool
Fast recursive file search with regex patterns and colored output. ~90 lines of Wyn.
wyn
fn grep_file(path: string, pattern: string, show_ln: int) {
content = File.read(path)
line_num = 0
line_start = 0
for i in 0..content.len() {
if content[i] == "\n" {
line = content.substring(line_start, i)
line_num = line_num + 1
if Regex.match(line, pattern) {
print(path + ":" + line_num.to_string() + ":" + line)
}
line_start = i + 1
}
}
}bash
$ wyn-grep "spawn" sample-apps -n
sample-apps/web/server/main.wyn:123: spawn handle_request(...)
sample-apps/sysadmin/portscanner/main.wyn:54: spawn scan_port(...)Web Server - Zero Dependencies
A full web server with routing, templates, SQLite, and concurrent request handling. No npm install. No pip install. Just wyn run server.wyn.
wyn
fn handle(req: string, db: int) {
// route and respond (elided)
}
fn main() {
Web.get("/", 1)
Web.post("/api/users", 2)
Web.templates("templates")
db = Db.open("app.db")
server = Http.serve(8080)
while true {
req = Http.accept(server)
spawn handle(req, db) // concurrent
}
}Snake - Terminal Game
Playable Snake game in the terminal. Random food placement, collision detection, score tracking. ~110 lines.
Port Scanner - Concurrent I/O
Scans 11 ports concurrently using spawn. Finishes in ~1 second instead of ~11.
wyn
for i in 0..11 {
spawn scan_port(host, ports[i], results, i)
}System Monitor - sysmon
Full terminal dashboard with CPU, memory, disk, and process monitoring. Real-time updates with keyboard navigation.
All source code is in the sample-apps directory.
See Also
- Benchmarks - performance numbers
- FAQ - common questions