News for hackers. Stuff that matters.
Re:Why Developers Never Use State Machines (2011) by seanmcdirmid on Monday February 26, 2018 @10:25PM (#16470869)
What? No, that isn’t true at all. State machines come before the FP/IP divide even existed.

State machines are also intrinsically stateful, that should be obvious.

Re:Why Developers Never Use State Machines (2011) by jpitz on Monday February 26, 2018 @10:38PM (#16470900)
The argument is not that state machines are the child of FP, just that a common idiom in FP, Pattern Matching over ADTs, makes them easy to implement.
Re:Why Developers Never Use State Machines (2011) by seanmcdirmid on Monday February 26, 2018 @10:45PM (#16470927)
This might be, but state machines are so common in imperative code, you could say they are common idiom there also. Pattern matching over ADTs only drives transitions; different representation of transitions can lead to different constructs being more convenient (e.g. if your transitions are just based on a finite set of values, you can use just dictionaries).
Re:Why Developers Never Use State Machines (2011) by jpitz on Monday February 26, 2018 @10:59PM (#16470987)
That could very well be. My brain tends to map problems to ADTs with very low friction.
Re:Why Developers Never Use State Machines (2011) by tytytytytytytyt on Monday February 26, 2018 @10:29PM (#16470875)
> State machines are also intrinsically stateful, that should be obvious.

So are lots of data types, but those are still useful in FP.

Re:Why Developers Never Use State Machines (2011) by seanmcdirmid on Monday February 26, 2018 @10:35PM (#16470894)
Yes, that should be obvious also. State machines have no strong relationship with FP. I'm not sure where this claim even comes from!
Re:Why Developers Never Use State Machines (2011) by throwaway010317 on Tuesday February 27, 2018 @11:10AM (#16474730)
This comment reminds me of something I read recently on Yaron Minsky's twitter:

"An odd habit of functional programmers: when confronted with a nice, but clearly imperative way of structuring a program, they will often declare that this technique is in fact functional." (https://twitter.com/yminsky/status/950883335324225541)

and then

"Case in point: structuring a program as an imperative, deterministic state machine, where the state is determined fully by the state machine logic plus the sequence of transactions." (https://twitter.com/yminsky/status/950883598189686784)

Re:Why Developers Never Use State Machines (2011) by noblethrasher on Tuesday February 27, 2018 @12:12AM (#16471223)
In 's4vi0r’s defense, “FP” usually means ML-style FP, which does happen to be pretty biased towards creating stack-based FSMs since it has literal syntax for stacks (list literals), states (discriminated unions + tuples), and transitions (pattern matching).
Re:Why Developers Never Use State Machines (2011) by coldtea on Tuesday February 27, 2018 @03:52AM (#16472029)
>“FP” usually means ML-style FP

Only after sometime around 2010. Before that it was mostly Lisp and Scheme. Sometime around then, the trend around Haskell, purity, and co overtook them as what people mean when they talk about FP.