Hey don’t go knocking the PDP-11. And if you can find a machine to compile/execute Haskell that isn’t “by and large based on the von Neumann model”, I’m sure we’d all like to know.
You’re getting too far down into the weeds. We need only look at the HL programming language itself/its semantics:
- If shuffling the sequence of statements can make another valid program that produces a different result, that’s imperative.
- If shuffling makes no difference; or merely gives a source that doesn’t compile, that’s declarative.
- (Yeah I didn’t tell how to recognise a “statement”: you know what I mean.)
- You can still reason about imperative code; but your reasoning has to consider order of execution/substituting the appearance of a variable with its RHS assignment is hazardous. [**]
- In Declarative code it should always work to substitute in the RHS.
[**] Like Hoare logic, which is notoriously hard to work with, so inspired Robin Milner to LCF then ML.
Are you sure? Doesn’t laziness make it really hard to analyze imperatively? – that is unless you put strictness pragmas all over the place. (And then you risk forcing bottoms for results you didn’t need.)