General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Vitaly L
Low Level
comments
Comments by "Vitaly L" (@vitalyl1327) on "why is it illegal to use "goto"?" video.
There is simply no replacement for a computed goto. And languages that do not have it suffer badly in terms of performance.
2
Impossible. Goto is essential for representing irreducible CFG (for all procedural constructs are, by definition, reducible). Which means, pretty much any mildly complicated FSM, including all kinds of parsing and tree walking. Languages without a goto are crippled languages.
2
@monad_tcp lol, now try to implement an efficient indirect threaded code interpreter without a goto.
2
@Lord-Sméagol and when you have a direct access to the computed goto, you can pre-cache the destination labels, while a switch will introduce a level of dereferencing with a label table. See how threaded bytecode interpreters use computed goto for example.
1