Functional reactive programming in C++
Most modern systems require writing asynchronous non-blocking code - from the ordinary GUI applications which can perform time-consuming operations, but still be responsive to the user input; to servers that need to be able to process many requests at the same time. Most of the commonly used approaches to solve concurrency (such as event-loop based applications with event callbacks, or multi-threaded and distributed multi-process systems) have a big problem of having to handle and synchronize the state that is shared between different code paths that run concurrently.
To quote John Carmack:
A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. In a multithreaded environment, the lack of understanding and the resulting > problems are greatly amplified, almost to the point of panic if you are paying attention.
We are going to cover an emerging programming paradigm called Functional Reactive Programming (or FRP for short) which achieves concurrency using events-based programming. But, unlike the event-callback-based systems, it does so in a much cleaner way. The concept is simple - make a system that is fully event-based, and look at events not as isolated instances, but as streams of events. These streams can be transformed with the common range algorithms like filter, reduce (accumulate), map (transform) and alike.
Speaker: Ivan Cukic