Skip to content

Built-in Functions

Zeus provides built-in functions that are available globally without any imports.

I/O Functions

log

Prints a string to standard output.

log(message: string): void

Parameters:

  • message — A string to print

Example:

function main(): void {
log("Hello, World!");
log("Zeus supports UTF-8 🚀");
let greeting: string = "Welcome to Zeus!";
log(greeting);
}

Output:

Hello, World!
Zeus supports UTF-8 🚀
Welcome to Zeus!

Logging Byte Arrays

Since u8[] can be implicitly converted to string, you can log byte arrays by first converting them:

function main(): void {
let bytes: u8[] = new u8[];
bytes[0] = 'H';
bytes[1] = 'i';
// Convert to string for logging
let text: string = bytes;
log(text); // "Hi"
}

More Functions Coming Soon

Additional standard library functions for math, string manipulation, and more are planned for future releases.


Next

Control Flow →