Programming in G

G Dataflow (G) is a graphical programming language in which nodes on a diagram execute when data is available for all required inputs.

A node in G Dataflow executes only when it receives data for all wired inputs. When a node finishes executing, it passes data along the wire to the next node in the dataflow path. The movement of data along the wires and through the nodes is called dataflow and determines the execution order of nodes on the diagram.

Because a node executes only when all of the inputs receive data, the Subtract node in the following G diagram cannot execute until Add finishes executing and passes the data to Subtract.


1378

However, in the following G diagram, the Add, Random Number, and Divide nodes all meet the dataflow requirement of having the required input data they need to execute. Nodes not connected to each other by wires can execute in any order because the nodes do not depend on data from another node. You cannot determine which node executes first.


1378

Because the flow of data, rather than the sequential order of commands, determines the execution order of nodes in G, you can create diagrams that have simultaneous operations. The image above illustrates operations that run simultaneously.