I have a doubt in a question which i was given in an exam. Is there any answer to it, "which one takes least time to execute bytecode or three address code?" I have surfed it all over the net but could not find anything in comparison of them. Kindly help!
Asked
Active
Viewed 56 times
0
-
None of them are meant to be executed directly, so this can't be answered out of context. FWIW, I don't believe the choice has any direct bearing on the efficiency of the final machine code output (assuming a native compiler). – 500 - Internal Server Error Aug 16 '21 at 16:08
-
2What's the difference between "bytecode" and "three address code"? This needs to be explained in the question. In my mind, "three address code" is a style of bytecode. – boneill Aug 16 '21 at 16:12
-
Actually i am also not sure about. It was a question asked in one of the exams. After exam I searched a lot but could not get anything out on the net. So finally thought to ask to one of the world's largest tech community. – Aug 16 '21 at 16:14
-
3That's a really bad question. It depends on how the bytecode / TAC are implemented, and how the emulator for them is implemented. And whether there is an emulator or some kind of compiler into machine code. By themselves, "byte code" and "TAC" are meaningless. – rici Aug 16 '21 at 16:19
-
@rici yes absolutely i too felt same. But what could I do, i had to select an option but to clarify I asked here. – Aug 16 '21 at 16:21
-
1@yuv: Sure, and here you are going to receive the response you received. I'm sorry, but we cannot invent an answer which doesn't exist. Complain to whoever set the exam. – rici Aug 16 '21 at 16:21
-
@rici yes maybe. But i am not compelling to answer , I was also not sure so asked here because if I don't know I cannot conclude it is wrong but if one of the largest tech communities say then I could question .Thanks anyways – Aug 16 '21 at 16:24
-
@YUV: Perhaps your question should have been "I was given an exam with the question "..." . I think this question is unanswerable because ... . Is there an interpretation which has an answer, or can I complain to whoever set the exam?" :-) – rici Aug 16 '21 at 16:27
-
@rici that's so kind of you to share that format. I will take care of it next time. I have edited it here too. Thanks :) – Aug 16 '21 at 16:30
-
@rici can we assume that under similar conditions and then compare which of them takes less time? I actually raised a question and was told not to go in much depth thinking about conditions just as an overview we had to answer assuming similar circumstances. PS: You can avoid if you don't want to answer. Sorry for any disturbances. – Aug 16 '21 at 17:05
-
Without knowing what they mean exactly by "bytecode", I don't see any way to produce an answer. Possibly they have a specific kind of bytecode in mind, perhaps a stack machine. Even then, the evidence comparing stack machines with TAC is ambiguous at best, because it depends on how much optimisation goes into the emulator, but there is some evidence that TAC, which is usually shorter, can lead to faster solutions than a pure stack architecture. See, for example, the evolution of Lua from a stack machine to three address instructions. – rici Aug 16 '21 at 17:09
-
Ok that makes sense and is really helpful . Thanks for the answer:) – Aug 16 '21 at 20:47