6

Intrigued by Flow Based Programming a la J Paul Morrison. I wonder if one can implement FBP in Excel/VBA. I searched quite a bit for a Basic-Lang FBP implementation to no avail. I've looked at some FBP implementation details in Python but I'm not grokking it. VBA is what I'm most familiar with, but I'm suspicious that VBA can do FBP at all, without having coroutines or (?). Code 2 simple components, an Info-Packet Buffer Class, and a linkage between them and I would get it. I can't see where to begin.

Specifically I wonder:

  1. What would be the In-Ports, Out-Ports, 'bounded-buffer' graph-edges, and code to link them up look like?
  2. How to do message passing? Using raised application events?
  3. No way the resulting beast is inherently parallel or asynchronous, right?
  4. If it just can't be done in VBA, why not?
  • There is a somewhat related post on multi-threading in Excel 2007: stackoverflow.com/questions/14677866/… Multi-threading is not fully supported in VBA. – Axel Kemper Sep 15 '13 at 11:33
  • @AxelKemper: dataflow programming AFAIK does not need any multihreading. – Doc Brown Sep 15 '13 at 13:33
  • ... though it will multithreading make easier. – Doc Brown Sep 15 '13 at 13:41
  • The C# FBP implementation (jpaulmorrison.com/fbp/CsharpFBP-2.3.zip) of "Component" makes heavy use of Threads. So does the Java implementation. Co-routines should be sufficient but difficult to implement in VBA. One could use Excel's inherent serialization feature which is working behind recalculation of a spreadsheet. But this would probably lead to a very limited mini-FBP. – Axel Kemper Sep 15 '13 at 15:46
  • I was thinking the same thing - use UDFs, Change Events, and Recalculation. I don't need a long-running process, just something I can run every midnight with a task scheduler. How a component is more re-usable than a class/ module/ function with a single purpose, and limited side-effects escapes me. The whole "port" thing too. – klausnrooster Sep 15 '13 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.