Static types
Types may be written explicitly or inferred from an initializer. Inference is resolved by the compiler and adds no runtime type information.
let count = 10;
const limit: Int = 64;White
White is a statically typed language that compiles to native code. The compiler is written in White and uses LLVM for code generation.
class Greeting {
let name: String;
init(name: String) {
self.name = name;
}
func write() -> Void {
print("hello, ", self.name);
}
}
func main() -> Int {
let greeting = Greeting("White");
greeting.write();
return 0;
}
Language
White has static types, classes, interfaces, ARC, fallible return values, and a FFI for calling native libraries. The syntax is deliberately kept small.
Types may be written explicitly or inferred from an initializer. Inference is resolved by the compiler and adds no runtime type information.
let count = 10;
const limit: Int = 64;A function that can fail returns T?. Use ? at the call site and catch the error where it can be handled.
let text: String = input("name: ")?;
catch(err) { print(err); }Strings, classes, interfaces, and closures are managed with ARC. Classes may define deinit when they need to release a file, handle, or other resource.
deinit() {
file.close();
}Compiler
wlc reads White source, checks it, and writes LLVM IR. Clang then produces the executable, object file, assembly, or shared library. wlc itself is built through the same process.
Compiler sourcePlatforms
The release pipeline builds and tests wlc for the targets listed here. Cross-compiling for another operating system still requires that system's SDK or sysroot.
x86-64 / x86
x86-64 / x86 / AArch64 / ARMv7
Apple silicon / Intel
Tools
ARC does not collect cycles, weak references are not implemented, and the generic system and standard library are still incomplete. White is not ready for general production use yet.
Read the limitations