Evri + Twine Evri & Twine join forces! Read more.

Guest / Items

InfoQ: Declarative Concurrency For Ruby With Dataflow

Get Feed
InfoQ: Declarative Concurrency For Ruby With Dataflow
Description

Declarative Concurrency For Ruby With Dataflow

Part of the Ruby language was influenced by functional programming techniques. Ruby programmers then adopted techniques from Erlang or Haskell with, or created bridges to these languages, eg. Erlectricity .

Larry Diehl brings a declarative concurrent model to Ruby by importing the concept of unification from Oz Language. Oz is a multiparadigm programming language. It is mainly known as a functional (lazy and eager evaluation), distributed, and concurrent programming language, but also supports constraint, logic, imperative and object-oriented programming.

In light of the rising number of processor cores, Larry wanted to take advantage of the declarative concurrency model in Ruby. The advantages are :

It is easy to reason about what the program does

Simple but powerful concurrency is possible

To accomplish this, Larry uses the concept of Dataflow threading behavior as described in Concepts, Techniques, and Models of Computer Programming :

What happens if an operation tries to use a variable that is not yet bound? From a purely aesthetic point of view, it would be nice if the operation would simply wait. Perhaps some other thread will bind the variable, and then the operationcan continue. This civilized behavior is known as dataflow.

And to realize this the Oz-way, he uses unification:

The idea of unification is to describe values by logical equations which can be resolved automatically by some unification algorithm

Practically ...

Original URL

Comments

Report This

Twine is about discovering, collecting and sharing the content that interests you. Learn More

Stats

First Posted By

Who's Interested In This?

Forgot your password?