Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: A thought of C Date: Tue, 14 Apr 2026 15:31:58 -0700 Organization: None to speak of Lines: 38 Message-ID: <87jyu9tbq9.fsf@example.invalid> References: <3a3462bdd72c4ed9d392a78b7d369a7b5ccc3b04.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 14 Apr 2026 22:31:59 +0000 (UTC) Injection-Info: dont-email.me; posting-host="1c5b9246e8aba8a96fee0a1faff36172"; logging-data="524544"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QKKlMLHFFiPHg71mAq5Yk" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:ktCyxJOpzW0SVbGuD1bSuAyULKk= sha1:xyD150t4k0ufC6hq4AqQAjMMHOQ= Xref: csiph.com comp.lang.c:397531 wij writes: > In attempting writting a simple language, I had a thought of what language is > to share. Because I saw many people are stuck in thinking C/C++ (or other > high level language) can be so abstract, unlimited 'high level' to mysteriously > solve various human description of idea. > > C and assembly are essentially the same, maybe better call it 'portable assembly'. No, C is not any kind of assembly. Assembly language and C are fundamentally different. An assembly language program specifies a sequence of CPU instructions. A C program specifies run-time behavior. (A compiler generates CPU instructions behind the scenes to implement that behavior.) > In C, we don't explicitly specify how wide the register/memory unit is, we use > char/int (short/long, signed/unsigned) to denote the basic unit. I.e. > > a=b; // equ. to "mov a,b" (Or "mov b,a" depending on the assembly syntax.) Nope. `a=b` could translate to a lot of different instruction sequences. Either or both of the operands could be registers. There might or might not be different "mov" instructions for integers, pointers, floating-point values. a and b could be large structs, and the assignment might be translated to a call to memcpy(), or to equivalent inline code. Or the assignment might not result in any code at all, if the compiler can prove that it has no side effects and the value of a is not used. [...] -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */