The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Charles Anthony <charles.unix.pro@gmail.com>
To: Lawrence Stewart <stewart@serissa.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] where did "main" come from?
Date: Fri, 22 May 2020 15:08:15 -0700	[thread overview]
Message-ID: <CANV78LQ1SNsLBf3fW9jAp_O8m86sajLoJuVymkfoLuMQ0NTC7Q@mail.gmail.com> (raw)
In-Reply-To: <BC361958-C8A0-4F42-8E9D-A3E981749CCC@serissa.com>

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

On Fri, May 22, 2020 at 11:54 AM Lawrence Stewart <stewart@serissa.com>
wrote:

>  I can’t find an online copy of the Bell Laboratories BCPL manual
> (Canaday/Thompson) from 1969 or anything about how to use BCPL on Multics
> or CTSS.


In general, Multics does not have a concept of "main"; the entry point of a
program is the name of the program. Looking at the Multics runoff sources
(written in BCPL) we see in the segment runoff_driver.bcpl:

external
     $(   RunoffCommand = "runoff"
...


let RunoffCommand () be main
     $(   MONITOR := Open (StreamName + Write, "error_output")        //
 Errors, etc. written here.
...

BCPL replaces the name RunoffCommand with runoff during compilation; the
compiled segment runoff_driver will have an entry point "runoff". Entering
the command "runoff" will search segments in the search path for that entry
point.

Since segments can have multiple entry points, the idea of "main" (or
"start" or "start_") as the defining entry point is not meaningful in
Multics.

The Multics C compiler (based on PCC) does have a  concept of main; the C
linker aliases that to the segment name, making the entry point name the
same as the segment name. Thus compiling and linking foo.c generates a
segment foo with an entry point foo, which points to main. (Actually, it
aliases it to the C runtime library initialization which calls main.)

-- Charles
-- Charles

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

      parent reply	other threads:[~2020-05-22 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 18:43 Lawrence Stewart
2020-05-22 20:01 ` Michael Kjörling
2020-05-22 21:52 ` Clem Cole
2020-05-22 22:00   ` Rob Pike
2020-05-22 23:33   ` Toby Thain
2020-05-22 23:58     ` Win Treese
2020-05-22 22:08 ` Charles Anthony [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANV78LQ1SNsLBf3fW9jAp_O8m86sajLoJuVymkfoLuMQ0NTC7Q@mail.gmail.com \
    --to=charles.unix.pro@gmail.com \
    --cc=stewart@serissa.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).