Re: Flow Based Programming in Nim

2016-10-06 Thread drifter
Runvnc,this was a quite a detailed answer :) Ihave to thank you for taking the 
time for chiming in and providing all of these links.

Seems I have quite a bit of reading to do.

Thank very much,


Re: Flow Based Programming in Nim

2016-10-02 Thread runvnc
Flow or dataflow programming is very interesting and powerful.

I think some similar concepts are streams and channels which both have modules 
for Nim: 
[http://nim-lang.org/docs/channels.html](http://forum.nim-lang.org///nim-lang.org/docs/channels.html)
 
[http://nim-lang.org/docs/streams.html](http://forum.nim-lang.org///nim-lang.org/docs/streams.html)

You can also think of flow as a more general abstraction for function 
composition. If you want to go that route, look through the Nim manual and 
documentation about string templating, and then metaprogramming with macros, 
the the way the parser works.

Here someone has a stream implementation in Nim with pipes 
[https://github.com/zielmicha/reactor.nim/blob/master/reactor/async/stream.nim](https://github.com/zielmicha/reactor.nim/blob/master/reactor/async/stream.nim)

Here is a workflow engine (related to flow programming and business process 
management) in C++ 
[https://github.com/kluthen/libworkflow](https://github.com/kluthen/libworkflow)
 which could be either integrated with a Nim program or have the code converted.

Here is a list of workflow engines 
[https://github.com/pditommaso/awesome-pipeline](https://github.com/pditommaso/awesome-pipeline).
 Some of those written in python might not be hard to convert to Nim or 
interact with.

Here is a web-based example of NoFlo which is JavaScript based (BTW Nim can 
also compile to JavaScript in addition to C and C++): 
[http://app.flowhub.io/#example/04847249319d2326fa92](http://forum.nim-lang.org///app.flowhub.io/#example/04847249319d2326fa92)

Channels are an intrinsic part of the Go programming language: 
[https://gobyexample.com/channels](https://gobyexample.com/channels)

If you are not already a programmer then you may have a long journey to get to 
an implementation. [https://zapier.com](https://zapier.com)/ is along the same 
lines but oriented towards business users.


Flow Based Programming in Nim

2016-10-01 Thread drifter
Hi there, I've been reading up on a programming model referred to as Flow-Based 
Programming (FBP).

[http://www.jpaulmorrison.com/fbp](http://forum.nim-lang.org///www.jpaulmorrison.com/fbp)/
 
[https://en.wikipedia.org/wiki/Flow-based_programming](https://en.wikipedia.org/wiki/Flow-based_programming)

I'm wondering if any of you have implemented something like this in Nim?

Central to FBP is the concept that **data** is to be seen as the primary 
"thing" in an application, This "thing" moves from one process to another, 
undergoing a constant series of transformations.

Processes receive and send packets of information between each other.

The sole purpose of a process is to transform the data it receives into another 
form, before sending it off to another process.

A few other highlights:

  1. A process has IN and OUT channels (kind of like a socket's receive and 
send)
  2. Processes are connected together (ex: connect("ProcessA.OUT", 
"ProcessB.IN") to create a network of interconnected processes
  3. Data (Information Packets) is received by the receiving process(es) in the 
order in which they were sent by the sending process
  4. Once they have finished transforming the data they have received, a 
receiving process sits iddle until new data is sent to it.



I could see model working well for making the jump from process diagrams into 
code implementation, almost having a 1:1 relationship. Well, especially in my 
line of work as a IT Biz Analyst where we do a lot of process diagrams. Mapping 
a process diagram to a process using this approach would seem trivial.

The only thing is I'm not quite sure how to implement this in Nim (well, in any 
langauge in general).

The author of "Flow Based Programming", Paul Morrison, pointed me to a couple 
of implementations of this approach:

[http://www.jpaulmorrison.com/fbp/jsyntax.htm](http://forum.nim-lang.org///www.jpaulmorrison.com/fbp/jsyntax.htm)

This approach has been implemented in Java, in C++, Javascript. He tells me 
implementation of this approach depends on the language being used supporting 
threads (which I know Nim does). But I have to admit I'm not strong enough a 
programmer to figure it out on my own.

So if anyone is interested, and have a few ideas or pointers, I hope you don't 
mind chiming in!

Regards,