The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] ratfor vibe
@ 2022-01-31 20:46 Will Senn
  2022-02-01 15:37 ` arnold
  2022-02-03  4:00 ` Will Senn
  0 siblings, 2 replies; 75+ messages in thread
From: Will Senn @ 2022-01-31 20:46 UTC (permalink / raw)
  To: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 2961 bytes --]

All,

I have been doing some language exploration in v7/4.3bsd and came across 
Software Tools (not the pascal version). It's written using ratfor, 
which I had seen in the v7 UPM. I fired up v7 and tried my hand at the 
first example:

    # copy - copy input characters to output
             integer getc
             integer c

             while(getc(c) != EOF)
                     call putc(c)
             stop
             end

The first thing I noticed was that it read more like C than Fortran (I 
know C quite well, Fortran just a smidge)... awesome, right? So I ran 
the preprocessor on it and got the following f77 code:

    c copy - copy input characters to output
           integer getc
           integer c
    c     while
    23000 if(.not.(getc(c) .ne. eof))goto 23001
              call putc(c)
              goto 23000
    c     endwhile
    23001 continue
           stop
           end

Cool. The way it translated the EOF test is weird, but ok. Trying to 
compile it results in complaints about missing getc and putc:

    $ f77 copy.f
    copy.f:
        MAIN:
    Undefined:
    _getc_
    _putc_
    _end

Ah well, no worries. I know that they're in the c lib, but don't about 
fortran libs... Meanwhile, over on 4.3BSD, it compiles without issue. 
But running it is no joy:

    $ ./a.out
    This is a test
    $

I remembered that the authors mentioned something about EOF, so I 
tweaked the code (changed EOF to -1) and rebuilt/reran:

    $ ./a.out
    This is a test
    This is a test
    $

Fascinating. Dunno why no complaints from F77 about the undefined EOF 
(or maybe mis-defined), but hey, it works and it's fun.

I'm curious how much ratfor was used in bell labs and other locations 
running v6, v7, and the BSD's. When I first came across it, I was under 
the impression that it was a wrapper to make f66 bearable, but the 
manpage says it's best used with f77, so that's not quite right. As 
someone coming from c, I totally appreciate what it does to make the 
control structures I know and love available, but that wasn't the case 
back then, was it? C was pretty new... Was it just a temporary fix to a 
problem that just went away, or is there tons of ratfor out there in the 
wild that I just haven't seen? I found ratfor77 and it runs just fine on 
my mac with a few tweaks, so it's not dead:

    ratfor77 -C copy.r | tee copy.f
    C Output from Public domain Ratfor, version 1.0
    C copy - copy input characters to output
           integer getc
           integer c
    23000 if(getc(c) .ne. eof)then
           call putc(c)
           goto 23000
           endif
    23001 continue
           stop
           end

What's the story? Oh, and in v6 it looks like it was rc - ratfor 
compiler, which is not present in v7 or 4.3BSD - is there a backstory 
there, too?

Will




[-- Attachment #2: Type: text/html, Size: 4193 bytes --]

^ permalink raw reply	[flat|nested] 75+ messages in thread
* Re: [TUHS] ratfor vibe
@ 2022-02-01 18:19 Noel Chiappa
  2022-02-01 18:47 ` Clem Cole
  2022-02-01 21:50 ` Win Treese
  0 siblings, 2 replies; 75+ messages in thread
From: Noel Chiappa @ 2022-02-01 18:19 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Clem Cole

    > So by the late 70s/early 80s, [except for MIT where LISP/Scheme reigned]

Not quite. The picture is complicated, because outside the EECS department,
they all did their own thing - e.g. in the mid-70's I took a programming
intro couse in the Civil Engineering department which used Fortran. But in
EECS, in the mid-70's, their intro programming course used assembler
(PDP-11), Algol, and LISP - very roughly, a third of the time in each. Later
on, I think it used CLU (hey, that was MIT-grown :-). I think Scheme was used
later. In both of these cases, I have no idea if it was _only_ CLU/Scheme, or
if they did part of it in other languages.

	Noel

^ permalink raw reply	[flat|nested] 75+ messages in thread

end of thread, other threads:[~2022-02-10 15:21 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 20:46 [TUHS] ratfor vibe Will Senn
2022-02-01 15:37 ` arnold
2022-02-01 15:52   ` Ralph Corderoy
2022-02-01 16:58     ` Clem Cole
2022-02-01 17:02     ` silas poulson
2022-02-02  7:47     ` arnold
2022-02-03  5:47       ` [TUHS] more about Brian Rich Morin
2022-02-03  7:44         ` markus schnalke
2022-02-03  8:18           ` Rich Morin
2022-02-04  2:23           ` Adam Thornton
2022-02-04  2:34             ` [TUHS] more about Brian... [really Rust] Jon Steinhart
2022-02-04 13:07               ` Thomas Paulsen
2022-02-04 23:18               ` Dan Cross
2022-02-04  3:28             ` [TUHS] more about Brian Dan Stromberg
2022-02-04  5:11             ` Rich Morin
2022-02-04 21:22               ` [TUHS] Go vs. Rust, and etc. (was: more about Brian...) Greg A. Woods
2022-02-04 21:37                 ` Richard Salz
2022-02-04 22:32                   ` Steffen Nurpmeso
2022-02-04 23:05                   ` Thomas Paulsen
2022-02-04 23:15                   ` Seth J. Morabito
2022-02-05  1:41                     ` Adam Thornton
2022-02-04  7:38             ` [TUHS] more about Brian Andy Kosela
2022-02-04  8:10               ` Steve Nickolas
2022-02-04  8:44                 ` markus schnalke
2022-02-04  9:16                   ` Steve Nickolas
2022-02-04 18:54                 ` John Cowan
2022-02-04 19:45                   ` Thomas Paulsen
2022-02-04 20:28                     ` Hellwig Geisse
2022-02-04 21:03                       ` Jim Capp
2022-02-04 22:30                         ` Steffen Nurpmeso
2022-02-04 22:25                       ` Steffen Nurpmeso
2022-02-06  0:56                       ` Larry McVoy
2022-02-06  1:10                         ` Will Senn
2022-02-06  4:52                           ` Rob Pike
2022-02-06  4:58                             ` Dan Halbert
2022-02-06  5:06                             ` Will Senn
2022-02-06  6:19                             ` Ed Carp
2022-02-06  6:27                               ` Rob Pike
2022-02-06  6:40                                 ` Stuart Remphrey
2022-02-06  6:44                                 ` Bakul Shah
2022-02-06 19:08                                   ` Steffen Nurpmeso
2022-02-06 12:52                                 ` Ralph Corderoy
2022-02-06 13:14                                 ` Ed Carp
2022-02-06 14:13                                   ` Dan Cross
2022-02-06 14:15                                   ` Larry McVoy
2022-02-06 16:31                                     ` Warner Losh
2022-02-06 18:36                                     ` [TUHS] more about Brian... [ really GC vs malloc/free languages ] Jon Steinhart
2022-02-06 19:27                                     ` Jon Steinhart
2022-02-06 19:33                                       ` Warner Losh
2022-02-06 19:37                                         ` Jon Steinhart
2022-02-06 20:21                                           ` [TUHS] COFF is over there Ralph Corderoy
2022-02-06 16:16                           ` [TUHS] more about Brian Brad Spencer
2022-02-08  5:22                             ` Ed Carp
2022-02-03 18:57       ` [TUHS] ratfor vibe silas poulson
2022-02-04  8:26         ` arnold
2022-02-04 19:41           ` John Cowan
2022-02-10 15:18       ` Ralph Corderoy
2022-02-03  4:00 ` Will Senn
2022-02-03  4:31   ` Al Kossow
2022-02-03  5:16     ` Warner Losh
2022-02-03 20:00   ` Adam Thornton
2022-02-04  6:06     ` Ori Idan
2022-02-04 17:35       ` Adam Thornton
2022-02-04 17:44         ` Will Senn
2022-02-01 18:19 Noel Chiappa
2022-02-01 18:47 ` Clem Cole
2022-02-01 19:10   ` Dan Cross
2022-02-01 19:39     ` Clem Cole
2022-02-01 21:21       ` Dan Cross
2022-02-01 21:33         ` Clem Cole
2022-02-01 23:12           ` John Cowan
2022-02-01 19:39   ` Richard Salz
2022-02-01 22:30   ` Erik E. Fair
2022-02-02  0:54     ` Yeechang Lee
2022-02-01 21:50 ` Win Treese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).