Xref: utzoo comp.lang.fortran:1428 comp.lang.c:13682 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!decwrl!sun!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.fortran,comp.lang.c Subject: Re: isomorphic languages Message-ID: <604@quintus.UUCP> Date: 31 Oct 88 03:36:38 GMT References: <75326@sun.uucp> <75328@sun.uucp> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 37 In article <75328@sun.uucp> khb@sun.UUCP (Keith Bierman - Sun Tactical Engineering) writes: >In article <75326@sun.uucp> dgh%dgh@Sun.COM (David Hough) writes: >>Thesis: Language designers (including X3Jn committees) needn't >>incorporate every bad syntax of the past if revised versions are >>syntactically isomorphic. >Also if the original program was readable (well indented, and >commented, etc.) the converted (or doubly converted) should still be. In _one_ respect, such a conversion is easier for Fortran, because Fortran 77 only permits comments _between_ statements. Bierman asks for the translation to be invertible if the F8x version doesn't use anything not in F77, a backwards translator wouldn't have to get within-statement comments exactly right. This problem is familiar to people who've tried to translate between Lisp (or Prolog) dialects. For a C illustration of the problem, suppose that the replacement for for (; ; ) were for doing while do repeat and consider input like for (p = &(this->link[i]); /* Note that in this loop over */ *p != NULL; /* the ith bucket, p is a POINTER */ p => &(p->next) /* to a pointer to an entry, NOT */ ) { /* a pointer to an entry. */ .... } The reordering of the constituents in the revised language is going to do terrible things to the text of the comment... This is not a problem with programs which conform to the F77 standard, as it provides no way of writing such comments. But some _processors_ which conform to the F77 standard provide in-line comments as an extension. (Perhaps the majority of such processors?) Don't expect it to be easy to preserve good indentation and commenting. [If anyone knows how to do it, please tell me at once!]