跳到主要内容

Introduction to Wave v0.1.3-pre-beta: Syntax tweaks, bug fixes, and enhanced type and import handling.

· 阅读需 2 分钟
LunaStev
Programming Language Engineer

Hello! I'm LunaStev, the developer of Wave.

We are pleased to announce Wave v0.1.3-pre-beta — We changed the function parameter syntax from semicolons to commas, fixed LLVM IR generation for arrays of pointers and index access, and allowed parameters to have multiple types. We also fixed bugs related to parameter parsing and if statements, improved inline assembly support for negative values, and restructured the import system.

PR and Commits

Showcase

The showcase is available at Wave-Test.


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


Installation Guide

  1. Download:

    • Download to Curl.
      curl -fsSL https://wave-lang.dev/install.sh | bash -s -- --version v0.1.3-pre-beta
  2. Verify Installation:

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

Contributor

@LunaStev | 🇰🇷


Website

Website GitHub Discord Ko-fi

Booting from Scratch in Wave: Printing ‘H’ at 0x7C00

· 阅读需 3 分钟
LunaStev
Programming Language Engineer

Wave is a language that supports inline assembly. In its current pre-beta stage, it compiles through LLVM. So here's a thought — what if we could write a boot sector in Wave and run it using QEMU?

If this works, we might just be writing the very first line in Wave’s low-level programming history.

Today, we’re going to attempt exactly that: creating a boot sector using only Wave.


At the moment, Wave uses LLVM as a temporary backend. LLVM is a general-purpose compiler toolchain used by languages like C/C++, Rust, and Zig. However, Wave aims to eventually move away from LLVM and build its own dedicated compiler toolchain, called Whale — optimized specifically for Wave and free from the limitations of LLVM.

Of course, before that can happen, Wave’s frontend needs to be fully developed.


In a previous post, I showed how to print “Hello World” using only Wave. This time, we’ll take it one step further and write a boot sector, which runs below the OS level.


Typically, boot sectors and bootloaders are written in raw assembly. But Wave allows inline assembly using the asm {} block, making it possible to implement a boot sector directly in Wave.

The basics of Wave’s inline assembly syntax are explained in my earlier post: Printing Hello World from Scratch in Wave


Here’s the Wave code we’ll be using:

fun main() {
asm {
"mov ah, 0x0e"
"mov al, 0x48"
"int 0x10"
}
}

Before we proceed, let’s break it down a bit.

Code Breakdown

1. mov ah, 0x0e

  • Stores 0x0E in the AH register.
  • In x86 real mode, the int 0x10 BIOS interrupt is used for video services.
  • When AH = 0x0E, it selects the "TTY character output" function.

2. mov al, 0x48

  • Stores 0x48 (ASCII for 'H') in the AL register.
  • This sets the character to be printed.

3. int 0x10

  • Triggers the BIOS video interrupt.
  • AH = 0x0E → TTY mode
  • AL = character to print
  • BL = page number (defaults to 0)
  • As a result, it prints a single 'H' on the screen.

Now that the code is ready, it’s time to compile.

Currently, Wave only compiles to Linux binaries — formats like .img or .exe aren’t directly supported. However, Wave generates a temp.ll file (LLVM IR) when running wavec run main.wave, and we can use that to produce a bootable .img file.

To simplify the process, I’ve written a shell script called build.sh:

#!/bin/bash

set -e

LL_FILE=target/temp.ll
OBJ_FILE=boot.o
BIN_FILE=boot.bin
IMG_FILE=os.img

wavec run main.wave

llc -march=x86 -mattr=+16bit-mode -filetype=obj $LL_FILE -o $OBJ_FILE

ld -m elf_i386 -Ttext 0x7c00 --oformat binary $OBJ_FILE -o $BIN_FILE

echo -ne '\x55\xAA' | dd of=$BIN_FILE bs=1 seek=510 count=2 conv=notrunc

dd if=$BIN_FILE of=$IMG_FILE bs=512 count=1 conv=notrunc

echo "[+] Image created: $IMG_FILE"

Note: You’ll need the LLVM toolchain installed. I recommend using clang 14 for compatibility with Wave.

