:: Re: [DNG] Why C/C++ ?
Góra strony
Delete this message
Reply to this message
Autor: Peter Duffy
Data:  
Dla: dng
Temat: Re: [DNG] Why C/C++ ?
Coming in a bit late in this discussion - sorry.

I've loved C from the time I first learnt it (Metacomco C for the
Sinclair QL). I'm never managed to work out why I took to it in the way
I did. I rarely write C (perl is my go-to language, either for quick-
and-dirty projects, or for prototyping something bigger - but I write
perl so that it looks like C). But I find I can read C almost as
readily as I can read written English.

I've always found the history of C fascinating. The story of how unix
came about has a lot of variants - but one fundamental thing seems to
have been Ken Thompson's need to run his Multics file system module on
a PDP-7 rather than the computer on which he was developing it. (One
version of the story is that it was to enable him to play his game
"Space Travel" on the PDP-7.) Initially, he did it in assembly
language, and this continued to be used as other members of the team
integrated their own modules into the new system. One idea which began
to emerge during this work was that of a "portable" operating system.
Up to that point, every brand of hardware had its own custom operating
system (licensed by the hardware manufacturer). A system which could be
ported from one hardware platform to another would have obvious and
massive advantages. 

Presumably, some of the team members were aware of the BCPL language,
which had been one of the first languages to focus on portability
(somewhere, I've still got my copy of the "BCPL book", which contains
the source code for much of the compiler). This apparently led to the
idea of a language which was powerful and versatile enough to code an
entire operating system. Then, to transfer the OS to a new hardware
platform, it should only be necessary to implement a compiler for the
language in the context of the new platform's current system, or a
cross-compiler on the existing one, and then the entire OS could be
recompiled for the new platform (it would always be necessary to do
some work at the assembly level to interface the system with the new
hardware). Working on this basis, the team came up with a language
which they called B (presumably A must have vanished without trace) -
and eventually further work led to C.

So C was originally created so that unix could be rewritten in it.

(BTW - I've been trying to figure out which came first - unix, or the
other "portable" OS, CP/M. As far as I can make out, unix preceded CP/M
by about 4 years.)

On Thu, 2024-08-08 at 10:51 -0400, Hendrik Boom wrote:
> On Thu, Aug 08, 2024 at 09:35:50AM -0500, o1bigtenor via Dng wrote:
> > On Thu, Aug 8, 2024 at 8:52 AM Dan Purgert via Dng
> > <dng@???>
> > wrote:
> >
> > > On Aug 08, 2024, David Billsbrough wrote:
> > > > Hello Dan and all,
> > > >
> > > > Quoting somebody on this mail list:
> > > >
> > > > > If you're trying to start up a new hobby, and expect to be
> > > > > using these
> > > > > tools every weekend; well, you're going to need that set of
> > > > > $40 tools
> > > > > when the $5 set breaks / ruins something / whatever.  Might
> > > > > as well
> > > > > spend the $40 today instead of $5 today and $40 anyway in 2
> > > > > months.
> > > >
> > > > [...] Tool prices, etc. comments. [...]
> > > > SO anyways ...
> > > >
> > > > In the virtual (digital) world this **idea** does' NOT also
> > > > work the
> > > > same way at all.
> > > >
> > > > You can use FREE (beer or speech) software that meets and
> > > > exceeds some
> > > > or most *TOP* dollar software offerings.  Well because that
> > > > just the
> > > > way that it is!
> > >
> > > You completely misunderstood the analogy I'm making...
> > >
> > > Scenario:  OP is fighting with Python a bit in order to use
> > > MicroPython
> > > (or a variant thereto) to program a microcontroller.
> > >
> > > I'm telling him that *IF* he's trying to do this as more than a
> > > "one-off", he might as well learn C/C++ (via Arduino) now, rather
> > > than
> > > waiting on it.
> > >
> > > Python = "Cheap tool" (It'll get the job done, if all you need is
> > > this
> > > one thing)
> > >
> > > C/C++ = "Expensive tool" (It'll "hurt the wallet", but you'll
> > > have it
> > > forever).
> > >
> > > I wasn't going to bite but you keep insisting so:
> >
> > Why is C/C++ so absolutely wonderful?
>
> Primarily because C (not C++) has been around for a longer time
> than most other tools.  Old enough that it was around when Linux got
> written and it has become the interlingua for Linux software.
>
> Not because it's a great language.
>
> It was a breath of fresh air in the 1970's, but by now language
> technology has advanced a lot since then.
>
> Still, to interface with anything at the level of C, you need
> something that will work at that level, be it C or some other
> systems language.  I would have been happy if Modula 3 had
> caught on the way C did, but it didn't.
>
> -- hendrik
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng