r/AskComputerScience • • Apr 25 '21

Does all programming turn into machine code?

I don’t know if this question makes sense but when you write code in whatever language, python, C, Java etc does it all eventually get converted into assembly and then machine code?

35 Upvotes

32 comments sorted by

View all comments

Show parent comments

2

u/Knaapje Apr 25 '21 edited Apr 25 '21

That's more of a definition question though, and not the traditional definition. Of course, code will need to be transformed to instructions in order to be executed, but saying that the code is transformed to machine code is a bit of a stretch.

Edit: for the downvoters, this is in the context of interpreters. I suggest you read up on interpreted vs compiled languages.

2

u/a4555in Apr 25 '21

Huh, to me the traditional definition of machine code is literal binary CPU instructions (or binary instructions replaced with human-readable mnemonics).

What's the traditional definition of machine code that you have come across?

3

u/Knaapje Apr 25 '21

True, that's not what I take issue with. It's that I think for an interpreted language most wouldn't say that the code is transformed.

1

u/a4555in Apr 25 '21

Ah I see. I was about to ask you to elaborate but the comment below does exactly that.