Litmus test for classical FBP and reactive FBP ?

115 views
Skip to first unread message

Harsha

unread,
Dec 13, 2014, 11:35:19 AM12/13/14
to flow-based-...@googlegroups.com
Aimed at implementors, is there way to decide whether an implementation is classical or reactive FBP ?





Paul Tarvydas

unread,
Dec 13, 2014, 12:12:31 PM12/13/14
to flow-based-...@googlegroups.com
On 14-12-13 11:35 AM, Harsha wrote:
> Aimed at implementors, is there way to decide whether an
> implementation is classical or reactive FBP ?

FBP Classic can choose which ports to read from and can have "loopers".

Reactive cannot choose - it simply reacts to every incoming event (aka
IP) in the order of arrival. And, in the way I usually implement it
(typically for embedded systems), it is expected that parts do not loop
- "get in, get out quick" (an optimization that allows eschewing
full-blown processes).

Classic could be used to implement reactive-ness, simply by waiting on
every input port and treating IPs in order.

Reactive cannot implement Classic directly - it would require extra
ACK/NAK lines.

Does that answer the question?

pt

Paul Morrison

unread,
Dec 13, 2014, 12:51:32 PM12/13/14
to flow-based-...@googlegroups.com
Paul, that's a very good answer IMO.  The "Collate" function always seems to come up in these discussions, so I would regard that as quite a good litmus test.  There is one in each of JavaFBP and C#FBP: 

https://github.com/jpaulm/javafbp/blob/master/src/main/java/com/jpmorrsn/fbp/components/Collate.java

https://github.com/jpaulm/csharpfbp/blob/master/FBPVerbs/FBPComponents/Collate.cs

There is additional logic to generate bracket IPs, but the essential logic is always based on selectively receiving from different indexed elements of the input array port, based on which IP was last output (lowest key value).

As background, I should mention that Collate is a reusable component which totally changed the way we wrote batch Update programs - before FBP, every Update had to be written from scratch... and it was hard!

Regards,

Paul M.



pt

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-programming+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alfredo Sistema

unread,
Dec 13, 2014, 1:43:58 PM12/13/14
to flow-based-...@googlegroups.com
A complete example featuring the Collate component could serve as a
test I guess. Any plans on making one Paul ?

"Classical" can be implemented in reactive, but it will not be as
clear. Maybe it could be easier with some sort of macro or recompiler
to make it look like classical.
In any case, the distinctive trait is the simplicity of not having to
encode a state machine by simply expressing data requirements with
read() instructions instead of keeping tabs on what should come next
and what to do if something else comes up, etc.
>> email to flow-based-progra...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flow Based Programming" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to flow-based-progra...@googlegroups.com.

Harsha

unread,
Dec 13, 2014, 2:32:10 PM12/13/14
to flow-based-...@googlegroups.com
Paul and Paul,
Thanks !

I think those tests are definitely something an implementor can work with.

Cheers,
Harsha

To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-programming+unsubscri...@googlegroups.com.

Paul Morrison

unread,
Dec 13, 2014, 7:59:08 PM12/13/14
to flow-based-...@googlegroups.com
On Sat, Dec 13, 2014 at 1:43 PM, Alfredo Sistema <sistemas...@gmail.com> wrote:
A complete example featuring the Collate component could serve as a
test I guess. Any plans on making one Paul ?

I think the testdata is in the right directory - at least it works for me!

Bear in mind that Collate also generates bracket IPs, forming nested substreams.  I realize that this makes the component more complex, but we always needed that function in update programs, and it uses the same control fields as the "collating" function.  And BTW this is why it sometimes makes sense to use Collate with only one input stream!

See also slides 9 and 10 of http://www.jpaulmorrison.com/fbp/FBPnew.ppt



"Classical" can be implemented in reactive, but it will not be as
clear.

Not sure about that... although Matthew Lai has a technique that brings "reactive" closer to "classical" - I'd better let him explain it though!

 
  .. snip..
 
In any case, the distinctive trait is the simplicity of not having to
encode a state machine by simply expressing data requirements with
read() instructions instead of keeping tabs on what should come next
and what to do if something else comes up, etc.

Agree!

Best regards,

Paul

Reply all
Reply to author
Forward
0 new messages