DEV Community

loading...

Discussion on: Features of C :)

Collapse
faranaiki profile image
Muhammad Faran Aiki

No, "C to machine code" is just plain wrong. C is not interpreted. C is compiled, meaning there is no "go back and forth". If you write a programming language, let us say a compiled one, using C or using other language, and with an addition rule that the compiler can optimizes it, then the speed would be the same as C. Take a look at Rust, the language itself is using OCaml (at first, which is made using C).
Nowadays, C is compiled first to Assembly. There are some compilers that translate, assembling, C directly to machine code, TCC for example.
Python does not go to C. Who compiles Python code into C in terms of normal Python? Python use the opcode itself to optimizes itself. Take a look at the "dis" module in Python.

Thread Thread
sh4zkh4n profile image
Sh4zKh4n

Sorry your right if your going one way. I was thinking of the classic nested for loop.

For i in xxx
For b in xxx

Should have added that in. In my head that was the classic example. Back and forth.