partial evaluation

by toontalk
See Code Download Embed
This is a bare-bones proof-of-concept partial evaluator (https://en.wikipedia.org/wiki/Partial_evaluation) for Snap!
In principle any Snap! program consisting only of reporters and predicates can be transformed by a program like this one. The example shows how the system can transform easily understood, but inefficient, combinations of high-level blocks to much more efficient versions. In this case it can determine if there are any elements in common between two lists without using additional memory (constructing lists) and it terminates as soon as an element in common is found.

Created December 11, 2021

Last updated December 13, 2021

Published December 13, 2021