When you run ./build.sh, you’ll get output like this:

command

The os.img file is now ready.

Let’s boot it using QEMU:

qemu-system-i386 -drive format=raw,file=os.img

You should see the character 'H' printed to the screen like this:

qemu


Wave is still a work in progress, but this experiment shows that it's already capable of writing boot sectors through inline assembly. As the language evolves with more features and syntax improvements, we might one day build entire OS kernels in Wave.

Printing Hello World from Scratch in Wave

· 阅读需 4 分钟
LunaStev
Programming Language Engineer

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
}

1. "...": Assembly Instructions

  • These are raw CPU assembly instructions.
  • One instruction per line, multiple lines allowed.
  • Example: "mov rax, 1", "syscall"

2. in("rdi") s: Passing Input

  • This means the Wave variable s will be loaded into the rdi register.
  • On x86-64, rdi is the standard register for the first syscall argument.

in("register") expression -> Loads the given expression into the specified register.

3. out("rax") ret: Receiving Output

  • Syscall return values are typically stored in the rax register.
  • out("rax") ret means: assign the value in rax to the Wave variable ret.

out("register") variable -> Reads the register's value into the specified Wave variable.


Now let’s implement Hello World from scratch.

This is only supported in Wave version v0.1.3-pre-beta-nightly-2025-07-11 and later. The stable release is v0.1.3-pre-beta. Although major syntax changes are unlikely beyond this version, there may still be some minor differences. For best compatibility, it's recommended to use the v0.1.3-pre-beta family.

The first thing we need is a way to measure the length of a string.

Most programming languages use a len() function to calculate string length. As mentioned earlier, Wave provides no built-in functions other than import(), so we’ll implement our own len() function manually.

fun len(s: str) -> i32 {
var count: i32 = 0;
while (s[count] != 0) {
count = count + 1;
}
return count;
}

This function would typically belong in the standard library and is used to measure the length of a null-terminated string.


fun println_s(s: ptr<i8>) {
var l: i32 = len(s);
var ret: ptr<i8>;
asm {
"mov rax, 1"
"syscall"
in("rdi") 1
in("rsi") s
in("rdx") l
out("rax") ret
}

var nl: ptr<i8> = "\n";
var one: i32 = 1;
asm {
"mov rax, 1"
"syscall"
in("rdi") 1
in("rsi") nl
in("rdx") one
out("rax") ret
}
}

Wave currently includes a temporary testing function called println(), but to avoid confusion, we’ll define our own version called println_s() here.


import("println");

fun main() {
println_s("Hello World");
}

We use the import() function to load the println.wave file. If your main.wave file already contains the len() and println_s() functions, you won’t need to use import().


Running this will result in:

hello

You’ll see the Hello World output printed like this.


Wave doesn’t have a complete standard library yet, but the potential is definitely there. By taking full advantage of the compiler’s low-level capabilities, you can already build impressive programs—even today.


Site: https://wave-lang.dev/ GitHub: https://github.com/LunaStev/Wave Discord: https://discord.com/invite/Kuk2qXFjc5

Wave Language Performance Benchmark: Comparison with C and Rust

· 阅读需 5 分钟
LunaStev
Programming Language Engineer

Wave is not aiming to be a "C replacement" like Zig, but it is an independent low-level language distinct from C. It has been under active development for about six months now.

Currently in its pre-beta phase, Wave still has several bugs and limitations—but that also means there's significant room for improvement. The potential is definitely there.

According to the roadmap, the frontend of Wave will be completed during the pre-beta stage. In the next phase, alpha, development will begin on Wave’s custom compiler toolchain called Whale, with the goal of moving away from LLVM. The current plan is for Whale to fully replace LLVM and become a highly optimized and independent compiler toolchain tailored specifically for Wave.

However, Wave also faces some clear challenges:

  • Lack of ecosystem: While the concept of Wave has been around for over a year, actual development only began six months ago. As a result, there is no standard library, and there are practically no real-world programs built with it. While algorithmic code is possible, practical application-level development is not. As of version v0.1.2-pre-beta, even basic input functions like input() are not yet implemented.
  • Lack of contributors: This is a common issue with all new programming languages. In the very early stages, it's normal to have zero contributors. Often, a single developer drives the entire project based on their own philosophy. That’s just how it is. Compared to existing utility tools, new programming languages attract attention much more slowly.

