3 ms·
> Because there's currently no high-level programming language for writing stateful software that I'm aware of. Wot? Here is how you handle state in a pure fun
by jnash 4y ago
> Because there's currently no high-level programming language for writing stateful software that I'm aware of.
Wot? Here is how you handle state in a pure functional language like Haskell:
update : Event -> State -> State
and if you want a return result:
update : Event -> State -> (State, Result)
and if you can't be bothered to type "State" all the time:
Use a state monad (the clue is in the name).
I highly recommend that language designers do a bit of research before making claims about the uniqueness of their new language designs. As far as I can see there isn't a single feature in the language design that hasn't been done already in other languages.
- mathgladiator 4y agoI think the claim is in regards to the persistence of state. I've dealt with this as I created https://www.adama-platform.com/ https://www.adama-platform.com/ A key finding is that the data model needs to handle process failures and upgrades/downgrades. This is why the memory model for Adama is simply JSON.
- spopejoy 4y agoWhere all of these fall over is data migration, which I wasn't surprised to see was missing from TFA. Having a runtime data model that "serializes itself" is lovely until you have to change the model of an existing dataset. It's why Protobuf is such a complicated mess. It's why ORMs are usually a bad idea. Persistence is just hard over time.