Currently, the implementation of Object::expr() returns a new Rc in each call. This is necessary to allow users to construct structs as normal Rust literals.
Since we use Rcs to deduplicate expressions, this has the downside of generating redundant struct literal expressions:
Currently, the implementation of
Object::expr()
returns a newRc
in each call. This is necessary to allow users to construct structs as normal Rust literals.Since we use
Rc
s to deduplicate expressions, this has the downside of generating redundant struct literal expressions:Here, the
vec3(var_1, var_2, var_3)
is redundant.We could fix this by caching struct literal expressions in
Trace
somehow. Maybe.