Skip to content

Lower boolean and-or expressions with short-circuit control flow #151

Closed

Description

@LunaStev

Current evidence

Audit baseline: Whale a254da9e after #131 (2026-09-22). Wave has LogicalAnd/LogicalOr operators, while Whale BinOpRef supports only Add/Sub/Mul. Implementing boolean logic as eager arithmetic would evaluate a right-hand expression that should be skipped.

Wave front/parser/src/ast.rs

Whale ir/src/lower_ast/frontend.rs

Whale ir/src/lower_ast/o0.rs

Scope

Difficulty: high.

Add boolean logical expressions to the frontend contract and lower them through CFG branches, preserving exactly-once evaluation. Limit operands/results to bool initially.

Completion criteria

  • False-and and true-or skip a right-hand trap or effect in semantic tests.
  • True-and and false-or evaluate the right-hand side once.
  • Nested expressions produce valid CFG and defined boolean results.

Dependencies and boundaries

Depends on #98 for observable effects and #80 if phi results are used.

Backlog index: #12. This issue owns only the bounded work described above. Tests must run without an external assembler dependency.

Activity

  1. added
    enhancement
    help wanted
    ir
    needs testing
    priority medium
    on Sep 22, 2026
  2. added a commit that references this issue on Oct 12, 2026
    5061bde
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

    enhancementhelp wantedirneeds testingpriority medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions