by jnash · 4y ago · 0 comments
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.
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.
It's why Protobuf is such a complicated mess. It's why ORMs are usually a bad idea. Persistence is just hard over time.