Skip to content

Comment on Dead Code Elimination for Beginnersparent

Comments

Subset is hard to define I think, it seems that would have many repercussions. I like JoachimSchipper's suggestion above, that adds a construct in which the programmer promises not to do any funny stuff to certain variables so that the optimizer can go to town on the optimization on them.

So like ECMAScript 5 strict mode?

Looks something like it, I didn't know about it. I don't know if it will protect against the things that are mentioned in the article though, the descriptions that I've (admittedly only cursory) read don't say that the things that mentioned in the article aren't allowed anymore under strict mode (like the Object.prototype.valueOf = function() example given).

Maybe it is, in which case this would be great it seems. Not that I have intimate knowledge of it, but still ;)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.