Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for expansion of expression language #31

Merged
merged 3 commits into from
Apr 3, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions art-decisions/proposals/2023-03-14-expression-expansion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Expansion of Workflow Expression Language

## Background

The current state of the expression language allows users to retrieve values from inputs and step output. That is enough for usable workloads, but is insuffient for many use cases.

Examples of situations which are limited right now:
- Can't import values from files (will be done with a function)
- Can't conditionally run sections (will be done with a conditional expression and a sub-workflow)
- Can't do comparisons or math with known values for inputs and outputs. (Will be done with conditional expressions and mathematical expressions)

This proposal will make it so less manual work is required to get a workflow working.

## Proposal

Proposed changes:
- Make subexpressions default within map access since it is unintuitive as-is, removing the old () syntax. Moving from `map[(sub-expression)]` to `map[sub-expression]`
- Add functions. Would be added as a root item, and therefore would work where subexpressions are supported. That would also make it so an expression can be exclusively a function call. The functions will be strongly typed, with a standardized interface for their inputs and outputs, allowing type verification.
- Add binary comparison operators. This would need to be another root item. This would be simple. `expression ==|!=|<|>|<=|>= expression`. Types must match, or else there will be a type error.
- Mathematical expressions. These would be simple binary mathematical operators, with the potential for parhenthases for ordering changes. Will be strongly typed.
jaredoconnell marked this conversation as resolved.
Show resolved Hide resolved

Detailed issues for proposed changes:
- [Functions](https://github.com/arcalot/arcaflow-expressions/issues/1)
- [Binary Comparison Operators](https://github.com/arcalot/arcaflow-expressions/issues/2)
- [Mathematical Expressions](https://github.com/arcalot/arcaflow-expressions/issues/3)

### Priorities
- The function calls and comparison operators will be the top priorities
- Mathematical expressions will be lower priority, with most of the work based on the work for the comparison operators.

### Approval
By approving this proposal, you are agree to the addition of functions, binary comparison operators, and mathematical expressions to the language. Not necessarily the way it's implemented.
jaredoconnell marked this conversation as resolved.
Show resolved Hide resolved

Discussion on how it is implemented can be debated in the issues on the expression repository linked above.

## Drawbacks
- It adds complexity to the language