Wave is a compiled, low-level language and shouldn’t be compared to Python or JavaScript. It’s not in the same category, and Wave isn’t trying to compete with them either. If we had to choose competitors, C and Rust would be the most appropriate comparisons.

As mentioned earlier, Wave is still in its early stages, so it’s only natural that it’s significantly slower than both C and Rust. However, running benchmarks and comparing results is a meaningful exercise—it provides motivation and insight into potential optimizations.


benchmark

The graph above shows a performance comparison between Wave, C, and Rust. The benchmark measures how long it takes to run a simple string length function 100 million times.

All three languages were tested using AOT (ahead-of-time) compilation. Note that Wave does not and will not support JIT; it will be AOT-only by design.

Here are the source codes used for each language:

fun len(s: str) -> i32 {
var count: i32 = 0;
while (s[count] != 0) {
count = count + 1;
}
return count;
}

fun main() {
var message: str = "hello, world!";
var result: i32 = 0;
var i: i32 = 0;
while (i < 100000000) {
result = result + len(message);
i = i + 1;
}
println("Wave Result: {}", result);
}

Wave does not yet have a time-related library, so execution time was measured using the Linux time command. Please keep that in mind when interpreting the results.


#include <stdio.h>
#include <time.h>

int len(const char* s) {
int count = 0;
while (s[count] != 0) {
count++;
}
return count;
}

int main() {
const char* message = "hello, world!";
int result = 0;

clock_t start = clock();
for (int i = 0; i < 100000000; ++i) {
result += len(message);
}
clock_t end = clock();

double elapsed = (double)(end - start) / CLOCKS_PER_SEC;
printf("C Result: %d\n", result);
printf("C Time: %.3f seconds\n", elapsed);
return 0;
}

C is a time-tested language that has been the foundation of many systems and is deeply optimized. It is, without question, one of the most respected and traditional languages in software development.


use std::time::Instant;
use std::hint::black_box;

fn len(s: &str) -> i32 {
let bytes = s.as_bytes();
let mut count: i32 = 0;
while count < bytes.len() as i32 && bytes[count as usize] != 0 {
count += 1;
}
count
}

fn main() {
let message = black_box("hello, world!");
let mut result = 0;

let start = Instant::now();
for _ in 0..100_000_000 {
result += len(message);
}
let duration = start.elapsed();

println!("Rust Result: {}", result);
println!("Rust Time: {:.3?}", duration);
}

Rust is the language used to implement Wave itself, so of course it's included in the benchmark. Although Rust has only been around for about a decade, it has grown rapidly and now has a thriving ecosystem. While it hasn’t reached the level of C yet, it is without a doubt one of the most promising modern systems languages.


Some might look at this benchmark and say, "Wow, Wave is incredibly slow!"—and yes, it is slow right now. But don’t forget: Wave is only six months into development. Rust reached its first stable release after 10 years of development.

Wave is about 5× slower than C, and about 4.2× slower than Rust. However, considering that Wave is still a very young AOT-compiled language, this level of performance is already quite impressive. Reaching Rust-level performance won't happen overnight, but the potential is clearly there.


Site: https://wave-lang.dev/ GitHub: https://github.com/LunaStev/Wave Discord: https://discord.com/invite/Kuk2qXFjc5

Introduction to Wave v0.1.2-pre-beta: Assignment Operators, Added Remainder and Generalized Indexing Support

· 阅读需 3 分钟
LunaStev
Programming Language Engineer

Hello! I'm LunaStev, the developer of Wave.

We are pleased to announce Wave v0.1.2-pre-beta — This update supports indexing, supports the rest of the operators. And I added an assignment operator. And I fixed a number of bugs.


✅ Added Features

