Hacker News new | ask | show | jobs
by shadowofneptune 1522 days ago
I had some trouble understanding the problem, since I've never had to translate a program that relies on goto into a purely structured one. Does this article cover it well? https://medium.com/leaningtech/solving-the-structured-contro...
1 comments

The requirement for structured programs dates back from the asm.js hack. Both relooper and stackifier are still workarounds. CPUs do not require structure programs at all. Unless there is a really good reason this still looks a hack driven by limitations of the underlying code generation. I understand that some compilation passes are easier/cheaper with structured control. But then... why are not LLVM and GCC enforcing them as well (at least their roadmaps)?
It’s for security reasons and enabling static code analysis, there’s no particular need to make compilation “easier”.

PNaCL also had a lot of limitations though I don’t remember what they actually were.