16 ms·
By definition, pure functions can't read from or write to disk, can't read from or write to the database, and can't read from or write to a socket. If you aren
by bunderbunder 8y ago
By definition, pure functions can't read from or write to disk, can't read from or write to the database, and can't read from or write to a socket.
If you aren't able to do any of those things, there is no "at scale" - you're trapped in a single process on a single computer, spinning away but not able to communicate with anyone else.
Pure functional programming helps within an individual component by letting you quarantine the statefulness at defined areas (e.g., in Haskell, at the program's entry point), but it doesn't let you make it disappear. Sooner or later, you're gonna have to deal with it.
At scale, you've got tens or hundreds or thousands of different processes, and each of them has its own statefulness that it ultimately has to deal with. When you're looking at the big picture like that, I'm not sure it makes sense to worry about whether it's been quarantined, Haskell-style, or not. It's still there, and, in the big picture, it's still distributed more-or-less homogeneously throughout the system. Even a process that doesn't use disk or talk to the DB or anything like that is still not referentially transparent, because it's still subject to side effects by virtue of the network being unreliable, the OOM killer being unpredictable, and all that fun stuff.
- Jeff_Brown 8y ago> I'm not sure it makes sense to worry about whether > it's been quarantined, Haskell-style, or not. > It's still there True, but the quarantine makes the bug much easier to find.