Fork/Watch the development of the EK9 compiler on GitHub and for updates follow on twitter.
Click here for the Honda Civic EK9.
The EK9 Language
EK9 source is made available under the MIT opensource license.
Experienced developers will be probably thinking; "Show me the code; I'll be able to understand it and get going"; so there is a list of examples below.
Be aware there is some new syntax here that may look alien! You will need to give it time to grow on you, especially parameter passing. If you get stuck then look at sections structure, basics and then operators.
More about the language
The language has been designed for very young/inexperienced developers (age 10 or so) right the way through to experienced software engineers. It accomplishes this by providing a range of constructs from the very simple; right through to advanced design patterns (built into the language itself). Don't think just because it is aimed at very young developers it is a 'small toy language'. Review the examples below and you'll see it is far from that!
It has been designed to make easy things; 'easy' and harder things; 'structured and coherent'. This approach has been taken to facilitate EK9 language use right through a developers career.
Take a look in the introduction or the new starters section for the language rationale. Read the philosophy of EK9 if you want to understand why certain capabilities are or are not included.
Once you've reviewed the examples below and think this might suit you, dust off your favourite editor and follow these instructions below.
- Go to the EK9 repository and download the compiler for either MacOS, Linux or Windows (they are all free).
- There is a Textmate bundle that provides some highlighting depending on your preferred editor Eclipse and IntelliJ work quite well with his bundle.
- Unpack the EK9 compiler (zip, tar.gz or dmg) in a directory of your choice (but no spaces in directories)
- Make sure you have a version of Java installed (at least Java 15) - suggest using Azul
- Make sure the directory you unpacked EK9 in is on your PATH
- Make sure the bin directory you unpacked Java in is on your PATH
- Create a new directory somewhere (no spaces in path) and paste the contents of the Hello World example into a file called helloworld.ek9
- From a command line prompt; type ek9 helloworld.ek9
- If your installation went OK and all your PATH was setup, you will see "Hello, World"
- That's it you're on your way to using EK9 for development.
EK9 detects source files that need compiling and then runs the one specified. For more details on the compiler read EK9 command line.
Now the examples
The examples are embedded in the pages that discuss how to code in EK9; so read around the edges of the examples if any part of the syntax is unclear; they start simple but get quite involved and detailed quite quickly. If you get stuck or confused then look at some of the previous examples in the list.
Younger (or should I say less experienced) developers should start on the early examples, the examples towards the middle and the end use more advanced software techniques.
There are areas of general IT, like regular expressions and web services that you may need to familiarise yourself with; before looking at how they are used in EK9.
- 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
Whilst these example start of quite simply, they get progressively more abstract/sophisticated.
- Lists of 'things' and Lists of 'functions'
- Streaming Books Examples: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
- 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