Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree that it’s not practical. Ship has sailed a long time ago.

But one solution might be a “noImplicitImpure” option.



Still wouldn't work, since there is no way for the compiler to distinguish between a pure function and an impure function which just don't have an annotation - e.g. a third-party library written before "impure" was introduced to the language.

If pure functions were explicitly marked as "pure" the compiler could just conservatively assume all other functions were impure. But the opposite does not work.


Oh. You’re right. The moment you turn that flag on, it can’t complain the away implicitAny can. Therefore you need “pure” rather than “impure.”




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: