Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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_pr...



> It's not that functions are themselves state machines

The functions are the transitions of the state machine. The datatypes are the rest.


The metacircular evaluator is the state machine


I 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.


Right, 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".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: