I thought the big win for Transactional Memory over locking was composability. Locks don’t compose. Whenever accessing data, you have to think about all the locks or else you end up with dead(live)lock.
The promise of transactional memory was that it composes and you only have to think about your data access and not have to worry about running into deadlocks.
Borrow checkers feel like a bottom up approach to STM to me.
There’s a lot of static analysis in the JVM that reduces locking, speeds up garbage collection, and removes the need to declare the type of a generic variable.
I expect over time we will see inference in borrow checkers reduce the brain cycles you need to spend thinking about these things, and borrow semantics will be “good enough” for a long time.
Or who knows, maybe STM systems will be able to infer borrow semantics and benefit from aggressive lock elision.
The promise of transactional memory was that it composes and you only have to think about your data access and not have to worry about running into deadlocks.