Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang Subject: Re: Portable Languages Message-ID: <3909@umcp-cs.UUCP> Date: Fri, 17-Oct-86 01:16:06 EDT Article-I.D.: umcp-cs.3909 Posted: Fri Oct 17 01:16:06 1986 Date-Received: Fri, 17-Oct-86 22:22:56 EDT References: <111@titan.UUCP> <139200039@uiucdcsb> <483@jc3b21.UUCP> <1455@jade.BERKELEY.EDU> Organization: Computer Sci. Dept, U of Maryland, College Park, MD Lines: 46 Summary: There is no portability without context >In article <483@jc3b21.UUCP> fgd3@jc3b21.UUCP writes: >>Your examples support my point: a _portable_ language is one which >>runs identically on all implementations. A language which permits >>the code generated by its statements to be implementation-dependent >>is not portable. You are taking an extreme position; I will be equally extremist. In article <1455@jade.BERKELEY.EDU> mwm@eris.berkeley.edu (Mike Meyer) replies: ... >I've got bad news for you. By that definition, the ONLY portable >languages are ones that are trivially portable, with only one >implementation. Indeed. Convert the following C code to your favourite `portable' language: main() { printf("\033[H\033[J"); exit(0); } Now tell me, what does it do on all implementations? But I have not defined `implementation' properly: an `implementation' is a complete system INCLUDING a display device. *Now* what does it do? It clears my H19 screen, but it does not clear the screen of the AJ510 in the machine room. Ergo, this is not a portable program. This is a ridiculous stand. Yet I claim it is little, if any, more ridiculous than that expressed in article <483@jc3b21.UUCP>. Every program must run in a context. The context can trivially alter the results of a program. The essence of portability is the ability to prevent such alteration within many contexts. (For precisionists, the program above is indeed unportable in one sense. If its purpose is to clear the screen, it is portable only between environments that use ANSI X3.64 compatible displays. If, however, its purpose is to print the string ESC [ H ESC [ J, the program is portable between all ASCII environments. Its operation on an EBCDIC machine is less well defined.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu