Skip to content

Tree walking evaluator for the formula engine #658

@shsms

Description

@shsms

What's needed?

Our current postfix expression evaluator is not suitable for performing arbitrary non-binary operations. And we have (had) multiple operations that don't fit the binary evaluator requirement clearly.

  • Averager (not binary, can average multiple things. going away in Drop formula step Averager #645)
  • Clamper (unary operation)
  • Max/Min (needs to be decomposed to a binary operation, like Max(Max(a, b), c), and needs changes to the operator priority.)

We need is a new design concept based on a tree-walking evaluator, that would allow for the composition of arbitrary operations - binary or otherwise, seamlessly, without causing additional async cycles, just from adding an implementation for the operation, without having to touch the evaluator's internals, like we're having to do with operator priority in the current expression evaluator.

The specifics can be decided after 1.0. This is just internal refactoring of the Formula Builder, Evaluator and Steps. So it can be done after 1.0

Proposed solution

No response

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementNew feature or enhancement visitble to userstype:tech-debtImproves the project without visible changes for users

    Type

    No type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions