Wave is coming to LoongArch64

Wave is preparing to support the LoongArch64 architecture on Linux.

LunaStev

Wave is preparing to support the LoongArch64 architecture on Linux.

LoongArch is a RISC-based instruction set architecture developed by China’s Loongson and is currently used across a variety of environments, including desktops, servers, and industrial systems. LoongArch64 is the 64-bit architecture of LoongArch.

LoongArch is no longer an architecture used only in a limited range of specialised hardware. It is supported by the Linux kernel and major compiler toolchains, while Debian’s loong64 port continues to develop. Packages and Linux kernels targeting LoongArch64 are also being provided as part of the ongoing development of Debian 14.

Alongside this growing ecosystem, Wave has also begun preparing to run on LoongArch64.

LoongArch64 on Wave

Wave’s LoongArch64 support will initially focus on Linux environments.

Wave is currently preparing the following target:

loongarch64-unknown-linux-gnu

In the future, Wave programs will be able to be built for LoongArch64 Linux like this:

wavec build --target loongarch64-unknown-linux-gnu hello.wave

For example, consider a simple Wave program like the following:

fun main() {
    println("Hello, LoongArch64!");
}

The goal is for the Wave compiler to generate a binary from this program that can run on LoongArch64 Linux.

Wave’s standard library will also support LoongArch64 Linux. We plan to expand support so that the Linux standard library, including file, time, memory, and system functionality, can work on LoongArch64 in the same way as on other supported architectures.

CI support is already here

Work on LoongArch64 has already been integrated into Wave’s CI environment.

When adding a new architecture, it is more important to ensure that it continues to work through future changes than to simply make the compiler build successfully once.

For this reason, Wave is preparing CI support first so that LoongArch64-related changes can continue to be validated alongside the architectures we already support.

This is part of making LoongArch64 one of the architectures Wave intends to maintain continuously, rather than adding it as a one-off experimental target.

Why Linux first?

Linux is currently one of the most established environments available for LoongArch64.

LoongArch support has already been upstreamed into the Linux kernel, while the toolchains and userspace ecosystem for GNU/Linux continue to expand. Debian is also developing installation images and a package ecosystem for loong64.

For this reason, Wave will initially build its LoongArch64 support around Linux.

Our initial goals are:

  • Build Wave programs for LoongArch64 Linux
  • Support the loongarch64-unknown-linux-gnu target
  • Support the standard library
  • Continuously validate the architecture through CI
  • Test execution in Linux environments
  • Expand support and improve stability over time

Based on this foundation, our goal is to provide a Wave development experience on LoongArch64 that is as consistent as possible with other supported Linux architectures.

Testing on real LoongArch systems

In the future, we also plan to show Wave programs running in an actual LoongArch64 Linux environment.

At the moment, obtaining LoongArch64 hardware directly is still relatively expensive, so we plan to make active use of virtual machines and emulation environments during development and testing.

We also plan to publish a separate article showing the process of building and running programs with the Wave compiler inside an actual LoongArch64 Linux virtual machine.

In the longer term, if we are able to obtain real LoongArch hardware, we will also be able to test and validate Wave directly on physical systems.