Programmed code generation (was: Self-modifying code)

Peter da Silva peter at ficc.UUCP
Sat Jul 16 06:25:20 AEST 1988


In article <12381 at ut-sally.UUCP>, nather at ut-sally.UUCP writes:
> In article ... pardo at june.cs.washington.edu (David Keppel) writes:
> > There is nothing architecturally weird about programs that generate
> > their own code. ...although few OPERATING SYSTEMS support this.

> And no LANGUAGES that I'm aware of.  But that's the whole point. CAN they?

Do you count Forth as a language?

For that matter, I've generated and then executed code in a program
written in Forth running under UNIX. Real code, not threaded code:

CREATE UNDER ASSEMBLER
	S )+ R0 MOV,
	S )+ R1 MOV,
	R0 S -) MOV,
	R1 S -) MOV,
	R0 S -) MOV,
	NEXT,

Which can immediately be used...
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?" (uunet,tness1)!sugar!ficc!peter.



More information about the Comp.lang.c mailing list