Sign up ×

What is a dataflow programming language? Why use it? and are there any benefits to it?

share|improve this question

closed as too broad by bluefeet May 8 '14 at 22:41


Thanks I just learned something new – JoshBerke Jan 20 '09 at 15:37

10 Answers 10

up vote 62 down vote accepted

In a control flow language, you have a stream of instructions which operate on external data. Conditional execution, jumps and procedure calls change the instruction stream to be executed. This could be seen as instructions flowing through data (eg instructions operate on registers which are loaded with data by instructions - the data is static unless the instruction stream moves it). A control flow "if" statement jumps to the correct branch in the instruction stream, but the data does not get moved.

In a dataflow language, you have a stream of data which is passed from instruction to instruction to be processed. Conditional execution, jumps and procedure calls route the data to different instructions. This could be seen as data flowing through otherwise static instructions like how electrical signals flow through circuits or water flows through pipes. A dataflow "if" statement would route the data to the correct branch.

Some examples of dataflow features and languages:

Textual languages

Visual Languages

Products which embed a visual dataflow language:

share|improve this answer
Adding to the lesser known list: – Beef Feb 25 '11 at 16:23
another one is called expecco, complete with GUI (google and download the demo) – blabla999 Apr 2 '11 at 11:59
What's an example of something that's NOT dataflow? – solvingPuzzles Sep 28 '12 at 4:40
Most languages not listed above. C++, Java, Python, COBOL and pretty much any other imperative language out there, most OO languages, most functional language, logic programming languages like Prolog etc etc – Dan Dec 29 '12 at 1:18
Why does no one mention Unix pipelines as a common example of dataflow programming? Even Wikipedia doesn't mention it. Is there something that disqualifies it? – Sridhar-Sarnobat Aug 13 '14 at 19:06

Dataflow programming languages are ones that focus on the state of the program and cause operations to occur according to any change in the state. Dataflow programming languages are inherently parallel, because the operations rely on inputs that when met will cause the operation to execute. This means unlike a normal program where one operation is followed by the next operation, in a dataflow program operations will execute as long as the inputs are met and thus there is no set order.

Often dataflow programming languages use a large hashtable where the keys are the data of the program and the values of the table are pointers to the operations of the program. This makes multicore programs easier to create in a dataflow programming language, since each core would only need the hashtable to work.

A common example of a dataflow programming language is a spread sheet program which has columns of data that are affected by other columns of data. Should the data in one column change, other data in the other columns will probably change with it. Although the spread sheet program is the most common example of a dataflow programming language, most of them tend to be graphical languages.

share|improve this answer
+1 because you shared what you learned since you asked this question. – edymtt Jan 3 '13 at 16:16
Thanks. More understandable than the accepted answer. – tomekwi Dec 12 '14 at 11:10

One kind of dataflow programming is reactive programming. When this style of programming is used in a functional language, it's called functional reactive programming. An example of a functional reactive programming language for the web is Flapjax.

Also, anic is a dataflow language recently discussed on Hacker News.

Another example is Martlet from Oxford.

share|improve this answer
+1 for mentioning reactive programming. – Jus12 Mar 21 '14 at 5:48

Excel (and other spreadsheets) are essentially dataflow languages. Dataflow languages are a lot like functional programming languages, except that the values at the leaves of the whole program graph are not values at all, but variables (or value streams), so that when they change, the changes ripple and flow up the graph.

share|improve this answer
I don't agree; constraint-solvers generally work by discovering optima within search spaces by propagating constraints. Spreadsheets propagate values, not constraints. – Barry Kelly Jan 20 '09 at 16:19
Solve is a supplementary feature most people don't use. And trees are graphs too; moreover, if any two cells refer to the same third cell, they form a dag and are no longer a tree. – Barry Kelly Jan 20 '09 at 21:50
"Spreadsheets propagate values, not constraints." Yes, the flow of values is what makes it "dataflow". – Dan Jul 30 '09 at 10:15

Dataflow programming languages propose to isolate some local behaviors in so called "actors", that are supposed to run in parallel and exchange data through point-to-point channels. There is no notion of central memory (both for code and data) unlike Von Neumann model of computers.

These actors consume data tokens on their inputs and produce new data on their outputs.

This definition does not impose the means to run this in practice. However, the production/consumption of data needs to be analyzed with care : for example, if an actor B does not consume at the same speed as the actor A that produce the data, then a potentially unbounded memory (fifo) is required between them. Many other problems can arise like deadlocks.

In many cases, this analysis will fail because the interleaving of the internal behaviors is intractable (beyond reach of today formal methods).

Despite this, dataflow programming languages remain attractive in many domains :

  • for instance to define reference models for video encoding : a pure C program won't do the job because it makes the assumption that everything run as a sequence of operations, which is not true in computers (pipeline, VLIW, mutlicores, VLSI). Maybe you could have a look at this : recent PhD thesis. CAL dataflow language is proposed as a unifying language for next generation video encoders/decoders reference.
  • Mission critical where safety is required : if you add some strong assumptions on the production/consumption of data, then you get a language with strong potential in terms of code generation, proofs etc (see synchronous languages)
share|improve this answer

Mozart has support for dataflow-like synchronization, and it does have some commercial applications. You could also argue that make is a dataflow programming language

share|improve this answer

Many ETL tools are also in this realm. The dataflow tasks in MS SSIS are a good example. Graphical tool in this case.

share|improve this answer

It is actually quite an old concept - in the 70's, there was even a language + machine built for efficient dataflow programming and execution (-> manchester data flow machine).

The great thing about it is its duality to lazy functional languages like Haskell. Therefore, if your processing steps are pure functional, and given you have enough processing units to evaluate them and pass results around, you get maximum parallelity for free - automatically and without any programming effort!

share|improve this answer

There are certain domains where dataflow programming just makes a lot more sense. Realtime media is one example, and two widely used graphical dataflow programming environments, Pure Data and Max/MSP, are both focused on realtime media programming. I suppose their visual nature also maps nicely to the dataflow programming.

share|improve this answer

You could try Cameleon: which seems to be simple to use. It's a graphical language for functional programming which has a data(work)-flow approach.

Its written in C++ but can call any type of local or distant programs written in any programming language.

It has a multi-scale approach and seems to be turing complete (this is a petri net extension).

share|improve this answer
