Skip to content

Track backend-neutral async and await support #439

Open

Description

@LunaStev

Summary

Track backend-neutral async/await support for Wave from syntax through runtime integration.

The initial language direction is:

async fun load() -> i64 {
    var value: i64 = await read_value();
    return value;
}
  • async fun name(...) -> T produces an asynchronous computation whose completed value is T.
  • await expression suspends only the current asynchronous computation.
  • var remains Wave's local-variable syntax; async support must not introduce let, borrow checking, or Rust-style unsafe blocks.
  • fun main() remains the private entry point. pub async fun main() is invalid, and support for private async fun main() requires an explicit executor entry contract.
  • Direct extern and exported async functions are initially rejected because no stable C or Wave ABI exists for async frames.
  • The frontend contract must be backend-neutral so LLVM can later be replaced by Whale without changing language semantics.

Child issues

Non-goals

  • HTTP, TLS, or protocol libraries in std.
  • An LLVM-specific coroutine ABI as part of the Wave language.
  • Implicit memory safety or ownership rules that Wave does not otherwise provide.
  • Stable async FFI before the Wave ABI is designed.

This tracking issue should be completed through focused child issues rather than one monolithic pull request.

Implementation audit — 2026-09-23

Syntax is complete (#441). Typed HIR, backend-neutral lowering, the executor and native readiness/IOCP implementations exist, but their broader completion criteria are not all verified. Keep #440/#442/#443/#444/#445 open for the remaining contract, coverage and lifetime work. Known runtime follow-ups include #532 (watch reclamation), #533 (task lookup scans), #534 (IOCP staging bounds), and #535 (sleep errors).

Activity

  1. added
    enhancement
    feature request
    discussion
    on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancementfeature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions