Why is concurrent programming so hard ?
clord: Humans are immensely good at concurrent thought, and really bad at sequential thought.Consider driving. Your brain is processing millions of things in an out-of-order manner, and producing continuous motions in your hands and feet that guide the car so perfectly that few would be surprised to hear of someone driving for a lifetime without a major accident.Same deal with many concurrent activities, like having a conversation, or playing sports, or listening to music, writing, thinking about the future, or fixing the fridge. In every case, we set our massively parallel architecture on many problems simultaneously, and then integrate a solution in real time without deadlocks or timeouts.Humans have a corresponding weakness for sequential thought. We find it very hard to write a piece of sequential software that lasts more than a week without crashing hard or suffering from a major design flaw. We need to be taught for decades in the most advanced institutions to think sequentially and logically. Only the most elite of us ever manage to produce something that others would actually pay for, and even then we may solve a different problem for people than the one we set out to solve. (Think of startups like twitter that find that the market likes them, but for completely different reason than what they thought.)Then we try to make people trained in sequential thought solve parallel problems, and they come up with steamy piles of tangled mess, full of deadlocks, races, and side-effects.Our DEFAULT state is concurrent thought. We've all been trained to think otherwise, by our computers, languages, and education. We're hard on the poor folks who were carefully trained as sequentialists when they fail to make a parallel problem easy.I work on a compiler for sequential source at a major corp by day, but my personal long-term goal is to create a compiler for a language that can form the kernel for a new school of thought separate from the sequentialists and their half-measures towards solving this problem. As hardware evolves, it will only become more like our own brains, and less like calculators and simple programmable machines.