2 ms·
Evaluate code for a stack machine symbolically, and you'll end up with an expression tree. RPN bytecode is a post-order traversal of the underlying expression.
by barrkel 12y ago
Evaluate code for a stack machine symbolically, and you'll end up with an expression tree. RPN bytecode is a post-order traversal of the underlying expression.
Things get a bit more wrinkly with control flow, but you can design bytecode to make it easier to rehydrate that too.