3 ms·
An interesting read, but I found this a bit bizarre: No one seems to place a purity test on stateful programming: "Try writing that without any functions!". I
by dasil003 17y ago
An interesting read, but I found this a bit bizarre:
No one seems to place a purity test on stateful programming: "Try writing that without any functions!".
It seems like the author is somehow placing imperative and functional languages on opposite ends of the spectrum, but in reality imperative programming is just a direct model of programming physical machines and functional programming is a constraint layered on top of that to impose a much more reasonable order.
State is an unavoidable consequence of machines operating in time and space. Functional programming just lets you pretend the physical computation doesn't exist to various degrees, but under the hood it's all imperative.
- baguasquirrel 17y agoImperative programming arises from the fact that modern architectures are based on the Von Neumann model. FP programming arises from a lambda calculus model, so I feel that his argument is accurate. Note that this is not placing things on a spectrum, per se. One day we may not be using Von Neumann architectures for everything, anymore, and then his analogy will become more apparent.
- dasil003 17y agoPardon my shortsightedness, but how can a physical architecture be devised that doesn't ultimately compute via a sequence of state modification (ie. imperatively)? Von Neumann seems neither here nor there. Lambda calculus is a mathematical model, it exists only as a concept, it can not physically be excecuted in spacetime without an imperative implementation. Am I missing something here?
- baguasquirrel 17y agoThere are people working on architectures that are mind-bogglingly different. Google for Fleet.