Mach is an open source programming language created in 2022 by Ethan Reynolds.
| #1386on PLDB | 4Years Old |
git clone https://github.com/briar-systems/machMach is a small, explicit, self-hosted systems programming language for compilers, kernels, runtimes and games, with no hidden control flow, no hidden allocation and no type inference.
use std.print;
use std.runtime;
fun fibonacci(n: u64) u64 {
var a: u64 = 0;
var b: u64 = 1;
var i: u64 = 0;
for (i < n) {
val t: u64 = b;
b = a + b;
a = t;
i = i + 1;
}
ret a;
}
#[symbol("main")]
fun main(argc: i64, argv: **u8) i64 {
print.printlnf("fib(10) = {}", fibonacci(10));
ret 0;
}| Feature | Supported | Example | Token |
|---|---|---|---|
| canReadCommandLineArgs | ✓ | ||
| Standard Library | ✓ | ||
| hasEscapeCharacters | ✓ | ||
| Strings | ✓ | ||
| Octals | ✓ | ||
| Binary Literals | ✓ | ||
| Hexadecimals | ✓ | ||
| Floats | ✓ | ||
| Integers | ✓ | ||
| Module Pattern | ✓ | ||
| File Imports | ✓ | ||
| Conditionals | ✓ | ||
| Functions | ✓ | ||
| Pointers | ✓ | ||
| Access Modifiers | ✓ | ||
| Type Aliases | ✓ | ||
| Algebraic Data Type | ✓ | ||
| Structs | ✓ | ||
| Generics | ✓ | ||
| Static Typing | ✓ | ||
| Doc comments | ✓ | ||
| Line Comments | ✓ | ||
| Comments | ✓ | ||
| Multiline Strings | X | ||
| While Loops | X | ||
| Type Inference | X |