Hacker News new | ask | show | jobs
by ofibrvev 2497 days ago
Lol because it was a fucking complete ide and compiler on a single low density floppy disk.

And what you’re saying is of course impossible.. determining if the function is called by static analysis is not possible.

If input = 1 then delay end is impossible to analyze statically.

If you meant reference to delay, that is a bit more tractable. But then when do you actually initialize, you will see that program initialization is about the only practical place to do it. Which is exactly what is done.

1 comments

Yes, I meant referenced in the code, not necessarily called during execution. It makes sense to do it in the beginning if delay is referenced. I guess it was just a small optimization that they decided to do without then.
The loop was in the initialization code of the unit, and the initialization code was monolithic and triggered simply by the "uses crt" statement.
Nowadays with modern linkers, your delay function could have a strong reference to a delay init constructor which would get dragged in, as needed, and run at program start up time.