By: ? (0xe2.0x9a.0x9b.delete@this.gmail.com),
Room: Moderated Discussions
anon (anon@anon.com) on 6/11/10 wrote:
---------------------------
>iirekm (iirekm@gmail.com) on 6/11/10 wrote:
>---------------------------
>>Linus Torvalds (torvalds@linux-foundation.org) on 6/5/10 wrote:
>>---------------------------
>>
>>>And I really do dislike C++. It's a really bad language, in
>>>my opinion. It tries to solve all the wrong problems, and
>>>does not tackle the right ones. The things C++ "solves"
>>>are trivial things, almost purely syntactic extensions to
>>>C rather than fixing some true deep problem.
>>>
>>>(The C++ objects, templates and function overloading are
>>>all just syntactic sugar. And generally bad syntax
>>>at that. And C++ actually makes the C type system actively
>>>worse.)
>>
>>Well, the more high-level a programming language is, the more syntactic sugar it
>>has. How C language improves Assembler:
>>- syntactic sugars (for example just c = a + b instead of:
>>mov eax, a
>>add eax, b
>>mov c, eax)
>
>Utter rubbish. C presents a (relatively) well defined and portable programming model.
What do you mean? The assembly code is *highly* portable, I would say it is more portable than C.
Just because "mov eax,a" contains the term "eax", it does *not* necessarily mean that the CPU has to have such a register. The "eax" can be simply treated as a variable. Then, on some other CPU without "eax", the compiler can treat it as an ordinary variable and optionally an optimizing compiler can put the "eax" variable into an architectural register.
---------------------------
>iirekm (iirekm@gmail.com) on 6/11/10 wrote:
>---------------------------
>>Linus Torvalds (torvalds@linux-foundation.org) on 6/5/10 wrote:
>>---------------------------
>>
>>>And I really do dislike C++. It's a really bad language, in
>>>my opinion. It tries to solve all the wrong problems, and
>>>does not tackle the right ones. The things C++ "solves"
>>>are trivial things, almost purely syntactic extensions to
>>>C rather than fixing some true deep problem.
>>>
>>>(The C++ objects, templates and function overloading are
>>>all just syntactic sugar. And generally bad syntax
>>>at that. And C++ actually makes the C type system actively
>>>worse.)
>>
>>Well, the more high-level a programming language is, the more syntactic sugar it
>>has. How C language improves Assembler:
>>- syntactic sugars (for example just c = a + b instead of:
>>mov eax, a
>>add eax, b
>>mov c, eax)
>
>Utter rubbish. C presents a (relatively) well defined and portable programming model.
What do you mean? The assembly code is *highly* portable, I would say it is more portable than C.
Just because "mov eax,a" contains the term "eax", it does *not* necessarily mean that the CPU has to have such a register. The "eax" can be simply treated as a variable. Then, on some other CPU without "eax", the compiler can treat it as an ordinary variable and optionally an optimizing compiler can put the "eax" variable into an architectural register.


