Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!ncis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!rutgers!tut.cis.ohio-state.edu!osu-cis!killer!elg From: elg@killer.DALLAS.TX.US (Eric Green) Newsgroups: comp.lang.misc Subject: Re: Bondage and Discipline Languages Message-ID: <6839@killer.DALLAS.TX.US> Date: 19 Jan 89 04:33:54 GMT References: <8901180542.AA20739@yorkville.csri.toronto.edu> Organization: The Unix(R) Connection, Dallas, Texas Lines: 49 in article <8901180542.AA20739@yorkville.csri.toronto.edu>, sam@csri.toronto.edu (Samuel Weber) says: > In article eric@snark.uu.net >>In article <1226@indetech.uucp>, david@emerald.UUCP (David Kuder) writes: >>> Speaking of *obvious* examples, what isn't a B&D language? >>C. C++. Lisp. Basic. Fortran. Any assembler. > What!!! I am willing to admit that Lisp might not be B&D, but C and > C++ are unquestionably one of the worst bondage and disipline languages > around! Both of these languages force one to adhere to an artificial > program/data distinction, as if there was some carved-in-stone > declaration of which bytes happened to be code, and which data. If > I want to write self-modifying code, and the language prevents me > because the designer thought that self-modifying code was a 'bad > thing', Note that self-modifying code will break on most processors with seperate C-cache and D-cache. The D-cache is usually write-through, but not the C-cache. Writing code through the D-cache won't update the cached code in the C-cache. Also note that most modern operating systems (e.g. BSD4.[23]) page code directly from the object file, and share this RAM image between all instances of the running program. E.g. if you have four Emacs's running, you only have a single instance of the code segment shared amongst all four Emacsen. Self-modifying code would mean that the code segment would no longer be sharable, meaning a MUCH higher swapping/paging overhead. There are good reasons for not having self-modifying code. It is thus silly to say that a language is "B&D" for not supporting it. Re: what is NOT B&D: How about "any language in which you can write a device driver is not B&D." Unfortunately, it's just as easy to write a device driver in Pascal or Modula II as it is in "C" (although you have to use unions to do so). > especially irritating is that even though many people, such as the > designers of Lisp, approved of self-modifying code, the designers > of C and C++ decided to single-handedly legislate it out of existance. Hardware and OS designers legislated it out for efficiency reasons. Self-modifying code in Lisp runs in the D-space, and is NOT shared amongst processes. This has an obvious efficiency hit when you have ten people all on the same system running that program. -- Eric Lee Green ..!{ames,decwrl,mit-eddie,osu-cis}!killer!elg Snail Mail P.O. Box 92191 Lafayette, LA 70509 Netter A: In Hell they run VMS. Netter B: No. In Hell, they run MS-DOS. And you only get 256k.