The data flow computation paradigm
Traditionally, programmers encode their program 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 recursive functions, to encode our computation. Handling concurrency and state management for these types of program are really problematic and they lead to subtle bugs. 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 create an abstract syntax tree (AST), do type analysis, code generation, 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 pipeline optimization at the processor level. Even though programmers...