🔍 Generalized Indexing Support

  • Extended arr[index] syntax to support variable indexing in any context.

  • Now supports dynamic indexing like arr[i], ptr[j], get_array()[k] inside if, while, return, and assignments.

  • Internally handles pointer types (e.g., i8*) using GEP and performs automatic type casting (e.g., i8 vs i64) for comparisons and assignments.

➕ Added % (Remainder) Operator Support

  • Wave now supports the modulo operator % for integer types.

  • Expressions like a % b, 10 % 3, and var x: i32 = a % b are now fully parsed and compiled to LLVM IR using srem (signed remainder).

  • Parser was updated to recognize % as TokenType::Remainder, and IR generation uses build_int_signed_rem for correct runtime behavior.

  • % is fully supported inside expressions, assignments, conditionals, and return statements.

⚙️ Assignment Operators (+=, -=, *=, /=, %=)

  • Supports compound assignment operators for both integers (i32) and floating-point numbers (f32).

  • Operators implemented: +=, -=, *=, /=, %=.

  • Type-safe operation with proper distinction between integer and float IR instructions:

    • add, sub, mul, sdiv, srem for integers.

    • fadd, fsub, fmul, fdiv, frem (uses fmodf) for floats.

  • Implicit type casting during assignment (e.g., assigning an int to a float variable triggers intfloat conversion).

  • Proper LLVM IR generation for all supported operations, including float remainder via external fmodf call (linked with -lm).

🐛 Bug Fixes

🔢 Accurate Token Differentiation Between Integers and Floats

  • Number parsing logic has been overhauled to properly distinguish between integer literals (e.g., 42) and floating-point literals (e.g., 3.14, 42.0).

  • Previously, all numeric literals were parsed as Float(f64) tokens, even when no decimal point was present. → Now, tokens like 123 are correctly parsed as Number(i64), and 123.45 as Float(f64).

  • Introduced internal flag is_float to detect presence of . during scanning. If found, the number is parsed as a float; otherwise, as an integer.

  • Implemented type-safe error handling:

    • Fallbacks to TokenType::Number(0) or TokenType::Float(0.0) on parse failure, ensuring the lexer remains stable on malformed input.
  • This fix improves downstream type checking, IR generation, and expression evaluation, especially for typed languages like Wave where i64 and f64 must be handled distinctly.

✨ Other Changes

🧠 Library and Binary 2 Coexist

  • Add lib.rs for easy package manager creation, development, and easy access.

Showcase

The showcase is available at Wave-Test.


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


Installation Guide

  1. Download:

    • Download to Curl.
      curl -fsSL https://wave-lang.dev/install.sh | bash -s -- --version v0.1.2-pre-beta
  2. Verify Installation:

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

PR and Commits


Contributor

@LunaStev | 🇰🇷


Website

Website GitHub Discord Ko-fi

Introduction to Wave v0.1.1-pre-beta: Inline Assembly, Pointer Chain, and Array Support

· 阅读需 3 分钟
LunaStev
Programming Language Engineer

Hello! I'm LunaStev, the developer of Wave.

We are excited to announce Wave v0.1.1-pre-beta — This update introduces inline assembly (asm {}) support, enabling you to write low-level system code directly in Wave, such as making syscalls with direct register manipulation.

Additionally, Wave now fully supports pointer chaining (ptr<ptr<i32>>) and array types (array<T, N>), including index access, address-of operations, and validation of literal lengths — expanding Wave's capability for systems-level and memory-safe programming.

These improvements bring Wave closer to its vision as a low-level but expressive programming language.


✅ Added Features

⚙️ Inline Assembly (asm { ... }) Support

  • Introduced asm { ... } block syntax to embed raw assembly instructions directly within Wave code.

  • Supports instruction strings (e.g., "syscall") and explicit register constraints via in("reg") var and out("reg") var.

  • Variables used in in(...) are passed into specified registers; variables in out(...) receive output from registers.

  • Supports passing literal constants directly to registers (e.g., in("rax") 60).

  • Pointer values (e.g., ptr<i8>) are correctly passed to registers such as rsi, enabling low-level syscalls like write.

  • Internally leverages LLVM's inline assembly mechanism using Intel syntax.

  • Currently supports single-output only; multiple out(...) constraints will overwrite each other.

  • Does not yet support clobber lists or advanced constraint combinations.

  • Provides essential capability for system-level programming (e.g., making direct syscalls, writing device-level code).

