Skip to content

v0.1.8-pre-beta

Choose a tag to compare

@LunaStev LunaStev released this 17 Mar 09:02
321d3e8

Release Notes: v0.1.8-pre-beta

This release marks a significant milestone for the Wave language, introducing foundational infrastructure for modern language features, a major overhaul of the compiler backend, and a vastly improved developer experience through advanced diagnostics.


Key Highlights

  1. Modern Langauge Foundations: The introduction of Generics, Pattern Matching (match), and Explicit Type Casting (as) provides the expressiveness needed for complex systems programming.

  2. Infrastructure Modernization: The backend has been upgraded to LLVM 21, fully embracing Opaque Pointers and the new PassBuilder optimization pipeline for improved performance and stability.

  3. Portability & Diagnostics: With new Cross-ABI support (Linux x86_64 and macOS ARM64) and Rust-style error diagnostics, Wave is now more portable and developer-friendly than ever.


New Features

Language & Syntax

  • Generics Support: Basic infrastructure for generic functions and structs is now live. Standard library components like TypedBuffer<T> and generic 1223math utilities are included.

  • Pattern Matching: The new match statement allows for elegant control flow, lowered efficiently to LLVM switch instructions.

  • Static Globals: Global variables can now be declared using the static keyword, providing persistent storage throughout the program lifetime.

  • Explicit Type Casting: The as operator (e.g., x as i64) is now the standard for type conversions, replacing previous implicit behaviors.

  • Conditional Compilation: Support for #[target(os="...")] allows developers to write platform-specific code blocks within the same file.

  • Pointer Arithmetic: Added support for ptr + int, ptr - int, and ptr - ptr operations.

  • Null Literal: The null keyword is introduced for pointer types, including semantic checks to prevent assignment to non-pointer types.

CLI & Tooling

  • Advanced Diagnostics: The compiler now provides detailed, colorized error messages with source code snippets, carets, and unique error codes (e.g., E1001).

  • GUI Build Manager: A new Tkinter-based graphical interface for x.py allows for visual management of build targets and toolchain installations.

  • Dependency Management: External packages can now be resolved via --dep and --dep-root flags.

  • LLVM Customization: Expanded CLI support for fine-grained backend control, including --target, --cpu, and --features.


Buf Fixes

  • C Varargs Type Promotion: Fixed an issue where small integers and floats were not correctly promoted to i32 and double when calling C functions like printf.

  • Symbol Resolution: Resolved a bug where extern C functions were incorrectly looked up by their internal Wave name instead of their redirected LLVM symbol name.

  • Inline Assembly Stability: Improved automatic clobber logic for empty assembly blocks to prevent accidental general-purpose register corruption.

  • Target Directory Routing: Fixed incorrect target directory pathing logic in the compiler backend.


Technical Changes

  • LLVM 21 & Opaque Pointers: Migrated from typed pointers to Opaque Pointers. All backend IR generation (loads, stores, GEPs) now requires explicit type tracking.

  • Monomorphization: Integrated a monomorphization pass into the compilation runner to handle generic code generation.

  • Standard Library Refactoring: System modules have been abstracted into platform-agnostic paths (e.g., std::sys::fs) using the new conditional compilation system.

  • Entry Block Allocas: Local variable allocations are now moved to the function entry block to improve optimization compatibility.


Important Notes

  • Strict Type Narrowing: Implicit narrowing of integer types (e.g., assigning i64 to i32) is now forbidden. You must use the as operator for explicit casting.

  • Standard Library Imports: Existing code using platform-specific paths (like std::sys::linux::fs) should be updated to the new common dispatch paths.

  • Windows Target: Support for x86_64-pc-windows-gnu is currently in transition and may be temporarily disabled in some automated build scripts.