Skip to main content

Java How can an interpreter run code without translating into machine code?

after reading several posts about interpreters, I got confused, and I hope you could help me understand it better (no need for profundity; I'm in my intro classes). Specifically, in regard and trying to understand how a Java compiler works.

  Most of the posts I saw said a compiler translates A to B (which could be machine code) to run, andwhile an interpreter 'just' runruns the code. but they didn't explain howHow can the machine can run itcode with just an interpreter. I don't understand how an interpreter can run the code, without producing or translating the code into machine code.? Does it have acall built-in precompiled code of the functions it needs, and then it calls them? ifIf not, how thencan the machine run it- because? I learned it only understand understands bits. Thank you

Java interpreter

after reading several posts about interpreters, I got confused, and I hope you could help me understand it better (no need for profundity; I'm in my intro classes). Specifically, in regard to Java.

  Most of the posts I saw said a compiler translates A to B (which could be machine code) to run, and interpreter 'just' run the code. but they didn't explain how the machine can run it with just an interpreter. I don't understand how an interpreter can run the code without producing or translating the code into machine code. Does it have a built-in precompiled code of the functions it needs, and then it calls them? if not how then the machine run it- because I learned it only understand bits. Thank you

How can an interpreter run code without translating into machine code?

I'm in my intro classes and trying to understand how a Java compiler works. Most posts said a compiler translates A to B (which could be machine code) to run, while an interpreter 'just' runs the code. How can the machine run code with just an interpreter, without producing or translating the code into machine code? Does it call built-in precompiled code of the functions it needs? If not, how can the machine run it? I learned it only understands bits.

Question Protected by gnat
Became Hot Network Question
Source Link
miiky123
  • 241
  • 2
  • 6

Java interpreter

after reading several posts about interpreters, I got confused, and I hope you could help me understand it better (no need for profundity; I'm in my intro classes). Specifically, in regard to Java.

Most of the posts I saw said a compiler translates A to B (which could be machine code) to run, and interpreter 'just' run the code. but they didn't explain how the machine can run it with just an interpreter. I don't understand how an interpreter can run the code without producing or translating the code into machine code. Does it have a built-in precompiled code of the functions it needs, and then it calls them? if not how then the machine run it- because I learned it only understand bits. Thank you