Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ucbcad.UUCP Path: utzoo!linus!decvax!microsoft!uw-beaver!tektronix!ucbcad!ucbesvax.turner From: ucbesvax.turner@ucbcad.UUCP Newsgroups: net.lang Subject: Re: Self-modifying code - (nf) Message-ID: <1248@ucbcad.UUCP> Date: Thu, 12-Jan-84 01:06:40 EST Article-I.D.: ucbcad.1248 Posted: Thu Jan 12 01:06:40 1984 Date-Received: Sat, 7-Jan-84 01:58:27 EST Sender: notes@ucbcad.UUCP Organization: UC Berkeley CAD Group Lines: 35 #R:fortune:-215700:ucbesvax:4500007:000:1642 ucbesvax!turner Jan 5 03:13:00 1984 To mention FORTH in this newsgroup is perhaps only to invite flamage (con-, and maybe pro-), but I think the problem of self-modifying code for most cases could be solved by providing a support library for building up segments of threaded code. One could then dynamically "compile" (dreaded FORTH re-definition of the word) and execute interpreted code that was as much as five times slower than *real* compiled code, but usually around five times faster than most interpreters written in high- level languages. The niches are everywhere: just about every termcap-style device- description format I've seen has a BUGS entry--"Really should be compiled." (This is true of both BSD termcap and a local, device- independent graphics driver that could use it even more.) The interactive function-plotter is another good example. Database- query compilers yet another. With a threaded-code interpreter-kernel linked as a subroutine, and some macros and routines for segment definition, exception-trapping, etc., all that is left for many applications is an infix-to-postfix converter. Recursive descent or lex/yacc can be used. Then your code can be ported to any machine with an implementation of the library. Finally, since the threaded-code kernel and support routines can be defined in a largely machine-independent way, porting the library itself would involve a fairly small, one-time-only effort. But there's a danger: someone might use it to bring up FORTH on your machine. Pretty soon, you'd have weird people all over the place, late-night drug-deals in the office, the whole bit. --- Michael Turner (ucbvax!ucbesvax.turner)