Skip to content

Preface

After twenty years of software engineering, I found myself switching between five different languages every single day. Python for scripting. JavaScript for web frontends. Go for microservices. C++ for performance-critical code. Bash for automation. Each context switch meant relearning syntax, fighting different toolchains, and mentally translating between languages.

I kept asking: why do we accept this? Why can't one language be simple enough for scripts, fast enough for systems programming, and expressive enough for complex applications?

So I built Wyn.

This book exists because Wyn represents a different philosophy: simplicity and power aren't opposites. You shouldn't have to choose between writing code quickly and writing code that runs fast. You shouldn't need a PhD to build reliable systems. And you definitely shouldn't need a different language for every problem domain.

Who Should Read This

If you've written code before, you're in the right place. Maybe you're:

  • Tired of switching between languages for different parts of your stack
  • Coming from Python and hitting performance walls
  • A C/C++ veteran who wants safety without complexity
  • Curious about Rust but intimidated by the learning curve
  • Building systems that need to be fast and maintainable
  • Looking for one language that can truly do everything

I'm assuming you understand variables, functions, and loops. I'm not assuming you know what a borrow checker is or why monads matter. We'll get to the interesting stuff quickly.

Why Wyn Exists

Every language makes tradeoffs. Python chose simplicity over speed. C chose control over safety. Rust chose correctness over ease. These aren't wrong choices-they're deliberate ones.

Wyn rejects the premise. It starts with a radical observation: most language complexity is accidental, not essential. You don't need Rust's borrow checker to write safe code. You don't need Python's slow interpreter to have clean syntax. You don't need C's manual memory management to get native performance.

Wyn achieves this through three core principles:

1. Uniform Method Syntax
Everything is an object with methods. No special cases, no exceptions:

wyn
// In C, you pass things to functions
strlen(text);
abs(number);

// In Wyn, objects have methods
text.len()
number.abs()

This isn't just syntax sugar. When you type text. in your editor, you see every operation that string supports. No documentation hunting. No guessing. The API is discoverable.

But here's the thing: this compiles to the same machine code as the C version. Zero overhead. The elegance doesn't cost you anything.

2. Automatic Memory Management Without Garbage Collection
Wyn uses deterministic, automatic reference counting. You get memory freed the moment it goes out of scope, with the predictability of manual management. No pause times. No tuning. One rule to know: reference cycles are not collected - don't build self-referential object graphs (the compiler rejects recursive struct fields for exactly this reason).

3. Native Compilation Everywhere
One codebase compiles to native binaries on Linux, macOS, and Windows. No runtime. No VM. No interpreter. Just fast, portable machine code.

The result? A language that's as easy to write as Python, dramatically faster than interpreted languages (compiled, native, no interpreter overhead), and ships as a single small binary.

What Makes This Book Different

I'm not going to waste your time with toy examples. Every piece of code in this book either:

  1. Solves a real problem I've encountered
  2. Demonstrates a pattern you'll use in production
  3. Shows you how to avoid a mistake I've made

When we talk about error handling, we'll build a config parser that actually handles errors. When we cover concurrency, we'll write a web scraper that processes pages in parallel. When we discuss memory management, we'll profile real programs and fix real bottlenecks.

You'll also find things most language books skip:

  • Why decisions were made, not just what the syntax is
  • When to use features, not just how they work
  • What can go wrong, based on actual production experience
  • Performance implications of different approaches
  • Migration strategies from other languages

How to Use This Book

If you're new to systems programming: Read straight through. The chapters build on each other deliberately. Do the exercises-they're not busywork, they're designed to catch common misconceptions before they become habits.

If you're experienced: Skim Part I, but don't skip it entirely. Wyn's object model is different enough that assumptions from other languages will trip you up. Focus on Parts II and III, where we get into the interesting stuff.

If you're evaluating Wyn for a project: Read Chapters 1, 6, 7, 12, and 15. That'll give you the flavor of the language and show you what production code looks like.

A Note on Examples

Every example in this book compiles and runs. I've tested them all against Wyn 1.19. When you see code, you can copy it, run it, and experiment with it.

I've also made a deliberate choice: examples are complete, not fragments. You won't see:

wyn
// ... some code ...
do_something()
// ... more code ...

You'll see the whole program. Yes, this makes examples longer. It also means you can actually run them and understand the context.

What You'll Build

By the end of this book, you'll have written:

  • A command-line tool that processes files in parallel
  • A web server that handles JSON APIs
  • A concurrent system monitor
  • A REST client with proper error handling
  • Several smaller utilities that demonstrate specific techniques

More importantly, you'll understand why the code is structured the way it is. You'll know what tradeoffs you're making and when to make different ones.

Acknowledgments

This book wouldn't exist without the Wyn community. Special thanks to the early readers who caught my mistakes before they made it to print.

Thanks also to the authors of "The C Programming Language," "Programming in Lua," and "The Rust Programming Language"-books that proved technical writing can be both precise and readable.

About the Author

Andrew Odendaal spent more than 20 years as a software engineer, building systems in C++, Python, Go, Java, JavaScript, and more. After two decades of switching between five languages every single day, he created Wyn to prove that simplicity and power aren't opposites-they're design choices.

Let's Begin

Systems programming doesn't have to be painful. It doesn't require a PhD or years of experience. It just requires understanding the fundamentals and knowing how to apply them.

Wyn gives you the tools. This book shows you how to use them.

Let's build something.


Note: This book covers Wyn 1.19. The language is stable, but features may evolve. Check the official documentation for the latest updates.

MIT License - v1.19.1