In this PR we transition from compiling expressions to using an expression interpreter that lives in pax_lang::interpreter.
Changes included in this PR:
Rewriting the deserializer to go from string -> PaxValue. It now only does a single parse and uses references all the way through. I've also moved it from pax-manifest -> pax-lang.
Create an expression interpreter (pax-lang::interpreter). The main entry points here are parse_pax_expression which goes from a &str -> PaxExpression (AST) and compute_paxel which goes from a &str -> PaxValue. The interpreter has been brought to parity with the current system and contains unit tests for functionality.
Rewrite the code-gen to use the interpreter rather than the v-table and then removed the vtable entirely.
Updated the manifest to remove expression ids and compiling of expressions step.
In order to support our current usage of functions, I have created 2 new macros that can be used in tandem to register helpers. These two macros are #[has_helpers] and #[helpers]. A struct can define helper functions by marking itself #[has_helpers] and creating an impl block with static functions marked #[helpers]. The need of the #[has_helpers] macro is to solve to macro coordination problem.
The examples are all running and pax-designer has been brought up to date.
A possible next step in this work could be to bring PaxValue & PaxExpression into the manifest as the underlying representation of ValueDefinitions rather than string. This would remove the need to parse completely from the runtime.
In this PR we transition from compiling expressions to using an expression interpreter that lives in pax_lang::interpreter.
Changes included in this PR:
parse_pax_expression
which goes from a &str -> PaxExpression (AST) andcompute_paxel
which goes from a &str -> PaxValue. The interpreter has been brought to parity with the current system and contains unit tests for functionality.#[has_helpers]
and#[helpers]
. A struct can define helper functions by marking itself#[has_helpers]
and creating an impl block with static functions marked#[helpers]
. The need of the#[has_helpers]
macro is to solve to macro coordination problem.The examples are all running and pax-designer has been brought up to date.
A possible next step in this work could be to bring PaxValue & PaxExpression into the manifest as the underlying representation of ValueDefinitions rather than string. This would remove the need to parse completely from the runtime.