Printing Hello World from Scratch in Wave
Wave fundamentally provides no standard functions out of the box. While println()
and print()
do currently exist, they are temporary functions intended for testing during development and are not official. The only officially supported built-in function in Wave is import()
.
But let’s be honest—if you had to build everything from scratch with no foundation, you probably wouldn't want to use the language. Fortunately, Wave supports a standard library, which allows you to use pre-written library functions. However, in bare-metal environments where standard libraries can't be used, you must implement everything yourself, step by step.
Overview
Today, we'll try printing "Hello World" in Wave with nothing but the bare essentials.
The Wave compiler only provides syntactic support—meaning it doesn't include any functional utilities like syscall()
. Aside from import()
, no functions are provided by default.
Wave supports inline assembly, written using the asm {}
block.
Let's quickly go over the basic syntax of inline assembly in Wave.
Inline Assembly Syntax
asm {
"assembly instruction" // actual assembly code line by line
...
in("register") value // input register mapping
out("register") variable // output register mapping
}