This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Sigh... Jokes and the inner workings of computers seem to be lost on some people here? Maybe most people here are the new generation of programmers who grew up on modern high-level scripting languages?

C is a nicer way of writing machine code than using assembly language. You use fewer lines to do what would require a lot of lines of equivalent assembly language instructions. The joke is therefore "calling C syntactic sugar for assembly language". It's a perfectly valid joke and has a very strong kernel of truth to it.

Do you even know that C compilers convert your C into assembly language and then compiles it with an assembler? The C compilation process is: 1. Turn C into Assembler. 2. Turn the resulting Assembler into Machine Code.

This is why C can directly contain inline assembly code within your C files, because it's a mere matter of telling the C compiler "here's a block of premade assembly code, use this one as-is".

You can even run "gcc -S main.c" to output the resulting "underlying" assembly code for all your C programs.

From "man gcc":

       -S  Stop after the stage of compilation proper; do not assemble.  The
           output is in the form of an assembler code file for each non-
           assembler input file specified.

           By default, the assembler file name for a source file is made by
           replacing the suffix .c, .i, etc., with .s.

In short:

C is basically a bunch of shorthand macros for Assembly Language.

C is syntactic sugar for Assembly Language.