/** The VM itself. This is just an example, it's not a "real" interface. */ public interface PseudoVM { Object[] run(Object[] args) throws Exception; void setApiFunction(String name, PseudoNativeFunction value); } /** Interface defining callbacks provided by the host. */ public interface PseudoNativeFunction { Object invoke(Object[] args); }