How to use this book
There are three books in the EK9 set, and this is the first.
Getting Started with EK9, the book you are reading, teaches the language by building small programs. It assumes no prior experience. If you have written code before, some parts will be familiar and you can move quickly; if you have not, every idea is introduced in plain words and then shown running.
EK9 in Depth, the second volume, goes under the surface: how the mechanisms work, how to build larger applications, and the ideas the language rests on. Read it after this one.
Together, those two volumes teach the language. The third book, The EK9 IDE and Refactoring Toolset, is a separate companion that covers the EK9 development environment and its tools in full. This book recommends the IDE and shows a few pictures of it, but it teaches the language by hand, so that you understand what those tools do for you. You do not need the companion book to follow this one.
How the chapters work
Each chapter builds one or more small programs. Every example was compiled and run before
printing, and the output shown is the real output. You can download all the examples as one
archive (examples.zip) and open them in the IDE to change and re-run them. Changing a working
program and seeing what happens is the best way to learn. The examples are yours to use as you
like: they are public domain (CC0 1.0), as the copyright page sets out.
Read the chapters in order the first time. Each assumes the ones before it.
Conventions
- Chapters refer to one another by title, such as Functions or Guards and Safe Code.
- Code looks
like this. A complete program starts with the line#!ek9. - A Try it box suggests a small change to make and re-run.
- Where a rule exists because of a real, hard-won lesson, a footnote points to the evidence appendix, The Evidence: the research behind the rules, which gathers the research and the well-known bugs behind the rules. You can hand any of those papers to an AI and ask it to summarise them.
- Compiler messages are copied exactly as the compiler prints them; long lines wrap on the page.
An error block shows the
Errorline and the lines under it (See:and sometimesforAI:); the lines around them, which say the build failed and name the file, are left out. Reading the Compiler's Guidance shows one message in full.
Getting set up
The smoothest start is the EK9 IDE: it bundles the editor, the compiler and built-in help in one place. The Installing and Running EK9 appendix lists the install steps, Hello, EK9 takes you through your first program, and the complete tour of the environment is in the companion book.