:: Re: [DNG] Learning C (books)
Top Page
Delete this message
Reply to this message
Author: Didier Kryn
Date:  
To: dng
Subject: Re: [DNG] Learning C (books)
Le 29/09/2024 à 20:30, o1bigtenor via Dng a écrit :
>
>
> On Sun, Sep 29, 2024 at 12:05 PM Didier Kryn <kryn@???> wrote:
>
>     Le 28/09/2024 à 23:40, Wm. Moss via Dng a écrit :
>     > In my opinion, most people who code should not be using a language
>     > that allows for pointer access, pointer arithmetic, and the
>     other low
>     > level access and side effects that are built into the language.
>     That
>     > said, there are to my knowledge no good Algol based languages in
>     > common use. Pascal and its progeny (Modular, Modular-2, Modular-3)
>     > never caught on and the original Iron Man became a horror of
>     > complexity as Ada. The current P-Code languages such as Python and
>     > Java are, for me, too slow and exhibit an annoying syntax.
>     Propriety
>     > languages such as PL/I could have succeeded if their parent
>     companies
>     > had released them into the public domain.
>
>          I beg to disagree about the Algol family. Pascal seems now
>     outdated, but Ada is in use everywhere human life is at stake. It
>     is not
>     a horror of complexity. It is verbose, particularly when compared
>     to C,
>     but much easier to read. Except for fast prototyping, a line of
>     program
>     is written once and read many times; therefore reading matters
>     more. Ada
>     can do simple things simply and, obviously, complicated things in
>     a more
>     complicated way. You don't need to know about "tagged records"
>     (objects)
>     to write Ada programs. C++ forces you to OOP, Ada offers several
>     solutions in most cases; you don't need objects to write generic
>     subprograms. Everything is easier in Ada than in C++.
>
>
> With this I would want to ask - - - how available are the software 
> tools to allow
> me to use things like Ada or maybe even Oberon?
>
> Then , in practical terms, how does the speed of processing compare 
> between
> C, C++, Ada and Oberon?


    Dunno about Oberon. For Ada you got GCC. Just 'apt-get install gnat'.

    For processing speed, at 1st aproximation it must be the same for
all compiled languages provided by GCC, for the following reason:

    All GCC language front-ends convert instructions to a common
intermediate code; then this code is converted to assembler and then the
assembler source is ... well, assembled. Optimisations happen at all steps.

    All instructions in all languages boil down to the same:
expressions, assignments, branching and loops. The difference is in how
rich and sophisticated the data representation may be, what is
permitted, how expressive the language is in all these things and what
safety features the language provides to the programmer. Safety features
may be exercised at compile time and at run time.

    You may have differences in compile time, I guess, but practically
none in run time. If there are differences, nothing tells you, for a
given application, which language would let you gain  a few microseconds.

    If you write programs in Ada, the first thing you will notice is
you get a number of compiler errors, but, when you've corrected your
errors the program generally runs without error: the debugging step is
dramatically reduced, compared to C.

--     Didier