Skip to content

RFC: Assert statements should be Pure, performance issue #544

@cduck

Description

@cduck

Two kinds of assertion:

  • Compile-time assertion (during fold) - this should be pure
  • Runtime assertion

Maybe add a new statement for this in the debug dialect to represent compile-time assertions that are ignored during runtime.

Motivation: Assertions inside functions involved in functional control flow prevent fold from happening (assert is not pure). This significantly affects the performance of the compiler.

Co-written with @weinbe58.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions