By Jonathan Worthington (jnthn)
Date: Saturday, 2 November 2013 15:10
Duration: 60 minutes
Target audience: Any
Language: English
Why is programming with locks painful? Because they don't compose!
Why do components that spawn OS thread for themselves end up being annoying to use together, because you suddenly have hundreds of threads running? Because they don't compose!
Why does asynchronous programming with callbacks lead to a tangled mess? Because it doesn't compose!
Composability is simply about being able to take solutions to sub-problems, put them together to solve larger problems, and still have a correct program. There probably aren't any silver bullets for concurrent, asynchronous, and parallel programming. It will always be different from synchronous, single-threaded programming. But many traditional approaches to these problems employed in mainstream languages have made it especially hard to do well, by giving programmers non-composing primitives.
Thankfully, things are improving in a lot of languages. And in Perl 6, we have the chance to introduce and promote primitives with good properties from the start. In this session, I'll discuss the work we've done so far on composable concurrency in Perl 6, and illustrate it with code that runs - using multiple cores - today.