-
Hi all! I'm attempting to compose interpreters written in different styles. One of my interpreters is a CPS interpreter - so I construct a Now, I have another interpreter (imagine that it's a state-like interpreter - like Now, I'd like to be able to use these interpreters compositionally, in any order. The primitives and semantics for these interpreter don't overlap - so I expect application to be commutative. One problem that occurs is that, if I have literal values in my function, I think that my first interpreter (the CPS interpreter) will partially evaluate def foo():
v = tag(0.3, "v")
q = my_other_primitive(some_func, v)
return q In my first interpreter, there's not a "main trace" for Has anyone figured out how to handle this? I sort of want to prevent Edit: secondary Q -- how do "final style" interpreters |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Re — I thought about this today and I think the correct way to do this is to write an interpreter which gets access to the trace, and lifts arguments to tracer type, and then calls bind internally as it iterates over equations in the Jaxpr. I think I can even do exotic things like CPS in this idiom. |
Beta Was this translation helpful? Give feedback.
Re — I thought about this today and I think the correct way to do this is to write an interpreter which gets access to the trace, and lifts arguments to tracer type, and then calls bind internally as it iterates over equations in the Jaxpr.
I think I can even do exotic things like CPS in this idiom.