DEV Community

Cover image for Introduction to Wave v0.0.8-pre-beta: Pointer Support Arrives
LunaStev
LunaStev

Posted on

2 1

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 as store i32* %x

  • Implemented deref p dereference operator

    → Generates IR as load 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 from Option<Literal> to Option<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* to i64 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

Showcase

Imag3e description

Ima3ge description


Thank you for using Wave! Stay tuned for future updates and enhancements.


Installation Guide

For Linux:

  1. Download and Extract:

    • Download the wave-v0.0.8-pre-beta-x86_64-linux-gnu.tar.gz file from the official source.
    • Use the wget command:
     wget https://github.com/LunaStev/Wave/releases/download/v0.0.8-pre-beta/wave-v0.0.8-pre-beta-x86_64-linux-gnu.tar.gz
    
  • Extract the archive:

     sudo tar -xvzf wave-v0.0.8-pre-beta-x86_64-linux-gnu.tar.gz -C /usr/local/bin
    
  1. Setting up LLVMs

    • Open a terminal and type:
     sudo apt-get update
     sudo apt-get install llvm-14 llvm-14-dev clang-14 libclang-14-dev lld-14 clang
     sudo ln -s /usr/lib/llvm-14/lib/libLLVM-14.so /usr/lib/libllvm-14.so
     export LLVM_SYS_140_PREFIX=/usr/lib/llvm-14
     source ~/.bashrc
    
  2. Verify Installation:

    • Open a terminal and type:
     wavec --version
    
  • If the version number displays, the installation was successful.

Contributor

@lunastev | 🇰🇷


Website

Website
GitHub
Ko-fi

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

Top comments (0)

👋 Kindness is contagious

Discover fresh viewpoints in this insightful post, supported by our vibrant DEV Community. Every developer’s experience matters—add your thoughts and help us grow together.

A simple “thank you” can uplift the author and spark new discussions—leave yours below!

On DEV, knowledge-sharing connects us and drives innovation. Found this useful? A quick note of appreciation makes a real impact.

Okay