3 ms·
It's not that functions are themselves state machines, but functional languages are sometimes implemented as state machines. E.g. the lambda calculus can be imp
by tromp 3y ago
It's not that functions are themselves state machines, but functional languages are sometimes implemented as state machines. E.g. the lambda calculus can be implemented on an abstract machine known as the Krivine machine [1].
[1] https://en.wikipedia.org/wiki/Abstract_machine#Functional_programming_languages https://en.wikipedia.org/wiki/Abstract_machine#Functional_pr...
- f1shy 3y agoThe metacircular evaluator is the state machine
- tromp 3y agoI wouldn't call something like this metacircular evaluator of binary lambda calculus (λ11)(λλλ1(λλλλ3(λ5(3(λ2(3(λλ3(λ123)))(4(λ4(λ31(21)))))) (1(2(λ12))(λ4(λ4(λ2(14)))5))))(33)2)(λ1((λ11)(λ11))) a state machine.
- galaxyLogic 3y agoRight, what would be the states in it? What would be the state-transitions? How many are there? How does it model a physical system with multiple states and state-transitions? Can a functional program return to its previous state ever? If not I don't think it should be called "state-machine". It can calculate what should be the next state of some state-machine, but that does not mean it is that "state-machine".
- mrkeen 3y ago> It's not that functions are themselves state machines The functions are the transitions of the state machine. The datatypes are the rest.