Wyn v1.16: The Batteries Release
Every young language faces the same wall: the ecosystem. You can have the cleanest syntax in the world, but if there's no HTTP client, no crypto, no image codec, no database driver, nobody can ship. v1.16 takes the first real step past that wall — not by reinventing decades of libraries, but by reaching the ones that already exist. Wyn compiles to C; C has the libraries; so Wyn should be able to call them. Now it can.
Everything here is backward compatible — no source changes are required to upgrade.
A C FFI that actually works
extern fn has been in the language for a while, but it was a stub — the type mapping was int/string only, and there was no way to link the library that provided the symbol. Both are fixed.
extern fn sqrt(x: float) -> float;
extern fn pow(base: float, exp: float) -> float;
fn main() {
println("${sqrt(16.0)}") // 4.0
println("${pow(2.0, 10.0)}") // 1024.0
}int, float, bool, string, and void all map to the correct C types. The math library is linked by default, so this runs as-is.
Linking any C library
To reach beyond libc, declare what to link in wyn.toml:
[ffi]
libs = "curl, z"
lib_dirs = "/usr/local/lib"
include_dirs = "/usr/local/include"The compiler threads the right -l/-L/-I flags into the build and links your program against those libraries — no makefile, no manual gcc invocation. (For safety, any [ffi] value with shell metacharacters is rejected outright.)
This is phase one. The type mapping and manual linking here are the foundation; automatic binding generation from C headers and a package-manager experience for grabbing C libraries are what comes next. But the important thing lands today: the C ecosystem is no longer on the other side of a wall.
Pythonic sugar
Two smaller quality-of-life additions.
range(a, b, step) — Python-style ranges in for loops, alongside the existing a..b:
for i in range(0, 10, 2) { … } // 0 2 4 6 8
for i in range(10, 0, -1) { … } // 10 9 8 … 1if let — bind and test one Option/Result case inline, no full match:
if let Some(v) = find(key) {
println("found ${v}")
} else {
println("missing")
}Upgrading
wyn --version # 1.16.0No source changes are required. v1.16.0 is a drop-in upgrade over v1.15.0.
Read the full what's new in v1.16, or browse the version history.