"goto cannot be used in strict mode"?

BlitzMax Forums/BlitzMax Programming/"goto cannot be used in strict mode"?


"Functionalizing blocks" seems like an anti-"good programming" solution. Waters down the power of functions in readability terms.



Depends on the context. There are definitely some situations where a block becomes complex enough to deserve its own function - if not for efficiency sake than just for plain readability. Also, functionalizing a block can sometimes allow you to clean it up significantly - ie: removing the glue/flags that allow it to execute within another block.

On the other hand, if I had 'Exit label' I'd probably start using it!


Stacks are obviously not faster than registers, but I'm guessing that any stack based processor is going to try to keep them closely cached so they'll be a lot faster than memory reads.



None of the above is really anything to do (directly) with the CPU. Even with infinite registers, the 'Goto' example above would still require the extra code to null out both t and q (in case there was Goto somewhere) that the Strict version can omit.

A realated issue is local 'liveness' - consider...

Local t=100
'...code...
'...code...
'...code...
Print t

In this code, 't' is live for a long 'time'. This means you get more intereference between t and any other locals between its definition and its use. Too many interfering locals and you start spilling - ie: having to store some of them in memory as there aren't enough CPU regs.

Non strict mode can artificially extend the live range of locals, which can lead to more spills and slower code.