unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Frank da Cruz <fdc@columbia.edu>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Liam Stitt <stittl@cuug.ab.ca>, Frank da Cruz <fdc@columbia.edu>,
	Mike <michael@rmrco.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: C-kermit fails
Date: Fri, 31 Jul 2020 14:22:31 -0400	[thread overview]
Message-ID: <CAKqtx9-eJ5P+SLWz7zm-VQm9YNy+Y_uRfDWw0iysz=as2uTRNw@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.21.2007311327120.1926041@eddie.linux-mips.org>

On Fri 32 Jul 2020 Maciej W. Rozycki <macro@linux-mips.org> wrote:
> Since you already use #ifdefs to provide code alternatives then may I
> suggest that you keep the relevant piece for the systems where the gain
> from using getchar/getc is actually noticeable and switch to documented
> standard interfaces for contemporary systems?
>
That's what I have always done since C-Kermit first appeared in 1985, and
it's why C-Kermit is so full of #ifdefs.  Although I'm not sure I accept it
is incumbent on developers to stop using fread because somebody can't be
bothered to implement a politically correct way to peek into the buffer to
see if any characters are there.  This is necessary to prevent the program
from blocking on an input request at a time when it might productively be
doing something else.  Which is a classic problem that must be solved in
every terminal emulator.  Of course there are more modern ways to write
terminal emulators, e.g. using threads or whatever, but these are not
available on all the platforms where C-Kermit runs.  Not even select() is
available on all those platforms. But the whole point of C-Kermit is to not
have to write a whole new program for each platform, but to have a single
code base that is portable among as many platforms as possible.

I have no control over what operating-system makers do (or the makers of
glibc), and if they think it's OK to break existing applications I'll have
to program around it when I could likely be doing something more useful.
But ever since Unix went public, and especially since the free versions
appeared, I find that I spend more time redoing everything I already did
before than I spend doing anything new.  Software development was not like
this when computing was dominated by companies like IBM and DEC, who were
dedicated to preserving their customers' investments in software because if
they didn't, they'd lose those customers.

- Frank


On Fri, Jul 31, 2020 at 8:41 AM Maciej W. Rozycki <macro@linux-mips.org>
wrote:

> On Fri, 24 Jul 2020, Frank da Cruz wrote:
>
> >  The reason I use getchar/getc is that Kernighan and Plauger recommend it
> > because it's buffered and avoids needless context switches.  I'm sure you
> > guys don't care much about the efficiency of character loops, but some of
> > the ancient machines where C-Kermit runs are pretty slow.
>
>  I can't speak for other people, but myself I do care, and I also enjoy
> using vintage computers, although maybe not as old as DECSYSTEM-20 (a VAX
> is probably the oldest piece I have).
>
>  Since you already use #ifdefs to provide code alternatives then may I
> suggest that you keep the relevant piece for the systems where the gain
> from using getchar/getc is actually noticeable and switch to documented
> standard interfaces for contemporary systems?
>
>  This way you'll keep the benefits for everyone: much needed performance
> for the old systems and portability for current systems where any gain
> from fiddling with libc internals accidentally exposed is lost in the
> noise?
>
> >  Computers and
> > operating systems are supposed to serve the needs of human beings.  But
> > when you make non-backward-compatible changes to operating systems that
> > break existing applications, you force people to stop what they are
> working
> > on (a cure for some deadly disease, perhaps) and search for a new version
> > of the application they were using that "complies" with the new
> "standard",
> > and then, not finding one, hunt down and contact the developers, if they
> > are still alive, and beg them to "update" their software.
>
>  Yes, this is painful indeed, and much overlooked by software developers
> nowadays IMO.
>
> > At Columbia U the transition from DEC-20 to Unix (DEC Ultrix at first)
> was
> > a massive job; NO software could be ported, all the applications had to
> be
> > rewritten from scratch, in C of course.  But going from Ultrix to SunOS
> to
> > Solaris and finally to Linux was relatively painless.  So I think the
> > objective of Unix OS developers should be *towards* compatibility rather
> > than away from it, as seems to be the case with glibc.
>
>  This is why we have a set of standards for the interfaces we promise to
> support.  Please try and stick to them.
>
>   Maciej
>

  reply	other threads:[~2020-07-31 18:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 16:29 C-kermit fails Mike
2020-07-24 16:33 ` Florian Weimer
2020-07-24 17:36 ` Zack Weinberg
2020-07-24 18:47   ` Paul Eggert
2020-07-24 19:41     ` Frank da Cruz
2020-07-24 19:45       ` Frank da Cruz
2020-07-24 20:05       ` Zack Weinberg
2020-07-27  8:10         ` Florian Weimer via Libc-alpha
2020-07-24 21:07       ` Paul Eggert
2020-07-24 23:45         ` Frank da Cruz
2020-07-25  1:59           ` Paul Eggert
2020-07-31 12:41           ` Maciej W. Rozycki
2020-07-31 18:22             ` Frank da Cruz [this message]
2020-07-31 20:23               ` Paul Eggert
2020-08-01  0:17                 ` Frank da Cruz
2020-08-01  8:07                   ` Paul Eggert

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to='CAKqtx9-eJ5P+SLWz7zm-VQm9YNy+Y_uRfDWw0iysz=as2uTRNw@mail.gmail.com' \
    --to=fdc@columbia.edu \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@linux-mips.org \
    --cc=michael@rmrco.com \
    --cc=stittl@cuug.ab.ca \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).