Re:Keeping CALM: when distributed consistency is easy
by marcosdumay on Wednesday March 06, 2019 @11:00AM
(#19319874)
Well, since you just need to restrict the operations one can do with data, even a Java or C++ style type system is enough.
What is best done with another language (or a complex library on a very malleable language) is permitting non-monotonic operations with a clear boundary between them and some code style that makes them undesirable.
In TypeScript for example you can strongly type your communication protocol (web requests/reponses, websockets, parent/worker ipc, etc) and get some guarantees at compile time. For example, you can guarantee that your state updates over the wire are eventually consistent.
The same goes of course for other algebraic type systems by encoding monotonicity in the form of static type assertions (Flow, Caml, Haskell...).