Text File

Aucbvax.5929 fa.info-vax utcsrgv!utzoo!decvax!ucbvax!info-vax Sat Jan 23 11:08:37 1982 Language portability >From gwyn@utexas-11 Sat Jan 23 11:03:53 1982 I've been concerned with program porting for several years, so I decided to add my 2 cents worth:

Fortran applications tend to be portable. Unfortunately, DEC Fortrans extend the language in non-standard ways, and VMS Fortran encourages the coder to use VAX-specific system calls in-line. Of course, one can still write portable code, but it requires a deliberate attempt to do so. I don't worry about the difference in floating-point accuracy etc. since all languages will have that problem, and there are well-known solutions for it.

Pascal is much less portable than people imagine. The common subset of Pascal that is supported by most compilers is generally inadequate for serious system programming or large projects. After converting the code from Ratfor to Pascal for "Software Tools in Pascal" (Addison-Wesley, 1981), Brian Kernighan wrote Bell Labs CSTR #100 entitled "Why Pascal Is Not My Favorite Programming Language" to summarize the deficiencies of the portable standard Pascal subset.

C is not machine-dependent, although one can (and many do) write machine- specific code in C. This is good for real systems work, and the "lint" verifier does a good job of flagging potentially non-portable constructs. I consider "lint" part of the compiler, just as IBM had two PL/I compilers and CDC had two Fortran compilers. C is almost strongly-typed if "lint" is considered part of the compiler, but not so strongly that one can't handle arrays of a priori unknown length as procedure arguments (as in Pascal). I know of C compilers for the following CPU architectures: BBN C Machine CDC Cyber PDP-11 VAX-11 Perkin-Elmer IBM 370 Western Electric 32-bitter 8080 Prime M68000 Z8000 DEC-10/20 in fact, most of the interesting machines. Around spring I expect DEC may announce a C for VMS, but you can get one now from Whitesmiths (no stdio library last I heard, most unfortunately, but they supply a similar one of their own design).

Bliss is perhaps better than C insofar as portability goes, but I don't know of very many architectures supporting Bliss. The PDP-11 Bliss even cannot run on a PDP-11!

One can also run Joe Sventek's portable operating system on top of many vendors' real OSs. This looks very much like a UNIX at the user level. Many RSX users obtain a decent interface by this means, with the ability to use the DEC-specific RSX utilities, etc. -------

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.