About EK9
EK9 Language Development
Follow the EK9 Blog for updates on the design and implementation of EK9. For a look at the compiler's internals, see the Javadoc; it is work in progress, but it shows how the compiler is structured.
The EK9 Language Itself
If you come from Java, C#, Python, Javascript, Scala or Kotlin, you will pick up EK9 quickly. It takes many ideas from those languages and adds new ones.
The EK9 compiler and runtime are proprietary software; the text of this site and every example on it are CC0 1.0. See the license for details.
Experienced developers will be thinking "Show me the code; I'll understand it and get going", so there is a list of examples below.
Some of the syntax may look alien, especially parameter passing; give it time. If you get stuck, read structure, basics and then operators.
More about the language
EK9 is designed so that inexperienced developers can get started, with features for experienced software engineers, and it is designed with AI in mind. Its constructs range from the very simple to advanced design patterns built into the language.
The language is 'semantically consistent': an idea that applies in one area applies in a similar or exact way in others. For example, operators such as '+', '-', '*', '/' and '$' (to string) can be used polymorphically on any user-defined type. That is like C++, but EK9 adds strict semantics that limit mutation and misuse inside those operators. The same constraints apply to human developers and AI tools alike, which stops inappropriate use and keeps the language consistent.
Easy things are 'easy', and harder things are 'structured and coherent'. EK9 is meant to serve a developer for a whole career, not only as a teaching language.
Software design rules are built in: complexity, nesting, and function and method parameters. Code that breaks them does not compile. See quality, testing, coverage and profiling.
The layout and syntax are designed for visual flow and structure. They take ideas from existing languages and from 'cognitive research' on how people read text.
For the rationale behind the language, read the introduction or its new starters section. The philosophy of EK9 explains why some capabilities are included and others are not.
Downloads
Once you have looked at the examples below and think EK9 might suit you, install it:
- Download the compiler for macOS, Linux or Windows from the EK9 repository.
- Unpack it (zip, tar.gz or dmg) in a directory of your choice, with no spaces in the path.
- Install Java 25 or later; Azul and Graalvm both work. Put Java's bin directory on your PATH.
- Put the directory you unpacked EK9 in on your PATH, and set the environment variable EK9_HOME to the same directory.
- Create a new directory (no spaces in the path) and paste the Hello World example into a file called helloworld.ek9.
- At a command line prompt, type ek9 helloworld.ek9.
- If your installation and PATH are right, you will see "Hello, World". You're on your way.
EK9 finds the source files that need compiling, then runs the one you name. For more, read the EK9 command line page.
For editing:
- The EK9 IDE (
ek9 -ide). - A VS Code extension with syntax highlighting and language server support.
- An IntelliJ plugin with syntax highlighting,
language server support and debugging (
ek9 -lsandek9 -dap, through LSP4IJ). - A Textmate bundle that gives highlighting in editors that read it, such as Eclipse.
If you are interested in the compiler internals, there is Javadoc available.
Now the examples
The examples are part of these pages, with the explanation around them; if some syntax is unclear, read the text around the example. They start simple and become involved quickly. If you get stuck, go back to the earlier examples in the list.
- Less experienced developers: start with the early examples. The middle and later ones use more advanced techniques.
- All readers: some examples use general IT areas, such as regular expressions and web services, that you may need to learn first.
Basic examples
- Hello, World
- Declaration of Constants and an Enumerated Type
- Hello, World (and Mars)
- Working with Strings, Regular Expressions, Time, Dates, DateTime, Money, Locales, Colour, Dimensions
- Records (like a C struct) and Merging example
- Functions and Pure Functions
- Classes (similar to Java, C++, C#)
- Using a Dynamic Class as a 'tuple'
- Simple Classes/Function Delegate
- Traits (similar Java interfaces or Scala traits)
- Generic/Template Functions and Classes (more like C++/C# than Java)
- Components and Applications (a bit like Java Spring)
- Text (similar to Java properties with String interpolation)
- REST Service
Detailed examples
These start simply and become progressively more abstract.
- Lists of 'things' and Lists of 'functions'
- Streaming Books Examples: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Optional items
- Priority Queues
- Dictionaries (like a Java Map)
- Enumerations/Simple Type
- Records with Operators
- Mutex Lock/Key
- Different aspects of traits
- Using traits for composition
- Dynamic classes with composition
- Exceptions and Dispatcher
- Design Patterns Library
- Design Patterns Library Client
Fully worked examples
- CLI program requirement: the program, functions, classes, and the record.
- Strong typing and abstraction with components and reworked composition (long)
- UDP (Datagrams) programs: Server(1), Server(2), Client(1) and Client(2)
- TCP (Sockets) programs: Server(1), Server(2), Client(1) and Client(2)
Every example on these pages is compiled by the EK9 compiler, and every one that declares its output is run and checked against it. They are public domain (CC0 1.0). Download one from under the example, or all of them, with the Q&A and the error catalogue's sources, as ek9-examples.zip. The same material is in data/ as data files.