Introduction to Wave v0.0.8-pre-beta: Pointer Support Arrives
Hello! I'm LunaStev, the developer of Wave.
We are very happy to introduce Wave v0.0.8-pre-beta
—
a version that officially brings first-class pointer support to the language.
Wave was designed with low-level capabilities in mind, and in this version, we’re making a major leap in that direction.
✅ Added Features
🧠 Pointer System: First-Class Pointer Support in Wave
-
Introduced
ptr<T>
type syntax for defining typed pointers
→ Example:var p: ptr<i32>;
-
Implemented
&x
address-of operator
→ Compiles to LLVM IR asstore i32* %x
-
Implemented
deref p
dereference operator
→ Generates IR asload i32, i32* %p
-
Supported pointer-based initialization
→var p: ptr<i32> = &x;
is now fully parsed and compiled -
Enabled dereferencing for both expression and assignment
→ Example:deref p = 42;
is valid and stored directly via IR -
Address values can be printed as integers
→%ld
used for pointer-to-int cast in formatted output
→println("address = {}", p);
prints memory address
🔧 Bug Fixes
🐛 Fixed Pointer Initialization Parsing Issue
- Changed
VariableNode.initial_value
fromOption<Literal>
toOption<Expression>
- Allowed
&x
to be accepted as a valid initializer expression
🐛 Fixed LLVM IR Crash on AddressOf Expression
- Added support for
Expression::AddressOf
in IR generation - Prevented crash by checking for variable reference inside address-of
🐛 Fixed printf format mismatch for pointers
%s
→%ld
for pointer values- Ensured correct casting of
i32*
toi64
before printing
✨ Other Changes
🧠 Improved Format String Handling in IR
- Added dynamic format string generation based on argument types
- Format strings now automatically adapt for int, float, and pointer types