On a sunny day (Mon, 23 Apr 2018 10:09:11 +0100) it happened The Natural
Philosopher wrote in :
>On 23/04/18 09:55, jack4747@gmail.com wrote:
>> Il giorno lunedì 23 aprile 2018 10:16:01 UTC+2, Gordon Henderson ha
scritto:
>>
>>> I have looked at compiling my BASIC to native code - and there is more
>>> or less a 1:1 relationship with a line of BASIC and a Line/Block of ASM
>>> - it's no-where near efficient as C though (and 'compiling' BASIC into
>>> C is just as easy and may actually result in faster code, but that's a
>>> job for another day)
>>
>> It's not that C is inherently efficient, it's the compiler that optimize the
asm.
>> If you compile a C source code with optimization disabled, you'll get a
(almost) 1:1 relationship line of C : line of asm.
>>
>> Bye Jack
>>
>I think that is only half of it: The other half is that C IS assembler,
>written in shorthand. I cannot offhand think of any native c operation
>that is not an atomic assembler operation.
I am not sure that is correct.
Accessing structures and members of structures comes to mind.
>Ok sometimes on some processors operation on the contents of memory are
>two opcodes.
>
>The difference with for example C++ is astonishing.
C++ is a crime against humanity, a sad failed attempt to change C
into an object oriented language.
C++ is the reason for all bloated software in the known universe,
including, but not limited to, Mikeysoft.
Just a question, now that all of you are ready to throw pies,
did any of you guys ever read Dr Dobbs magazine long ago?
I always found that inspiring, for sure some software coding methods in C
I picked up from that.
Not sure what became of it, stopped reading it when the world wide spiders
took over, as google and wikipedia answer most questions.
stackexchange.com is for example a good site.
Linked lists in C in Dr Dobbs comes to mind.
There is no need for C++, really, Linus does not want it in the kernel either.
And of course the power of C is in the libraries, libc, there are many,
for almost anything.
If you want to write a new language than you have to supply libraries.
The other point is portability, C runs on - there is a compiler for,
almost any platform.
Unfortunately these days people invest time in snakes, some dangerous like
Pythons,
not in languages close to the hardware they actually use.
My take.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|