Skip to content

Wyn vs Go

Wyn and Go solve similar problems - compiled languages for backend services, CLI tools, and systems programming. Both produce native binaries, both have built-in concurrency, and both compile fast. Here's where they differ.

Quick Facts

WynGo
First release20252009
Compiles toC (then native binary)Native binary
Memory managementARC (no GC pauses)Garbage collector
Hello world binary50KB2.4MB
Concurrency modelspawn/await + channelsgoroutines + channels
Package managerwyn pkggo mod
GenericsYes (monomorphization)Yes (since 1.18)
Pattern matchingYes (match expressions)No (switch only)

Benchmark Comparison

All benchmarks re-measured for Wyn 1.21.0 - the published release tarball, built with --release - against Go 1.26.5 (go build), on Apple M3 Pro (6 performance + 6 efficiency cores), macOS 26, in one session on one machine. Process-level rows are wall-clock for the whole process, so a ~7ms startup floor is included in both languages' rows; sort rows time the sort() call itself and both languages were fed byte-identical input (verified by comparing the sorted output).

BenchmarkWynGo 1.26
fib(35) recursive41.6ms48.2ms
Sort 100K ints (call only)6.3ms7.0ms
Sort 1M ints (call only)73ms83ms
Hello world startup6.9ms7.8ms
Hello world peak RSS1.4MB3.9MB
Spawn 10K tasks (sequential await)24.5ms / 3.0MB RSS13.9ms / 5.8MB RSS
Spawn 1M tasks (fire-and-forget)0.69s / 84MB RSS0.28s / 21MB RSS
Hello world binary50KB2,492KB
Compile time (hello, forced rebuild)356ms189ms

Honest split decision. Wyn wins on binary size (~50x smaller), startup, resident memory for a trivial process, and both compute benchmarks. Go wins on compile speed and - decisively - concurrency at scale: goroutines are both faster to create and ~4x denser in memory than Wyn's coroutines at 1M outstanding tasks, and the Go harness waits for every goroutine to finish where Wyn's only dispatches, which makes that row conservative in Go's favour. If your workload is massive fan-out, Go's scheduler is still the better tool.

Two rows changed direction since the previous edition of this page, and the reasons are methodology rather than either compiler:

  • Sort. This page used to report Go winning the 1M sort (101ms vs 124ms). Those Wyn figures came from a dev build compared against go build, which optimises by default. Optimised-vs-optimised, Wyn is ~12% ahead. A Wyn dev build really is slower here - 110ms - which is worth knowing but is not the comparison this page claims to make.
  • Compile time. The old 96ms for go build was a no-op: go build skips the link when the output binary is already present and current, and the benchmark rebuilt in place. Deleting the output first, as Wyn's number always did, gives 189ms. Go is still about 1.9x faster to build hello world - just not 3.7x.

Note: CPU benchmark differences reflect the C compiler (clang -O3 on --release) vs Go's compiler, not Wyn-specific optimizations.

Syntax Comparison

Structs and Methods

Go puts methods outside the struct definition. Wyn puts them inside, like Python classes.

go
// Go
type User struct {
    Name string
    Age  int
}

func (u User) IsAdult() bool {
    return u.Age >= 18
}
wyn
// Wyn
struct User {
    name: string
    age: int

    fn is_adult(self) -> bool {
        return self.age >= 18
    }
}

Error Handling

Go uses multiple return values and if err != nil. Wyn uses Result types with pattern matching.

go
// Go
result, err := divide(10, 0)
if err != nil {
    log.Fatal(err)
}
fmt.Println(result)
wyn
// Wyn
match divide(10, 0) {
    Ok(v) => print(v.to_string())
    Err(e) => print("error: " + e)
}

Concurrency

Both languages have lightweight concurrency. Go uses goroutines, Wyn uses spawn/await.

go
// Go
ch := make(chan int)
go func() {
    ch <- fib(38)
}()
result := <-ch
wyn
// Wyn
var f = spawn fib(38)
var result = await f

Wyn's spawn/await returns a typed future - no channel boilerplate for simple parallel work. Both scale linearly on multiple cores.

Function composition

Neither language has a pipe operator - both compose with nested calls (or intermediate variables for readability):

wyn
// Wyn
var result = serialize(transform(validate(parse(data))))
go
// Go - nested calls
result := serialize(transform(validate(parse(data))))

When to Choose Wyn

  • You want tiny binaries (50KB vs 2.4MB) for containers or embedded deployment
  • You want no GC pauses - Wyn's ARC is deterministic
  • You prefer methods inside structs instead of separate receiver functions
  • You want pattern matching and expression-oriented control flow
  • You want a batteries-included stdlib with HTTP, SQLite, JSON, bcrypt, and GUI built in
  • You're building CLI tools, web APIs, or data processing pipelines

When to Choose Go

  • You need a mature ecosystem with thousands of production-tested libraries
  • You need enterprise support and a large hiring pool
  • You're building large-scale distributed systems where Go's tooling shines
  • You need proven production stability at companies like Google, Uber, and Cloudflare

Feature-by-Feature

FeatureWynGo
Native binary
No GC✓ (ARC)✗ (GC)
Sub-second compile
Methods in struct body
List comprehensions
Pattern matching
Built-in HTTP server✓ (net/http)
Built-in SQLite✗ (third-party)
Generators (yield)
Cross-compilation✓ (5 targets)✓ (many targets)
REPL

Try Wyn

Install Wyn in one command and build your first binary:

sh
curl -fsSL https://wynlang.com/install.sh | sh
wyn run hello.wyn

The install takes about 10 seconds. Your first wyn run compiles and executes in about 330ms. No GOPATH, no go.mod - just write a .wyn file and run it.

See Also

MIT License - v1.21.0