2 ms·
RPN can also be viewed as a serialization mechanism for expression trees, and with the addition of a 'dup' operator, directed acyclic graphs (aka DAGs). The not
by barrkel 13y ago
RPN can also be viewed as a serialization mechanism for expression trees, and with the addition of a 'dup' operator, directed acyclic graphs (aka DAGs). The notation is used by both the JVM (with typed operators) and the CLR (with operators whose type is inferred from the operands on the stack). Evaluating the stack symbolically results in rehydrating the source tree.
- thu 13y agoPython's Pickle format is similar. It interprets opcodes using a stack-based "pickle" machine. (I have started an Haskell implementation of it https://github.com/noteed/python-pickle https://github.com/noteed/python-pickle)