Hydrogen language guide · Request a feature
Hydrogen, also called Hylang, is a self-hosted, C#-inspired language for programs built around namespaces, classes, and methods. It uses .hy sources and .hyproj manifests. The released compiler is written in Hydrogen and is the compiler used to build Hydrogen programs and the Australis OS proof of concept.
Start here
- Install the released compiler.
- Learn the current supported surface.
- Write and run your first program.
- Build with Hydrogen, including executable projects and contributor rebuilds.
- Compile an executable or organize a project.
- Make a bootable UEFI Hello World, the current firmware proof of concept.
public class Program {
public static int Main(string[] args) {
System.Console.WriteLine("Hello, Hydrogen!");
return 0;
}
}
The release runs on Linux x86-64 and emits standalone Linux x86-64 ELF executables. Its uefi-x64 target also emits a PE32+ EFI application, currently a deliberately small firmware proof: a Main method can write ASCII string literals with System.Console.WriteLine through the UEFI console. It is not yet a general UEFI runtime or standard library.
Australis OS and native Australis applications are Hydrogen's primary direction. Linux is the current development host and application target; Windows and macOS support are planned ports. See the roadmap for the order of work, or request a feature.
Learn the language
Read program structure, methods and objects, types and strings, arrays, and control flow. Code fragments on reference pages belong inside the class or method described there unless shown as complete programs.
Use the builtin API reference for console, files, conversion, and memory services. Runtime behavior is described in the runtime guide.
Work with tools
The Hydrogen compiler checks and compiles sources and executable projects. Project manifests describe source files and references.
Architecture notes and the roadmap are separate from the language and usage guides.