<https://twitter.com/TimSweeneyEpic/status/1195743...
# thinking-together
g
interesting language mentioned in the replies: https://github.com/mrakgr/The-Spiral-Language/blob/master/readme.md
d
I can't see how the second is imperative programming
👍🏻 1
having state != imperative
n
Tim isn’t associating those two types of computation with the two paradigms, he’s saying that this framing of computations is a better context for a discussion about functional vs imperative styles.
The distinction between calculating an entirely new thing and a new version of an old thing is one that I think every language needs to account for, and I’m not yet aware of a language that makes the distinction and offers an ergonomic solution to each of the two cases. You need something better than naïve imperative instructions to describe changing data, but it’s not as simple as FP with monads. The problem with FP updates is always (as Tim says) the tree structure that immutable data is normally organised into, and the hacks needed to describe cross-links. @jonathoda what’s your take on this? I think I need to revisit your and Sean McDirmid’s work on Managed Time.
💡 1
❤️ 3
s
Agree with much of what @Nick Smith said above. The new value of an old thing is something I just call 'identity'. It's everywhere in OO but has to be hand created in FP. However there is no consistency model in OO and objects are just mutated destructively (in place) and willy nilly. I feel managed time has a lot to offer, e.g. by introducing some notion of consistency: create a new version from an old version but preserve identity. (This is all armchair hand waving.. but I do find all the managed time ideas very appealing.) Jonathan Edward and Sean McDirmid's paper links back to some of them (https://www.microsoft.com/en-us/research/publication/programming-with-managed-time/). One of the oldest attempts perhaps is David Reeds thesis (NAMOS). Related I'll also link Alan Kay's blurb on Quora that goes into similar ideas: https://www.quora.com/Why-is-functional-programming-seen-as-the-opposite-of-OOP-rather-than-an-addition-to-it/answer/Alan-Kay-11
👍 2
j
@Nick Smith The key question is how you combine changes to state made in different places and different times. Most of the FP/immutable approaches assume that every change is defined at exactly one point in the program, and that multiple such changes are globally single-threaded via some external magic. Ignores the hard problem of combining changes across space and time. Imperative programming lets you do whatever you want by manually ordering everything, which is impractically complicated. Neither approach is an acceptable solution.
👍 1
s
Another way to say this is to just follow the way we naturally think about things where some things don’t change and other things do. Numbers don’t change (the number 2 doesn’t become the 3) but most things that contain numbers do change (a two year old person may become a three year old person). Likewise, strings don’t change, but things that contain them, like paragraphs, do. As we naturally think about them, most compositional things do change, but we may not want all code to have write access to them. FP eliminates write access instead of appropriately limiting it.
s
Yeah 'identity' as a concept has zero built-in support in most (immutable data) FP langs. Versions/snapshots/inter-object consistency has zero built-in support in most OO langs. 'Time/space distributed objects' has zero built-in support in almost all of the langs. Whatever is lacking is then implemented by hand or by libraries - often by both. A person exists in one place but most virtual entities are spread out over the entire system (client side, server side, database...) and most of the information homeostasis is manually managed between all of the different models of the same entity floating around. Are there systems/languages that have strong support for the the idea of 'distributed object'?
👍 2
e
My Beads system uses distributed objects via a subscription model. I have published an example of the client/server code for 12 simultaneous games of tictactoe. Each of the clients can see the other games being played, and join in multiple games at once. The server holds the ultimate source of truth, and the clients subscribe to some portion of the master graph database. No explicit messages in my system, and all clients are guaranteed a consistent state at all times. A lot of people want to make multiplayer games and systems, and one key thing i am after is being able to debug those systems easily. I am envisioning time travel debugging of the client and the server at the same time. It is a fascinating subject.
d
What @Edward de Jong / Beads Project said also applies to Onex and the Object Network*. This keeps happening, I guess we're arch rivals! 😄 (* apart from the time travel debugging bit)
(* although that has got me thinking about how much object version history I save.. hmm..)