Path: utzoo!mnetor!uunet!husc6!necntc!drilex!dricej From: dricej@drilex.UUCP (Craig Jackson) Newsgroups: comp.arch Subject: Re: FORTRAN Horror Message-ID: <515@drilex.UUCP> Date: 23 Mar 88 16:44:36 GMT References: <24861@yale-celray.yale.UUCP> <1135@pembina.UUCP> <2424@saturn.ucsc.edu> <25461@yale-celray.yale.UUCP> Reply-To: dricej@drilex.UUCP (Craig Jackson) Organization: Data Resources/McGraw-Hill, Lexington, MA Lines: 44 Summary: All languages have a little of this In article <25461@yale-celray.yale.UUCP> lisper-bjorn@CS.YALE.EDU (Bjorn Lisper) writes: >In article <2424@saturn.ucsc.edu> haynes@ucscc.UCSC.EDU (Jim Haynes) writes: >>We have to keep in mind that FORTRAN was originally designed to >>make it easier to program one architecture, the IBM 704 with up >>to 4K of 36-bit memory. I believe the whole idea of a language >>as a machine-independent way to program evolved later (correct/flame >>me if I'm wrong). So getting the machine-dependent features out >>of the language has been like pulling teeth. >I've been told that arithmetic IF in FORTRAN, IF (E) L1,L2,L3 where E is an >arithmetic expression and L1 - L3 are lines in the program to jump to >dependent on the sign of E, translated, except for the evaluation of E, to >one single instruction on that machine. >The instruction repertoire of old IBM machines also had an impact on other >"high-level" languages, like for instance LISP. CAR and CDR were apparently >the names of instructions to access left and right halfword, respectively, >on the IBM 7090. The CAR and CDR pointers were stored in halfwords in this >manner in this LISP system. I've long been fascinated with how the architecture of their first implementation affects languages. Many so-called machine-independent languages actually reflect quite a bit of the hardware available to their designers. For example, would Pascal have had packed & unpacked arrays if Wirth had been working on a byte-addressable machine, vs the word addressable CDC 6000? I suspect not. Also, would C have had the '++' & '--' operators had the underlying machine not had autoincrement & autodecrement? I think it might have, but certainly the addressing modes may have put ideas into Ritchie's head. A more definite example is the float == double assumption that runs through K&R C. On the PDP-11, it is extra work to switch the floating point unit between single and double precision. I'm certain that it was much easier just to leave everything in double. Can anybody else point to other examples of this? Are there any in Cobol or Ada, or other committee-designed languages? -- Craig Jackson UUCP: {harvard!axiom,linus!axiom,ll-xn}!drilex!dricej BIX: cjackson