Wyn v1.11: The Developer Experience Release
v1.11 is about making developers productive in their first hour. Better error messages, new syntax sugar, and tooling that works from any directory.
enum.to_string() Returns the Name
The most-requested fix. Previously, Color.Red.to_string() returned "0". Now it returns "Red".
enum Status { Active, Inactive, Pending }
var s = Status.Active
println(s.to_string()) // "Active"Every enum gets a generated string table at compile time. Zero runtime cost for enums you don't call .to_string() on.
Indexed Iteration
Python has enumerate(). Go has for i, v := range. Now Wyn has:
var fruits = ["apple", "banana", "cherry"]
for i, v in fruits {
println(i.to_string() + ": " + v)
}
// 0: apple
// 1: banana
// 2: cherryWorks with any array. The index variable is always int.
String Repeat Operator
println("ha" * 3) // "hahaha"
println("-" * 40) // separator line
println("=" * 40)
println(" Report Title")
println("=" * 40)Simple, readable, no method call needed.
Optional Type Syntax
int? is sugar for OptionInt:
var x: int? = OptionInt_Some(42)
var y: int? = OptionInt_None()
println(OptionInt_unwrap_or(y, 0).to_string()) // 0Missing Return is Now an Error
This was a silent bug factory. In v1.10:
fn get_value() -> int {
// Warning: may not return a value
// Compiles! Returns garbage at runtime.
}In v1.11, this is a compile error. No more silent garbage values.
Type Errors from Wyn, Not C
var x: int = "hello"v1.10 showed a cryptic C compiler error. v1.11 shows:
Error: Type mismatch at line 1
Expected: int (integer)
Got: string (text string)
Suggestion: use .to_int() to parse the stringStatic Constructors Work
struct Point { x: int, y: int }
impl Point {
fn new(x: int, y: int) -> Point {
return Point { x: x, y: y }
}
}
var p = Point.new(3, 4) // Just worksPreviously this generated broken C code. Now the compiler correctly detects static vs instance methods.
Tooling
wyn build shows size and time:
✓ Built: myapp (49KB, 362ms)wyn test works from any directory:
cd my-project
wyn test # finds tests/ and runs themwyn fmt --check for CI:
wyn fmt src/ --check # exit 1 if unformattedBetter error for missing packages:
Error: Package 'redis' not installed
Run: wyn pkg install redisTyped Arrays
var arr: [int] = [] now uses a specialized WynIntArray with raw long long* storage — no type tags, no boxing. Sum of 1M ints is 2x faster than v1.10.
Upgrading
curl -fsSL https://wynlang.com/install.sh | shNo breaking changes except:
- Functions with missing returns now fail to compile (add the missing
return) enum.to_string()returns the variant name instead of the integer value