The data flow computation paradigm
Traditionally, programmers encode computer programs in terms of control flow. That means we encode programs as a series of small statements (sequence, branching, iteration) or functions (including recursive), with their associated states. We use constructs, such as selection (if
/else
), iteration (while
/for
), and functions (recursive functions as well), to encode our computation. Handling concurrency and state management for these types of program are really difficult and they lead to subtle bugs while managing state information which are mutable in nature. We need to place locks and other synchronization primitives around shared mutable states. At the compiler level, the language compiler will parse the source code to generate an abstract syntax tree (AST), do type analysis, and code generation. In fact, AST is an information flow graph where you can perform data-flow analysis (for data/register level optimization) and control-flow analysis to exploit code...