:: Re: [Dng] John Goerzen asks, "Has m…
Página Principal
Delete this message
Reply to this message
Autor: Hendrik Boom
Data:  
Para: billmoss
CC: Dng
Assunto: Re: [Dng] John Goerzen asks, "Has modern Linux lost its way?"
On Thu, Feb 12, 2015 at 02:51:34PM -0500, william moss wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 02/12/2015 01:42 PM, Hendrik Boom wrote:
> > On Thu, Feb 12, 2015 at 11:25:46AM +0100, Didier Kryn wrote:
> > ...
> >>
> >> I have been programming in C
> >> from the beginning of the 80's and loved it, but I think C++ is
> >> wrong by design (personal thought), although I have no choice but to
> >> use programs written in that language, as well as Perl, Python and
> >> Ruby, which I have no opinion about.
> >
> > I share your opinion about C++. I too used to use C, since the
> > mid-seventies. Except for its abysmal identification of array
> > subscripting with pointer arithmetic, it's a very clean assembler
> > replacement.
> >
> > C++'s marketing success was to be compatible with C. It no longer is,
> > though. And C++'s complelxity is too much for me.


It's no tthat I can't figure out what C++ does -- I once wrote most of
a C++ parser and sesmantic checker -- but it gets in the way of
understanding my program.

> >
> > I occasionally use C++'s objects. But for the most part, I try to
> > write my C code so it indifferently compiles under C++ or C. Yes,
> > if means some #if's. But C++ statically catches some errors that C
> > doesn't.
> >
> > I strongly suspect that most of the code nowadays written in C++ could
> > better have been written in Modula 3. The kind of guaranteed instant
> > response you can in principle get without garbage-collection pauses are
> > not needed for almost all software.
> >
> > But I'd appreciate a more compact syntax for Modula 3, while retaining
> > its semantics.
> >
> > -- hendrik
> > _______________________________________________
> > Dng mailing list
> > Dng@???
> > https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> >
>
> C++, originally C with Classes, was a great idea. It added Smalltalk
> like abstractions to data and bound data to methods. This is long in the
> past and I no longer use C++. C, in its ANSI/POSIX/ISO incarnation is
> quite good. Modern C has removed some of its FORTRAN roots and fixed
> many of the K&R foibles.
>
> Pointer arithmetic is what C is all about. The original manual and the
> Programmer's Workbench both call it a portable assembler.


Yes. I understand pointer arithmeetic, and like to use it.
THe trouble is I don't normally want the integers I'm adding to a
pointer scaled by what the pointer points to. C already has a useful
subscript operation that does that. It gets really awkward to use
tricky memory layouts. All the casts to void* and back make the code
unreadable.

>
> There are no arrays in C, there is a memory region that is addressed by
> a reference. Pascal and its derivatives (Modula, Ada) do implement real
> arrays as does PL/I.
>
> For scripts, I use byte code languages (Perl mostly these days) with
> some low level modules written in ANSI C. I do however, miss using
> FORTH, CLOS and Smalltalk for real applications.


The traditional implementation of FORTH gets really bulky on a 64-bit
machine. All those huge addresses! It's why I implement my
concatenative languages with bytecodes.

> Most applications that are not critical to latency or 6 sigma
> predictability are best served with a byte code language.


I can see why it could affect latency. But predicatability?

> This places
> the burden of reliability on the developers of the run time (byte code
> machine). That said, I have probably written as much code in various
> assembly languages as in C.
>
> I have been using Unix and its analogs for 37 years, computers for
> engineering for 51 years. My first programs were written in FORTRAN-4,
> using a model 19 key punch.


I used an earlier version of Fortran. Fortran 4 hadn't been invented
yet.

-- hendrik