In egraphs-good/egglog-python#416, I've been working on translating between the Rust AST and Python bindings. During review, a performance concern was raised: the current approach requires expensive translation for nodes that lack a stable identifier.
Many AST binding nodes already have a name field that can serve as a numeric key for referencing them from the Python side without full translation. However, RewriteDecl and BiRewriteDecl do not have such a field, which forces the Python bindings to eagerly translate these nodes.
In egraphs-good/egglog-python#416, I've been working on translating between the Rust AST and Python bindings. During review, a performance concern was raised: the current approach requires expensive translation for nodes that lack a stable identifier.
Many AST binding nodes already have a
namefield that can serve as a numeric key for referencing them from the Python side without full translation. However,RewriteDeclandBiRewriteDecldo not have such a field, which forces the Python bindings to eagerly translate these nodes.