Partial application in C
Jim Blandy
blandy at marduk.cs.cornell.edu
Sun Jun 26 17:17:31 AEST 1988
About executing data:
With rare exception, I think we can all say that self-modifying
code is horrid, and anyone who writes it should be left alone.
It's nice to have one's code segment protected from out-of-control
writes.
Caching is great. I'd guess ? that if a program's having trouble
with caching, the fault is in the design, not the caching. I
wouldn't be too surprised by a notable exception, but I think
it's generally true; YOU DON'T MODIFY ACTIVELY RUNNING CODE,
so the assumptions made by a caching system should hold.
Where executing data really comes in handy is in situations like
interactive compilers. For example, Chez Scheme is a neato implementation
of Scheme (a popular Lisp dialect); you define a function, chez compiles it
and lets you execute assembly language, not some wimpy scheme p-code. If
you really want to do this right, you need to put the code somewhere in
your own address space; you need to be able to execute your data.
One could call this self-modifying code, and they'd be right, strictly
speaking, but it's a clean, upstanding use for executable data spaces.
(I have no affiliation with the Chez Scheme people; I just think it's a
good program.)
--
Jim Blandy - blandy at crnlcs.bitnet
"insects were insects when man was just a burbling whatsit." - archie
More information about the Comp.lang.c
mailing list