Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Mach

< >

Mach is an open source programming language created in 2022 by Ethan Reynolds.

#1386on PLDB 4Years Old
Download source code:
git clone https://github.com/briar-systems/mach
Homepage · Source Code · Docs

Mach 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.


Example from the web:
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; }

Language features

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

- Build the next great programming language · Add · Add Prompt · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements

Built with Scroll v178.2.3