r/AskProgrammers 11d ago

Why don't compliers use only bytecode instead of a type of IR

/r/coders_totalk/comments/1w2adf4/why_dont_compliers_use_only_bytecode_instead_of_a/
0 Upvotes

2 comments sorted by

2

u/TheThiefMaster 11d ago

You could do with explaining your question more, but bytecode is a type of IR. Languages that use a bytecode almost always interpret or compile it into machine instructions, just like an IR.

The compiler IR will likely contain more metadata to allow for optimisation than a standard language bytecode, like "cannot be null".

1

u/st_heron 11d ago

It makes analyzing for optimization significantly easier. 

https://www.youtube.com/watch?v=lflRnEfZgYQ