On 27 Nov 2017, at 16:11, Noel Chiappa <jnc@mercury.lcs.mit.edu> wrote:

Along those lines, I was wondering about modern OS's, which I gather for
security reasons prevent execution of data, and prevent writing to code.

Programs which emit these little 'custom code fragments' (I prefer that term,
since they aren't really 'self-modifying code' - which I define as 'a program
which _changes_ _existing_ instructions) must have some way of having a chunk
of memory into which they can write, but which can also be executed.

I think, however this is done, it must be relatively tractable, because Lisp systems with native-code compilers work fine on modern OSs, and they do very much more than generate small code fragments.

--tim