Computer Old Farts Forum
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: Paul Winalski <paul.winalski@gmail.com>
Cc: Computer Old Farts Followers <coff@tuhs.org>
Subject: [COFF] Re: [TUHS] Re: crt0 -- what's in that name?
Date: Mon, 12 Jun 2023 18:49:53 -0500	[thread overview]
Message-ID: <20230612234953.pwu7oi6hyglsaqzs@illithid> (raw)
In-Reply-To: <CABH=_VQdmR8N_O1_w7LOiroeR06S_r9z3vFoVnyhp5u5pPG2Mw@mail.gmail.com>

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

[Clem and TUHS dropped from CC]

Hi Paul,

At 2023-06-12T19:04:31-0400, Paul Winalski wrote:
> I don't think this remark was intended to denigrate Fortran in any
> way.  I took it as a wryly humorous way to make the observation that C
> and Fortran have different program startup semantics, and that there
> is other stuff that has to be done when firing up a program written
> wholly or partially in Fortran beyond what is needed to start up a C
> application.

It was really just a fart joke--you know, "breaking wind" and all that.
libcrt0.s -> libfrt0.s ...

But you're getting at an actual problem I had when trying to learn
linking and loading on Unix beyond the level of recipes keyed in by
rote.  (My upbringing was on systems with the most minimal conceivable
object file formats, and your runtime support was in either in ROM or
you provided it yourself.)  Being of a certain age, 'crt0' (a name
preserved by the GNU C compiler) looked to me for all the world like it
must have had to do with driving a CRT.  This made little sense to me,
especially when the darn thing got shoved into computation-only programs
that performed no I/O at all.  I could find no documentation, nor at
that time any local experts who could tell me what the heck "crt" was
_for_.  (The BSD advocates I knew back in the day suggested that this
was my fault for not locating and apprenticing myself to such a master;
the guild mentality was, and in some ways still is, powerful there.)

I am probably not the only person who was sent down an incorrect chain
of deductions by this "economical" naming convention; furthermore, one
employed for the sake of a file name that almost no one ever typed
anyway.

To bang an old drum of mine, while Unix culture pats itself on the back
for economizing keystrokes with an ad hoc compression scheme for every
name in sight, it too often overlooks what discarded in pursuit of this
form of minimality: clarity, lack of ambiguity, and ease of acquisition
by newcomers.

I get that Teletypes were hard to type on and baud rates were
punitively low.  But when Bell Labs got the Blit, the limitations that
motivated the original terseness were not only not discarded, but
retained and doubled down on.  "We're going multi-architecture for Plan
9, so let's allocate every machine architecture we'll ever be presented
with an identifier from a single-character alphanumeric namespace."

Madness.[1]

Decades after tcsh brought tab-completion to the shell-using masses, and
just as many decades after this feature was cloned by every Unix shell
that wasn't moribund, the defenders of keystroke minimality aren't
content to cultivate their own private name space of single-letter shell
functions, scripts, or aliases--instead they rebut the above by
complaining that GNU-style architecture triples are way too long.  Way
too long for what?  To type out in full?  Sure.  Too long to tell you
what ABI the objects produced are going to use?  No.

At least APL chose sigils that were tough to confuse with other things.

> Most operating system ABIs, Unix included, don't have a formalized
> mechanism for dealing with the differences between startup semantics
> of various programming languages.  They deal with the problem in an
> ad-hack fashion.  The one exception that I know of is VMS (now
> OpenVMS).  Tom Hastings was the architect who designed the original
> VAX/VMS ABI.  He was aware from the get-go that several programming
> languages had to be supported and he made sure that his design was
> general enough to allow programmers to write routines in the most
> suitable language for them, to mix and match modules written in
> different languages in the same program, and to easily make calls from
> one language to another.  It was a stroke of genius and I haven't seen
> its like in any other OS (several times I've wished it was there,
> though).

Thanks for mentioning this.  I think you had pointed this out some
months ago, but I had difficulty remembering the details of "who had
solved the ABI problem the right way a long time ago", but could not
remember enough of it to dredge it up even with repeated searches.

Unfortunately Google remains stymied even by the quite explicit terms

  "tom hastings" vax vms abi

...do you have a link to a white paper I could read?

I have an ecosystem in mind that might be receptive to the concept.

Regards,
Branden

[1]

  NAME
     0c, 1c, 2c, 5c, 6c, 7c, 8c, kc, qc, vc - C compilers
[...]
  DESCRIPTION

  These commands compile the named C files into object files for the
  corresponding architecture. If there are multiple C files, the
  compilers will attempt to keep $NPROC compilations running con
  currently.  Associated with each compiler is a string objtype, for
  example

  0c spim little-endian MIPS 3000 family
  1c 68000 Motorola MC68000
  2c 68020 Motorola MC68020
  5c arm little-endian ARM
  6c amd64 AMD64 and compatibles (e.g., Intel EM64T)
  7c alpha Digital Alpha APX
  8c 386 Intel i386, i486, Pentium, etc.
  kc sparc Sun SPARC
  qc power Power PC
  vc mips big-endian MIPS 3000 family

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-06-12 23:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAP6exYKUbHjLJm=PNuxtzF49NfOc3q1rpkRLeGqaPpp-=RwFTw@mail.gmail.com>
     [not found] ` <CAEoi9W4DJXEXfr=iMOnTQVedHzcOamPyvpWy413j3_=dXrMB1g@mail.gmail.com>
     [not found]   ` <alpine.BSF.2.21.9999.2306130615560.16633@aneurin.horsfall.org>
     [not found]     ` <CAC20D2PiOh-p48G83ChUYZnfHTdNXROcJsewwmbM1xnyrt4c9w@mail.gmail.com>
     [not found]       ` <20230612213912.mywv5znz66pk3n5q@illithid>
2023-06-12 22:39         ` Clem Cole
2023-06-12 22:50           ` G. Branden Robinson
2023-06-12 22:57             ` Clem Cole
2023-06-12 23:04           ` Paul Winalski
2023-06-12 23:49             ` G. Branden Robinson [this message]
2023-06-13 16:28               ` Paul Winalski
2023-06-13 17:04                 ` segaloco via COFF
2023-06-13 17:32                   ` Clem Cole
2023-06-13 17:02               ` [COFF] Re: UNIX and its users - new or old Clem Cole
2023-06-14 13:33                 ` Dan Cross
2023-06-14 15:39                   ` Clem Cole
2023-06-14 22:13                     ` Dan Cross
2023-06-15  4:20                       ` Adam Thornton
2023-06-15 12:13                         ` Dan Cross
2023-06-12 23:57           ` [COFF] Weedhopper? (was: crt0 -- what's in that name?) Greg 'groggy' Lehey
2023-06-13  0:30             ` [COFF] " G. Branden Robinson
2023-06-13  3:07               ` Clem Cole
2023-06-13  3:05             ` Clem Cole
2023-06-13  3:26               ` Bakul Shah

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=20230612234953.pwu7oi6hyglsaqzs@illithid \
    --to=g.branden.robinson@gmail.com \
    --cc=coff@tuhs.org \
    --cc=paul.winalski@gmail.com \
    /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).