Skip to content

Should we track functions with side-effects? #778

@mark-koch

Description

@mark-koch

We need to ensure the ordering of side-effectful functions like result, panic, rng_seed, rng_next, etc.

Since there are no dataflow dependencies between those functions, we have to emit extra order-edges between them within a basic block. This requires tracking of these effects by the compiler and is not trivial:

  • A function calling another side-effectful function becomes side-effectful itself
  • A call of a higher-order function could also be side-effectful, so we need to track this in the function type, not only the function definition. Or be conservative and assume that any indirect call can have any side-effects.
  • There are different kinds of side effects: E.g. it's not required to specify the order between result and rng_next since their side-effects don't interfer

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