Programming Languages for Concurrent Execution / Items
larrytheliquid's dataflow at master - GitHub
Get Feed- Description
-
Description:
Dataflow concurrency for Ruby (inspired by the Oz language)
Clone URL:
Larry Diehl
dataflow /
What’s this?
A Ruby library that adds Dataflow variables (inspired by the Oz language). Dataflow variables have the property that they can only be bound/assigned to once, or have an equivalent value as an existing assignment (see “unification”).
Dataflow variables must be declared before they are used, and can be passed around as data without actually being bound. If the variable gets used (in this library this means a method call) while being unbound then the currently executing thread will suspend.
What’s the point?
Ruby is Object Oriented (with the ability to mutate local, instance, class, and global variables, and even constants), and on top of that it has powerful reflection and meta-programming abilities. While these features are useful for certain problems, they are not within the declarative model. Staying in the declarative model gives one 2 advantages: It is easy to reason about what the program does Simple but powerful concurrency is possible
Ruby, like many other OO languages, is facing the hurdles of taking advantage of the increase of processor cores within a simple parallel programming model. This library lets you program Ruby in the declarative concurrent model when you need to take advantage of multiple cores (assuming a Ruby implementation that uses native threads in one way or another).
The trick to this kind of programming is binding variables from other threads. The nice thing is that many existing libraries/classes/methods can still be used, just avoid side-effects. Use regular Ruby threading to create threads, use “local” or “declare” to create new variables, and use “unify” to bind variables.
Ports using Dataflow
Ports are an extension of the declarative concurrent model to support nondeterministic behavior. They accomplish this ...
- Original URL
Comments
Report ThisTwine is about discovering, collecting and sharing the content that interests you. Learn More
Join TwineStats
- 1 Twine
- 1 Comment
Tags
Community Tags
Who's Interested In This?
-
dstark added to Programming Languages for Concurrent … 7 months ago
Public Comments
-
dstark
7 months ago
Add a Comment- Some HTML is allowed.
- Reply
- Cancel
- Submit
Programming Languages for Concurrent Execution