⚠️ This is not a fully general-purpose inline ASM facility yet, but it enables practical low-level operations within Wave. Full support is planned for later phases.

⚙️ Make pointer chain explicit

  • Nested parsing like ptr<i32>, ptr<ptr<i32>>

  • Can create ptr<T> for any type (no restrictions on T)

  • Support for consecutive deref operations (e.g., deref deref deref)

⚙️ Array type complete

  • IndexAccess (numbers[0]) handling

  • ArrayLiteral → Parse into AST and validate length

  • AddressOf → Support array literals with address-of values (e.g., [&a, &b])

  • Confirmed that array<T, N> supports any type as T

✨ Other Changes

🧠 Library and Binary 2 Coexist

  • Add lib.rs for easy package manager creation, development, and easy access.

Showcase

Image1description

Image2description


Image3description

Image4description


Image5description

Image6description


Image7description

Image8description


Image9description

Image10description


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


Installation Guide

For Linux:

  1. Download and Extract:

    • Download the wave-v0.1.1-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.1.1-pre-beta/wave-v0.1.1-pre-beta-x86_64-linux-gnu.tar.gz
    • Extract the archive:
      sudo tar -xvzf wave-v0.1.1-pre-beta-x86_64-linux-gnu.tar.gz -C /usr/local/bin
  2. 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
  3. Verify Installation:

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

Contributor

@LunaStev | 🇰🇷


Website

Website GitHub Discord Ko-fi

Introduction to Wave v0.1.0-pre-beta: Add Import and UTF-8 Support

· 阅读需 2 分钟
LunaStev
Programming Language Engineer

Hello! I'm LunaStev, the developer of Wave.

We are very pleased to introduce Wave 'v0.1.0-pre-beta' — This update supports the import function and UTF-8, allowing you to output other characters, unlike previous versions that only supported ASCII.


✅ Added Features

📦 Local File Import Support

  • Introduced import("..."); statement in Wave syntax.

  • Supports importing .wave source files relative to the current file's directory.

  • Prevents duplicate imports automatically using an internal HashSet.

  • Imported files are parsed, converted to AST, and merged into the main program at compile time.

  • Enables modular project structure by allowing multi-file composition.

🔧 Bug Fixes

🐞 UTF-8 Handling in Lexer

  • Fixed tokenizer crash on non-ASCII characters.

  • Lexer now correctly processes UTF-8 multi-byte characters, enabling support for Korean and other languages in source code.

🐞 Underscore (_) Support in Identifiers

  • Variable and function names can now contain underscores.

  • Lexer now treats identifiers like my_var or some_function as valid.


Showcase

Image1description

Image2description

Image3description


Image4description

Image5description


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


Installation Guide

For Linux:

  1. Download and Extract:

    • Download the wave-v0.1.0-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.1.0-pre-beta/wave-v0.1.0-pre-beta-x86_64-linux-gnu.tar.gz
    • Extract the archive:
      sudo tar -xvzf wave-v0.1.0-pre-beta-x86_64-linux-gnu.tar.gz -C /usr/local/bin
  2. 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
  3. 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

Introduction to Wave v0.0.9-pre-beta: Explicit Mutability, Smarter Functions, and Safer Pointers

· 阅读需 3 分钟
LunaStev
Programming Language Engineer

Hello! I'm Lunastev, the developer of Wave.

We are very excited to introduce Wave 'v0.0.9-Free Beta' — A version that offers Explicit Mutability, Smarter Functions, and Safer Pointers.

Wave is designed with low-level features in mind, and in this version, We are making a big leap in that direction.


📐 Language Specification Updates

🧠 Introduction of let, let mut, and var for Explicit Mutability

  • Wave now supports three types of variable declarations to express mutability explicitly:

    • var: fully mutable, intended for general-purpose variables

    • let: immutable, reassignment is forbidden

    • let mut: mutable under immutable declaration context (safe controlled mutability)

  • This design introduces clearer ownership intent and improves safety in low-level and system-oriented programming.

