Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

More fun with Flow-Based Programming

by Masem (Monsignor)
on Mar 10, 2002 at 03:25 UTC ( #150656=perlmeditation: print w/replies, xml ) Need Help??

I've made several improvements and general clean-sweeping of the prior code that I provided at A preliminary stab at Flow-Based Programming, and have gotten a better foundation for Flow-Based programming going. Because of the number of files and code involved, I've placed the specific details of this at, and am looking for some critique, comments, and suggestions to improving the code (though I've still got more improvments to make myself).

Dr. Michael K. Neylon - || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

Replies are listed 'Best First'.
Re: More fun with Flow-Based Programming
by toma (Vicar) on Mar 10, 2002 at 22:17 UTC
    A nice feature is hierarchy in the flow diagram. Like subroutines, hierarchical flow makes solving hard problems possible.

    The site gEDA hosts many open-source projects, including a schematic drawing program called gschem that could be adapted to allow users to draw a flow picture instead of writing code. Something simpler, such as a Perl/Tk interface, could also be nice.

    There was a signal and image processing flow tool called Khorus that originally came from the University of New Mexico but went commercial. It had a drag-and-drop UI called Cantata to place data generators, filters, data sinks, etc on a canvas. When the system ran, it used temporary files for the pipes and each component was a stand-alone program. As the program ran it provided a transcript of the shell commands, so you could capture the commands it was using to create a shell script that worked without the GUI.

    An interesting approach would be to use the same trick with your perl code. You could have an option to make your program emit perl code, transforming the flow-based code into procedural code. The emitted code could be eval'ed or saved into a program or module.

    The languages Verilog and VHDL are used for specifying designs of computer hardware. In Verilog, you can specify structural or behavioral elements. Structural Verilog allows you to specify a netlist similar to yours, as shown in this Verilog example.

    It should work perfectly the first time! - toma

      The graphically front end that would help one connect elements is a trick in-and-of itself. As I've mentioned on the writeup page, there's a Pipeline definition language being worked on by W3C, which means that, most likely, someone will write an open source layout tool that would work with this. If I can easily adapt my system to use the pipeline language (which i've looked at and should not be terribly difficult, yet), then I'm set.

      I should point out (if I haven't before) that I've done a FBS before in Java about 3 years ago. Then, I used a similar trick as your Khorus tool suggests; the connections were pipes, and each component ran it it's own Java thread. This isn't easily translatable to Perl, though I suspect it can be done; however, because I'm relying on XML and SAX2 events as the connection transfer mechanism, I *may* not be able to do this (I haven't put a ton of thought yet into this, more focusing on just getting something going).

      Translating FBP to procedual may be interesting. If there were no branch points, certainly this can be done (massive for-each loops). I'm not sure at this point how handling branches would work yet as well, but that could be a possibility.

      Dr. Michael K. Neylon - || "You've left the lens cap of your mind on again, Pinky" - The Brain
      "I can see my house from here!"
      It's not what you know, but knowing how to find it if you don't know that's important

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://150656]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-04-21 08:34 GMT
Find Nodes?
    Voting Booth?