5 ms·
Mutable data structures are a very accurate abstraction of how computers work. They are a very inaccurate abstraction of how the world works. At any given insta
by YuriNiyazov 13y ago
Mutable data structures are a very accurate abstraction of how computers work. They are a very inaccurate abstraction of how the world works. At any given instant, the world is constant; time moves forward, and changing the world as it was 1 second ago is not possible. Insofar as most of business programming is trying to efficiently give answers about the state of the world at various points in time, I would agree with gcv that "flawed" is the appropriate term to use for mutable data structures.
- nnq 13y ago> They are a very inaccurate abstraction of how the world works. No, they are only inaccurate software abstractions of the business abstractions they are supposed to model. People like immutability and reversibility of concepts and that's why they try to apply it in business, law, finance etc. But the real/natural world, at least from our subjective perspective is not like that. Things in the world are not practically reversible or immutable - you cannot "restore" a deadbody. The real world is loosy and mutable, at least from an agent's perspective. The human brain is so efficient at what it does simply because it just "throws way* (irreversibly!) so much information every second, filtering for just what it needs. A small corner of the world is our "business/finance world" and using immutability and reversibility is great here, but there's way more to computing than implementing business/finances logic and processes in software!. ...if you think about it, classical OOP is inspired from cellular biology (can't find the reference now, some musing of Alan Kay I think...), so it's no wonder why it's such a trouble maker when used to model business logic, it was the wrong tool for the job from the get go. But generalizing that mutable data structures are a bad tool to model and understand the world in general is waaaay overstretched, the world is bigger than "business", and all modeling approaches are equally useful.
- gcv 13y agoUnless I'm missing the point of your argument, it sounds like you're saying that, e.g., computational biology does not benefit from representation as immutable data structures. Although I have no experience writing software for modeling cell or biological entity behavior, I strongly suspect that reasoning about the simulation itself by representing its states through immutable data structures, or immutable databases, will lend itself to a better piece of simulation software. If you think I'm wrong about this, I'd appreciate some examples.
- weavejester 13y agoMutability is change without chronology, which isn't the way the real world works. Immutability over time is a more accurate abstraction of physical processes, particularly when you get into smaller time increments and services distributed over larger distances. Mutability is useful as an optimisation, but I don't think it has much worth as a model.
- chongli 13y ago>The real world is loosy and mutable, at least from an agent's perspective. No, it's not. You cannot mutate any fact! You will never be able to change the fact that Hitler existed, for example. Facts never change. This is the purpose of Datomic: to store facts. Mutable databases only seem to be interested in maintaining the most recent fact about any particular piece of information.