🧠 Default Parameter Values in Function Declarations

  • Wave functions can now define parameters with default values:

    fun main(name: str = "World") {
    println("Hello {}", name);
    }
  • If an argument is not provided at runtime, the default value will be inserted automatically by the compiler.

  • This enables more expressive and flexible function declarations.

✅ Added Features

🧠 Parser and IR support for explicit mutability

  • Introduced internal Mutability enum: Var, Let, LetMut

  • Implemented parse_let() with optional mut keyword for parsing

  • Wave's IR generation now restricts let variables from being reassigned

🧠 IR handling of function parameter defaults

  • When default values are present in function parameters, they are now correctly recognized and handled during LLVM IR generation

  • If an argument is not passed at runtime, the default value is inserted directly into the stack-allocated variable

🔧 Bug Fixes

🐛 Incorrect string output in println() format

  • Fixed an issue where str values (i8*) were printed as raw addresses

  • The format translation now maps i8* to %s correctly

  • Values are passed directly to printf as string pointers, avoiding ptr_to_int conversion

🐛 Incorrect handling of deref assignment

  • Fixed an issue where dereferencing a pointer and assigning its value caused type mismatches in the generated IR.

  • The IR now properly handles dereferencing a pointer (deref p1 = deref p2;) and assigning the values correctly without causing i32** mismatches.

✨ Other Changes

🧠 IR-level enforcement of immutability

  • Reassignment attempts to let variables now cause a compile-time panic

  • All memory operations (store/load) respect mutability constraints

🧠 IR-level enforcement of pointer dereferencing

  • Introduced a fix to ensure that pointer dereferencing (deref p1 = deref p2;) is handled correctly in the IR.

  • Adjusted the generate_address_ir() function to properly dereference pointers and load/store values without causing pointer type mismatches.


Showcase

Image1description

Image3description


Image2description

Image4description


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.9-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.9-pre-beta/wave-v0.0.9-pre-beta-x86_64-linux-gnu.tar.gz
    • Extract the archive:
      sudo tar -xvzf wave-v0.0.9-pre-beta-x86_64-linux-gnu.tar.gz -C /usr/local/bin
  2. 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
  3. 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

Introduction to Wave v0.0.8-pre-beta: Pointer Support Arrives

· 阅读需 3 分钟
LunaStev
Programming Language Engineer

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
  2. 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
  3. 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

Introduction to Wave v0.0.7-pre-beta: Fixed infinite recursive and stack overflow bugs due to previously incorrect ASTNode reuse

· 阅读需 2 分钟
LunaStev
Programming Language Engineer

Hello! I'm LunaStev, the developer of Wave.

We are very happy to introduce Wave v0.0.7-pre-beta.

This release has previously addressed the issue of infinite recursive and stack overflow due to incorrect ASTNode reuse.

We also changed the name of the Wave compiler binary from wave to wavec.

Wave is growing fast, and we are very excited to share our future plans.


🔧 Bug Fixes

🐛 Fixed else if IR Infinite Loop Bug

  • Resolved a critical bug where stmt was reused inside the else if block IR generation loop
  • Previously caused infinite recursion and stack overflow due to incorrect ASTNode reuse
  • Fixed by replacing stmt with else_if when iterating over else_if_blocks

✨ Other Changes

🛠 Renamed wave to wavec

  • Renamed the Wave compiler binary from wave to wavec
  • This change was made to prepare for the integration of Vex, the official package manager for Wave
  • Separating the compiler tool (wavec) from the language name (Wave) aligns with future plans for Vex integration

Showcase

12

34


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.7-pre-beta-linux.tar.gz file from the official source.
    • Use the wget command:
      wget https://github.com/LunaStev/Wave/releases/download/v0.0.7-pre-beta/wave-v0.0.7-pre-beta-linux.tar.gz
    • Extract the archive:
      sudo tar -xvzf wave-v0.0.7-pre-beta-linux.tar.gz -C /usr/local/bin
  2. 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
  3. Verify Installation:

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

Contributor

@LunaStev | 🇰🇷


Website

Website GitHub