network@ucbjade.BERKELEY.EDU (Berkeley Network) (02/27/86)
In article <426@utastro.UUCP> nather@utastro.UUCP (Ed Nather) writes about self-modifying code: >It will return; it's too neat an idea to stay dead. What we lack is the >needed formal discipline to use it carefully. Spaghetti code has given 1) The language I use (built in forth) has an executable struct - viewed as an execution object it is a procedure. Vieweed as a data object it is a struct. What this means is, I can store the appropriate typed objects into fields in the structure (instructions, addresses, etc.) and then execute it. It is useful for just the purpose Ed describes - cranking every last iota of speed out of a piece of code that the machine is really too slow to do. And having a decent type structure for this kind of thing sure cuts down on errors. 2) Living without branches is not a new idea - The Aiken/IBM Mark 1 computer, an amazinearly computer built at Harvard, kept its data in RAM, but its program on siz paper tape readers. To program a loop, you got out the gummed paper and literally looped the tape! instead of a branch instruction (which advances the program counter) you executed an instruction that transferred to a different tape reader. (The teaching assistants used to challenge us to save room on the machine by coming up with a useful loop that used Mobius encoding. ---David Philip Oster --------------------- ``What do you look like when you aren't visualizing?'' Arpa: oster@lapis.berkeley.edu Uucp: ucbvax!ucblapis!oster