Skip to content

Start alpha development with an opt-in Whale IR backend - #859

Merged
LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/alpha-whale-integration
Oct 7, 2026
Merged

LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/alpha-whale-integration

Conversation

@LunaStev

@LunaStev LunaStev commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Start 0.0.1-alpha-dev development with an opt-in Whale IR backend. Add a root whale/ workspace crate alongside llvm/; the compiler driver retains CLI dispatch and source preparation. The existing --whale flag now supports check and build --emit=ir, producing verified .wir files.

Whale IR comes from official wavefnd/Whale master, with commit 4f45fdb53d07882932cc251856316206a3bb3947 recorded in Cargo.lock. The adapter consumes Wave typed HIR calculation types and ordered conversions, preserves short-circuit evaluation, and uses iterative expression traversal to retain the 128-level nesting boundary on a 1 MiB stack.

The PR also refreshes the Nightly deployment pins for the latest-only installers from wavefnd/wave-platform#476. Both live installer downloads exactly match the new hashes. The old hashes match the earlier #473 scripts and would now reject the deployed installers in both the Nightly gate and publication checks. The diagnostic wording is updated to describe the latest-only policy; hash verification remains unchanged.

Motivation

Begin LLVM/Whale coexistence for alpha while keeping the existing LLVM compiler usable. This is an initial integration toward #93, not completion of backend parity.

Target and compatibility impact

  • LLVM remains the default; no new backend selection syntax is introduced.
  • Whale currently supports Linux amd64 at O0 for IR generation and verification. Scalar functions, direct calls, initialized local variables, assignments, conditionals, loops, and the supported scalar operations are lowered.
  • Executable/object/assembly output, unsupported targets, and unsupported language operations produce explicit diagnostics instead of falling back to LLVM. Source diagnostics retain the existing JSON format and source spans; failed lowering preserves existing output files.
  • The development version changes to 0.0.1-alpha-dev; no release is published and the compiler/std compatibility revision remains unchanged.

Validation

Using CI-pinned Rust 1.89 and LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 where LLVM is needed:

cargo +1.89 check --offline --jobs 2 -p whale
cargo +1.89 test --locked --offline --jobs 2 --no-default-features --features llvm-target-core64 --test whale_backend
cargo +1.89 clippy --locked --offline --jobs 2 -p whale --all-targets -- -D warnings
cargo +1.89 clippy --locked --offline --jobs 2 --no-default-features --features llvm-target-core64 --all-targets -- -D warnings
RUSTDOCFLAGS='-D warnings' cargo +1.89 doc --locked --offline --workspace --no-default-features --features llvm-target-core64 --no-deps --jobs 2
cargo +1.89 fmt --all --check
git diff --check
python3 -m unittest tools.test_nightly

All 27 Nightly tests pass, and both live installer SHA-256 values match nightly_installers.json. All eight Whale integration regressions pass, covering control flow/calls, ordered casts, contextual wide literals, float-to-bool handling, output protection, unsupported requests, LLVM remaining the default, and the 128/129 expression-depth boundary. The Whale crate builds independently without an LLVM dependency.

Exploratory Rust 1.96 checks exposed a small-stack frontend failure also reproduced on unmodified master, plus a warning in unchanged WSON code. The passing checks above use the repository's pinned Rust 1.89.

Checklist

  • Commits include a DCO Signed-off-by line.
  • Tests cover new behavior or the PR explains why no test is needed.
  • User-facing changes include documentation or diagnostics updates.
  • The change preserves the license boundary between the compiler and std/.

Issues

Closes #861.

Related to #93 and #773.

Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev merged commit d5eb81c into wavefnd:master Oct 7, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce the opt-in Whale typed-HIR IR backend

1 participant