The DSL specification should tell about datatypes of variables, such as whether they are static or dynamic.
My proposal:
- Every variable has a FIX datatype so variables are interchangeable with message fields in an expression.
- A variable does not exist until an assignment expression is evaluated. Then, by default, it assumes the type of field in the expression.
- Type promotion generally happens as in common programming languages. For instance, an integer multiplied by a float yields a float.
- Type promotion is actually table-driven to handle logical cases like price times qty = amt. (That's actually the definition of FIX amt type.)
- Once a variable is created with a type, it retains that type.
The DSL specification should tell about datatypes of variables, such as whether they are static or dynamic.
My proposal: