Hacker News new | ask | show | jobs
by LogicUpgrade 1899 days ago
Every pure function is part of a bigger machine that's eventually mutable state, or by definition that pure function has no reason to exist. Ergo, cache invalidation is hard.
2 comments

I don't follow. Being part of a bigger machine isn't proof that it's hard.
>Every pure function is part of a bigger machine that's eventually mutable state, or by definition that pure function has no reason to exist

Not necessarily. The universe could be just one huge pure function.

But the universe is constantly changing. So you will need to know the specific bits of the universe that your function depends on or you will never get a hit.
Is the universe changing, or just your references to it?
So the references are mutable. Gotcha.
Aye, functional core, imperative shell (us!).
Ha, I guess it's possible. But if that's true then it seems that some of the intermediate steps in "public static void universe()" use mutable state that can result in cache invalidation difficulties.