How the compiler works
The compiler is at the center of the Elements toolchain. It takes the source files in a project and generates code for the platform you’re building for. That can mean managed assemblies for .NET, bytecode for Java or Android, native object files for the linker, or WebAssembly.
Elements separates the parts of the compiler that understand source languages from the parts that understand target platforms. This lets the same language front end work with different back ends, and lets a single project bring several languages together.
Front ends read your source files
Elements has a front end for each of its eight languages. The compiler picks one by file extension, so a project can contain Oxygene .pas files, C# .cs files, Swift .swift files, or any other Elements language the target supports.
A front end understands its language’s syntax and turns the source into the compiler’s internal form. Elements can also process XAML markup as part of applicable .NET projects.
The compiler combines the source files into one language-independent code tree. Types and members from different languages are visible to one another in that tree. An Oxygene class can call a C# method or inherit from a Swift class in the same project, without a separate build or a foreign-language bridge.
Back ends generate code for the target
Each target within a project selects one back end. It receives the shared code tree and generates the output for that target, regardless of which front end read each file. In a project with multiple targets, each target can select its own back end and use the source files and references appropriate to that platform.
Echoes
Generates .NET intermediate language (IL). The resulting assemblies can use .NET libraries and run on a compatible .NET runtime.
Read More
Toffee
Compiles native code for Apple platforms using Cocoa frameworks and the Objective-C runtime.
Read More
Cooper
Generates JVM bytecode. Java projects run on the JVM, and Android builds process the bytecode for the Android runtime.
Read More
Island
Compiles CPU-native code for targets such as Windows, Linux, and Darwin. For browser projects, it emits WebAssembly.
Read MoreFrom source to a deliverable
EBuild prepares the project for compilation by selecting the SDK and resolving references. After compilation, it runs the steps needed for that target, such as linking native object files into an executable, processing resources, or packaging an app bundle.
See the compiler documentation for options and command-line usage.