You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-27Lines changed: 37 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,27 @@
1
1
# Introduction
2
-
Cpp.React is an experimental [Reactive Programming](http://en.wikipedia.org/wiki/Reactive_programming) library for C++11.
2
+
Cpp.React is reactive programming library for C++11.
3
+
Generally speaking, it provides abstractions to handle change propagation and data processing for a push-based event model.
4
+
It is an alternative to implementing imperative change propagation manually through callback functions and side-effects.
3
5
4
-
It provides abstractions to simplify the implementation of reactive behaviour.
6
+
The two core features of the library are
5
7
6
-
To react to changing data, reactive variables are declared in terms of functions that calcuate their values, rather than manipulating them directly.
7
-
A runtime engine will automatically handle the change propagation by re-calculating data if its dependencies have been modified.
8
+
***signals**, reactive variables that are automatically re-calculated when their dependencies change, and
9
+
***event streams** as composable first class objects.
8
10
9
-
To react to events, event streams are provided as composable first class objects with value semantics.
11
+
Signals specifically deal with aspects of time-varying state, whereas event streams facilitate generic processing.
12
+
A set of operations and algorithms can be used to combine signals and events.
13
+
Together, these abstractions enable intuitive modeling of dataflow systems in a declarative manner.
10
14
11
-
For seamless integration with existing code, _reactive domains_ encapsulate a reactive sub-system, with an input interface to trigger changes imperatively, and an output interface to apply side effects.
15
+
In this case, declarative means that the programer defines how values are calculated through functional composition of other values.
16
+
Applying these calcuations is implicitely handled by a so-called propagation engine as changes are propagated through the dataflow graph.
12
17
13
-
As an alternative to implementing change propagation or callback-based approaches manually, using Cpp.React results in less boilerplate code and better scalability due to the guarentees of avoiding unnecessary recalculations and glitches.
14
-
Furthermore, since functional purity is maintained in each reactive domain, the propagation engine can safely support implicit parallelism for the updating process.
15
-
Behind the scenes, task-based programming and dynamic chunking based on collected timing data are employed to optimize parallel utilization.
18
+
Since the engine has the "whole picture", it can schedule updates efficiently, so that:
19
+
20
+
* No value is re-calculated or processed unnecessarily;
21
+
* intermediate results are cached to avoid redundant calculations;
22
+
* no glitches will occur (i.e. no inconsistent sets of input values).
23
+
24
+
It can even implicitly parallelize calculations, while automatically taking care of potential data-races and effective utilization of available parallel hardware.
16
25
17
26
# Documentation
18
27
The documentation is still incomplete, but it already contains plenty of useful information and examples.
@@ -42,8 +51,6 @@ make
42
51
For more details, see [Build instructions](https://github.com/schlangster/cpp.react/wiki/Build-instructions).
43
52
44
53
### Dependencies
45
-
Cpp.React uses several external dependencies, but only one of them is mandatory:
0 commit comments