Skip to content

Expression Langauge

Matt Larsen edited this page Aug 25, 2019 · 14 revisions

Types

Integral Types

  • integer
  • double
  • mesh variables: strings, e.g. "pressure" indicate a variable defined on the mesh.
  • bool: Note: only produced as the result of a comparison. Not sure we need keywords true and false since I don't see how we would use it in practice.

Objects

Functions can return objects that contain values and attributes.

Idea: currently, vector math, e.g. v1+v2 is implemented in the binary op code. Perhaps there is a way that we can define objects in such a way that it contains the code that defines supported ops like an overloaded operator in c++.

Simple Objects: values only

  • Vector: a 3D vector created with the vector function, e.g., vector(0,1,0).

Operators

Binary Operators

  • Math: -, +, *, /, %
  • Comparison: ==, >=, <=, !=, >, <
  • Boolean: not implemented. We had the goal of being python like so maybe these should be and, or , and not, as opposed to &&, ||, and !. For JIT, we can just substitute whatever we need back in. Note: not is a unary operator.

Unary Operators

  • -

Clone this wiki locally