Re: IL Engineering Library
- Posted by jimcbrown (admin) Jul 09, 2015
- 3615 views
I'm interested in Euphoria's self-modifying code capabilities.
Right now, it doesn't really have any... except in the highly experimental branch.
Jim, could you please elaborate a bit further on Euphoria's potential in this area?
Sure thing, but remember that what's implemented so far is still in the highly experimental phase, and only implemented for the euphoria backend.
For instance, in addition to compiling code at runtime and injecting it into the running program, on the fly, could Euphoria also eliminate from memory some parts of bytecode that are no longer needed?
This is already implemented in the equals branch as M_DELETE_IL_AT. See http://scm.openeuphoria.org/hg/euphoria/rev/e5aa21896e3f
Can the routine_id indentification be used for this purpose, so that chunks of bytecode are injected while others are eliminated?
Yes, it could. This is not implemented yet, but in the euphoria backend it's as easy as returning something like SymTab[e_routine[val[a]+1]][S_CODE].