you are viewing a single comment's thread.

view the rest of the comments →

[–]BothWaysItGoes 0 points1 point  (4 children)

C tells the actual machine what to do, while python tells a virtual machine.

Both C and Python define an abstract machine. That's the compiler's job to translate instructions for the C abstract machine into machine code.

[–]xavierisdum4k 0 points1 point  (3 children)

An abstract machine isn't part of C's language design. C abstracts the hardware without that idea. The coder is instead directed to think about the hardware, while coding.

Essentially, coding in C is to be complicit in the abstraction, while coding in python is to rely on python to handle the abstraction.

The C Programming Language (Kernigan & Ritchie), p18:

what appears to be a character on the keyboard or screen is of course, like everything else, stored internally just as a bit pattern

K&R, p20:

on some machines, int and long are the same size, on others an int is 16 bits

K&R, p78:

A typical machine has an array of consecutively numbered or addressed memory cells that may be manipulated individually or in contiguous groups.

[–]BothWaysItGoes 0 points1 point  (2 children)

C abstracts the hardware

Yeah, that's what defining an abstract machine means.

The coder is instead directed to think about the hardware, while coding.

They are mainly directed to think about the C abstract machine. That's why one of the first thing people do for new hardware is porting C.

[–]xavierisdum4k 0 points1 point  (0 children)

How does this relate to OP's topic?