-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Via @__gparmer on Twitter:
Another potential use, that is likely already on your radar: If you can interpret the code, you can apply a cost function to it (while interpreting), which can provide feedback on how effective different optimizations are.
Different cost functions (loads are expensive vs. forward branches are expensive vs. instructions in general are expensive) can make the point to students that optimizations are architecture-specific.
I haven't thought about this one much, but adding such functionality could be neat and may not be terribly difficult? I figure it would essentially amount to just keeping a running total of costs incurred during step operations. The most primitive such cost function could just be counting the number of steps taken!