You Tube Video: "NoFlo - Flow Based Programming in Javascript"

163 views
Skip to first unread message

Ged Byrne

unread,
Feb 24, 2012, 6:58:05 AM2/24/12
to Flow Based Programming
There's a video on You Tube of Henri Bergius' Wacanday presentation of
NoFlo.

http://www.youtube.com/watch?v=pgP4v9b5DvE

It's an excellent presentation, thanks Henri.

My apologies if this was common knowledge. I was able to find Henri's
announcement prior to the talk, but no mention of the video being
available.

Regards,


Ged

Paul Morrison

unread,
Feb 24, 2012, 10:53:02 AM2/24/12
to flow-based-...@googlegroups.com
Thanks for pointing this out, Ged! As Ged says, excellent
presentation, Henri! It was rather weird hearing myself referred to at
a conference - but nice! Thanks, Henri!

Perhaps I should clarify to the members of this group that saying that
"IBM developed such and such..." is a bit of an over-simplification. In
the interests of historical accuracy, the various IBM mainframe
implementations of FBP were built, initially at the IBM Montreal Data
Centre, then via a customer engagement, then within IBM Canada Internal
Systems - no dialect of FBP was ever offered to customers, or officially
supported by IBM Corporate (although history might have been different
if it had been). We did try to get the Greater IBM interested a number
of times, but it never took off! Just thought I should clarify that :-)

Looks like FBP is picking up speed, at least in the JS world! Sounds
like the combination of Hook.io and NoFlo will be very powerful!
Perhaps we should add a NoFlo generator to DrawFBP...?

Minor question: can anyone tell me where the word Wakanday (Wakanda?)
came from?


--
http://jpaulmorrison.blogspot.com/

Henri Bergius

unread,
Feb 24, 2012, 11:28:02 AM2/24/12
to flow-based-...@googlegroups.com

Hi,

On Feb 24, 2012 5:53 PM, "Paul Morrison" <paul.m...@rogers.com> wrote:
> Thanks for pointing this out, Ged!    As Ged says, excellent presentation, Henri!   It was rather weird hearing myself referred to at a conference - but nice!  Thanks, Henri!

My pleasure! :-)

Sorry for not sharing the link. I seem to have forgotten about it.

> Looks like FBP is picking up speed, at least in the JS world!  Sounds like the combination of Hook.io and NoFlo will be very powerful!

Indeed. I haven't been able to proceed much in the last few months, but now we're participating in a major project where we will use FBP for routing signals from physical (and virtual) sensors between systems and making diagnosis based on them. So in addition to Hook.io there should be MQTT messaging for FBP as well.

>  Perhaps we should add a NoFlo generator to DrawFBP...?

That would be great. There is a web-based UI that ships with NoFlo, but certainly we could also design things in DrawFBP.

NoFlo can already load graph definitions from two formats: JSON and "the .fbp language", but DrawFBP XML files could be easy to add as well.

Is the format documented anywhere?

/Henri

Paul Morrison

unread,
Feb 24, 2012, 12:04:59 PM2/24/12
to flow-based-...@googlegroups.com
I have attached a sample .drw file - it's pretty self-explanatory, except perhaps for the <id> <fromid> and <toid> fields, which relate the ends of arrows to the blocks they are attached to.  There  are a few others, such as <subnetports> , <bends>, which are needed to build complete diagrams.  The different block types are all supported by <block>, with different <type> values.

Actually, I was thinking that, if you wanted to send me a complete NoFlo network specification, it should be simple enough to have DrawFBP generate it, similarly to its JavaFBP and C#FBP generator functions.
ViewCSV-Iteration3.drw

Vladimir Sibirov

unread,
Feb 24, 2012, 12:36:52 PM2/24/12
to flow-based-...@googlegroups.com
Thanks for explanation, Paul. I also plan writing a small tool to convert .drw diagrams into GoFlow networks. 

I have one concern though: as Go is a statically typed language, I need some way to specify data types for connections and nodes on the diagram before it is converted into Go code that can be compiled. I thought about using the notation similar to UML ("objectName : ClassName") in the <description>, but it would be better if there was an "official" way to do it.

Oh, and congratulations, Henri! You're doing a great job bringing "next generation FBP" to people who stay up2date with modern software development trends.

2012/2/24 Paul Morrison <paul.m...@rogers.com>

Henri Bergius

unread,
Feb 24, 2012, 1:05:06 PM2/24/12
to flow-based-...@googlegroups.com
On Fri, Feb 24, 2012 at 7:04 PM, Paul Morrison <paul.m...@rogers.com> wrote:
> I have attached a sample .drw file - it's pretty self-explanatory, except
> perhaps for the <id> <fromid> and <toid> fields, which relate the ends of
> arrows to the blocks they are attached to.

Ok, I'll look at it soon.

> Actually, I was thinking that, if you wanted to send me a complete NoFlo
> network specification, it should be simple enough to have DrawFBP generate
> it, similarly to its JavaFBP and C#FBP generator functions.

Here are some examples:
https://github.com/bergie/noflo/blob/master/examples/linecount/count.fbp
https://github.com/bergie/noflo/blob/master/examples/linecount/count.json

--
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Jabber: henri....@gmail.com
Microblogs: @bergie

Paul Morrison

unread,
Feb 24, 2012, 1:12:36 PM2/24/12
to Flow Based Programming
You're welcome! Interesting requirement, Vladimir! Java is also
statically typed, but up until now we haven't stored the type
information in the diagrams. However, type information is available
in the class annotations for a given port - once a class has been
associated with the diagram block - so we could display it once the
association has been made. I suppose we could also add it to the
diagram and display it at "design time", but then the port class type
should take precedence, after a class is assigned. Note also that
there are many cases where the only type we can use is Object - either
because the component really doesn't care, e.g. Concatenate, or
because what travels across the connection is a complex pattern of
various types, e.g. the output stream from Collate. What do you do in
the latter case?

Anyway, for now, if you want, I can try displaying the port type info
right on the diagram, once the class has been assigned, in addition to
the port info that is displayed when you double-click on a class-
associated block (but be warned that it will often be "Object"!). I
posted an example of the latter yesterday in the Component catalog
format thread.


On Feb 24, 12:36 pm, Vladimir Sibirov <trustmas...@kodigy.com> wrote:
> Thanks for explanation, Paul. I also plan writing a small tool to convert
> .drw diagrams into GoFlow networks.
>
> I have one concern though: as Go is a statically typed language, I need
> some way to specify data types for connections and nodes on the diagram
> before it is converted into Go code that can be compiled. I thought about
> using the notation similar to UML ("objectName : ClassName") in the
> <description>, but it would be better if there was an "official" way to do
> it.
>
> Oh, and congratulations, Henri! You're doing a great job bringing "next
> generation FBP" to people who stay up2date with modern software development
> trends.
>
> 2012/2/24 Paul Morrison <paul.morri...@rogers.com>
>
>
>
>
>
>
>
> >  I have attached a sample .drw file - it's pretty self-explanatory, except
> > perhaps for the <id> <fromid> and <toid> fields, which relate the ends of
> > arrows to the blocks they are attached to.  There  are a few others, such
> > as <subnetports> , <bends>, which are needed to build complete diagrams.
> > The different block types are all supported by <block>, with different
> > <type> values.
>
> > Actually, I was thinking that, if you wanted to send me a complete NoFlo
> > network specification, it should be simple enough to have DrawFBP generate
> > it, similarly to its JavaFBP and C#FBP generator functions.
>
> > On 24/02/2012 11:28 AM, Henri Bergius wrote:
>
> > Hi,
>

Paul Morrison

unread,
Feb 24, 2012, 2:06:18 PM2/24/12
to flow-based-...@googlegroups.com
Great! Either format - or both? Maybe some time in the next couple of
weeks...?

Regards,

Paul

On 24/02/2012 1:05 PM, Henri Bergius wrote:
> On Fri, Feb 24, 2012 at 7:04 PM, Paul Morrison<paul.m...@rogers.com> wrote:
>> I have attached a sample .drw file - it's pretty self-explanatory, except
>> perhaps for the<id> <fromid> and<toid> fields, which relate the ends of
>> arrows to the blocks they are attached to.
> Ok, I'll look at it soon.
>
>> Actually, I was thinking that, if you wanted to send me a complete NoFlo
>> network specification, it should be simple enough to have DrawFBP generate
>> it, similarly to its JavaFBP and C#FBP generator functions.
> Here are some examples:
> https://github.com/bergie/noflo/blob/master/examples/linecount/count.fbp
> https://github.com/bergie/noflo/blob/master/examples/linecount/count.json
>


--
http://jpaulmorrison.blogspot.com/

Henri Bergius

unread,
Feb 24, 2012, 2:24:19 PM2/24/12
to flow-based-...@googlegroups.com
On Fri, Feb 24, 2012 at 9:06 PM, Paul Morrison <paul.m...@rogers.com> wrote:
> Great!  Either format - or both?  Maybe some time in the next couple of
> weeks...?

Either format is fine, though the JSON one is probably easier to parse
and generate. The .fbp format is more of a convenient shorthand when
defining graphs on the command line.

> Paul

/Henri

Paul Morrison

unread,
Feb 24, 2012, 3:12:16 PM2/24/12
to flow-based-...@googlegroups.com
Your mention of parsing makes me think that you are thinking in terms of
generating a rough diagram, and then pushing and pulling the blocks and
arrows until it looks halfway decent! I haven't tried that, as it would
be hard to do with a JavaFBP network, so I am curious - how badly do you
need that?! Generating the JSON on the other hand should be pretty easy
- same for the .fbp format...

On 24/02/2012 2:24 PM, Henri Bergius wrote:
> On Fri, Feb 24, 2012 at 9:06 PM, Paul Morrison<paul.m...@rogers.com> wrote:
>> Great! Either format - or both? Maybe some time in the next couple of
>> weeks...?
> Either format is fine, though the JSON one is probably easier to parse
> and generate. The .fbp format is more of a convenient shorthand when
> defining graphs on the command line.
>
>> Paul
> /Henri
>


--
http://jpaulmorrison.blogspot.com/

Henri Bergius

unread,
Feb 24, 2012, 3:23:48 PM2/24/12
to flow-based-...@googlegroups.com

On Feb 24, 2012 10:12 PM, "Paul Morrison" <paul.m...@rogers.com> wrote:
> Your mention of parsing makes me think that you are thinking in terms of generating a rough diagram, and then pushing and pulling the blocks and arrows until it looks halfway decent!  I haven't tried that, as it would be hard to do with a JavaFBP network, so I am curious

Well, eventually an editor probably should be able to both load and save such definitions. But indeed, "export to NoFlo" would be a great start!

NoFlo even has the possibility of providing a RESTful server API for manipulating a network, so one option would be going and modifying live FBP networks over the web ("save to server").

/Henri

Paul Morrison

unread,
Feb 24, 2012, 3:54:43 PM2/24/12
to flow-based-...@googlegroups.com
Wish me luck!  If I have any questions, I will check with you... ;-)

Kippis!

Paul

Vladimir Sibirov

unread,
Feb 25, 2012, 3:24:54 AM2/25/12
to flow-based-...@googlegroups.com
I'd say type information isn't mandatory, it's a kind of metadata. You don't even need to display it on the diagram (or e.g. display it when a user checks "Show Types"). Types would mostly matter upon export to other languages and as you said if there is a class associated.

The "Object" thing is not a big deal if the type property for components, ports and connections is optional. So if it is omitted the target system would be able to decide whether it should be Object, or void* or a reason to display an error message.

2012/2/24 Paul Morrison <paul.m...@rogers.com>

Vladimir Sibirov

unread,
Feb 25, 2012, 3:29:50 AM2/25/12
to flow-based-...@googlegroups.com
+1 for export to NoFlo JSON format in DrawFBP. I'd use it too.

2012/2/25 Paul Morrison <paul.m...@rogers.com>

Paul Morrison

unread,
Feb 25, 2012, 10:51:27 AM2/25/12
to Flow Based Programming

Maybe some time next week... I can use the IIP diagram block for your
"data" tag... Correct?


On Feb 24, 3:23 pm, Henri Bergius <henri.berg...@iki.fi> wrote:
> On Feb 24, 2012 10:12 PM, "Paul Morrison" <paul.morri...@rogers.com> wrote:> Your mention of parsing makes me think that you are thinking in terms of

Aristophanes

unread,
Feb 25, 2012, 12:39:10 PM2/25/12
to Flow Based Programming
Likewise, excellent presentation.

Paul Morrison

unread,
Feb 26, 2012, 9:36:55 PM2/26/12
to Flow Based Programming
Hi Henri,

Some implementation details:

a) I assume for now we will just generate the json text - correct?

b) DrawFBP currently keys on the file extension - i.e. .java for
Java, .cs for C#. I believe the extension for the json text
is .json. If I use .json for NoFlo .json, what happens if another
json language comes along? Suggestions?

c) as per my previous question, we can use IIPs to generate "data"
tags. Do you want me to generate the double quotes on the contents,
or do you prefer to tap them into DrawFBP yourself?

TIA,

Paul

Henri Bergius

unread,
Feb 27, 2012, 4:15:15 AM2/27/12
to flow-based-...@googlegroups.com
Hi,

On Mon, Feb 27, 2012 at 4:36 AM, Paul Morrison <paul.m...@rogers.com> wrote:
> a) I assume for now we will just generate the json text - correct?

Yep.

Eventually it would be interesting to also talk to the NoFlo remote
API so you could edit existing (and running) NoFlo processes. But for
now just saving the file format would be plenty.

> b) DrawFBP currently keys on the file extension - i.e. .java for
> Java, .cs for C#.  I believe the extension for the json text
> is .json.  If I use .json for NoFlo .json, what happens if another
> json language comes along?  Suggestions?

Two options:
* We define a new file extension for NoFlo's JSON format
* We decide that the way NoFlo uses JSON is the way JSON-based FBP
network definitions should be done

> c) as per my previous question, we can use IIPs to generate "data"
> tags.  Do you want me to generate the double quotes on the contents,
> or do you prefer to tap them into DrawFBP yourself?

The "data" key can contain any valid JSON-serialized information, so
it could be a string (double quotes), an object (in curly braces), a
number (no quotes needed), a list (square brackets), or a combination
of these.

This probably depends on how much freedom the UI in DrawFBP gives when
defining IIP contents.

Paul Morrison

unread,
Feb 27, 2012, 9:35:06 AM2/27/12
to flow-based-...@googlegroups.com
Some comments interspersed....

On 27/02/2012 4:15 AM, Henri Bergius wrote:
> Hi,
>
> On Mon, Feb 27, 2012 at 4:36 AM, Paul Morrison<paul.m...@rogers.com> wrote:
>> a) I assume for now we will just generate the json text - correct?
> Yep.

OK.


>
> Eventually it would be interesting to also talk to the NoFlo remote
> API so you could edit existing (and running) NoFlo processes. But for
> now just saving the file format would be plenty.
>
>> b) DrawFBP currently keys on the file extension - i.e. .java for
>> Java, .cs for C#. I believe the extension for the json text
>> is .json. If I use .json for NoFlo .json, what happens if another
>> json language comes along? Suggestions?
> Two options:
> * We define a new file extension for NoFlo's JSON format
> * We decide that the way NoFlo uses JSON is the way JSON-based FBP
> network definitions should be done

I may have a way round this - but if it doesn't work, maybe option 1...
I'll try some ideas out.


>
>> c) as per my previous question, we can use IIPs to generate "data"
>> tags. Do you want me to generate the double quotes on the contents,
>> or do you prefer to tap them into DrawFBP yourself?
> The "data" key can contain any valid JSON-serialized information, so
> it could be a string (double quotes), an object (in curly braces), a
> number (no quotes needed), a list (square brackets), or a combination
> of these.

Didn't know that! That's great!


>
> This probably depends on how much freedom the UI in DrawFBP gives when
> defining IIP contents.

I'll make sure we have the maximum!

Thanks for the feedback!


Paul Morrison

unread,
Feb 27, 2012, 7:11:55 PM2/27/12
to flow-based-...@googlegroups.com
Couple more questions, Henri:

- do NoFlo primitive components also have an extension of json?

- do you have a notation for the "sticky" connections in subnets - shown
as red IN and OUT in the attached diagram?

TIA

Paul

InfiniteQueue.png

Henri Bergius

unread,
Feb 28, 2012, 4:55:25 AM2/28/12
to flow-based-...@googlegroups.com
Hi,

On Tue, Feb 28, 2012 at 2:11 AM, Paul Morrison <paul.m...@rogers.com> wrote:
> - do NoFlo primitive components also have an extension of json?

Subnets can be .json or .fbp. Components themselves are written in
JavaScript or CoffeeScript. So, usually .js

> - do you have a notation for the "sticky" connections in subnets - shown as
> red IN and OUT in the attached diagram?

There is no notation for this. The way subnets work in NoFlo is that
all available ports will be automatically exposed. So if there are
unattached ports, those will become ports of the subnet "component",
as will all ArrayPorts.

Paul Morrison

unread,
Feb 28, 2012, 8:37:36 AM2/28/12
to flow-based-...@googlegroups.com
On 28/02/2012 4:55 AM, Henri Bergius wrote:
> Subnets can be .json or .fbp. Components themselves are written in
> JavaScript or CoffeeScript. So, usually .js

Although DrawFBP is essentially language-agnostic, I realized that
selecting components is the one area that is language-dependent.
Currently DrawFBP supports .class files in the "select component class"
dialog, and it filters out all except .class files (and directories, of
course) - so, for NoFlo, we can filter all except .js and .json files,
and directories. Oddly, I just realized that I don't know what the
corresponding construct is for C# - dll's...? Anyone know?

Also, for now, I will just not generate any connect code for the sticky
connections...

Regards,

Paul


Paul Morrison

unread,
Mar 1, 2012, 11:19:18 AM3/1/12
to Flow Based Programming
Henri,

I sent a new copy of DrawFBP to nemein.com - is this the right place?

Thanks,

Paul

Henri Bergius

unread,
Mar 2, 2012, 8:40:36 AM3/2/12
to flow-based-...@googlegroups.com
Hi,

On Thu, Mar 1, 2012 at 6:19 PM, Paul Morrison <paul.m...@rogers.com> wrote:
> I sent a new copy of DrawFBP to nemein.com - is this the right place?

Yep, thanks! I was able to draw a NoFlo network with it and make it run:
https://github.com/bergie/noflo/blob/master/examples/linecount/count.drw

So indeed, a very good start. I was wondering if it makes sense to
have full component paths in the file, as this makes projects more
difficult to share between people. A relative path might work better.

But still, now NoFlo has an IDE ;-)

There were some errors that I sent to you by email.

Paul Morrison

unread,
Mar 2, 2012, 10:53:42 AM3/2/12
to flow-based-...@googlegroups.com
On 02/03/2012 8:40 AM, Henri Bergius wrote:
> So indeed, a very good start. I was wondering if it makes sense to
> have full component paths in the file, as this makes projects more
> difficult to share between people. A relative path might work better.
> But still, now NoFlo has an IDE ;-) There were some errors that I sent
> to you by email.
Can you flesh out this idea a bit more fully? Would you need some kind
of dialog to set the initial directory?

TIA

Paul Morrison

unread,
Mar 2, 2012, 8:15:06 PM3/2/12
to flow-based-...@googlegroups.com
Hi Henri,

I have a version which attempts to check if brackets - {[( - in IIPs are
balanced. Quotes are checked to see if they are paired (and brackets
within them are ignored). I can send it to you, but I thought I would
check if you want some kind of escape so double quotes can be handled as
data (e.g. \") - I haven't put that in yet. Also, for the
blockclassname tag, I can just put the relative name into the generated
code if you want (i.e. the string after the last slash)... Please let
me know what you would prefer.

Regards,

Paul

On 02/03/2012 8:40 AM, Henri Bergius wrote:

> Hi,
>
> On Thu, Mar 1, 2012 at 6:19 PM, Paul Morrison<paul.m...@rogers.com> wrote:
>> I sent a new copy of DrawFBP to nemein.com - is this the right place?
> Yep, thanks! I was able to draw a NoFlo network with it and make it run:
> https://github.com/bergie/noflo/blob/master/examples/linecount/count.drw
>
> So indeed, a very good start. I was wondering if it makes sense to
> have full component paths in the file, as this makes projects more
> difficult to share between people. A relative path might work better.
>
> But still, now NoFlo has an IDE ;-)
>
> There were some errors that I sent to you by email.
>
>> Paul
> /Henri
>


--
http://jpaulmorrison.blogspot.com/

Henri Bergius

unread,
Mar 5, 2012, 8:06:19 AM3/5/12
to flow-based-...@googlegroups.com
Hi,

On Sat, Mar 3, 2012 at 2:15 AM, Paul Morrison <paul.m...@rogers.com> wrote:
> I have a version which attempts to check if brackets - {[( - in IIPs are
> balanced.  Quotes are checked to see if they are paired (and brackets within
> them are ignored).

Thanks! Starts to look very good. I've attached an example of a
working NoFlo graph. The .drw source can be found from:
https://github.com/bergie/noflo/blob/master/examples/linecount/count.drw

From here to running the program is quite straightforward:
* Open the .drw file in DrawFBP
* File -> Generate Network -> NoFlo
* Save as... -> filename.json
* Run with noflo filename.json

count.png

Paul Morrison

unread,
Mar 5, 2012, 10:23:19 AM3/5/12
to Flow Based Programming
The following doesn't seem to have been posted - apologies if it shows
up twice!

I realized that only Henri had access to this version - it is now on
my web site as version DrawFBP-2.6. It can also be accessed via JWS
by clicking on
http://www.jpaulmorrison.com/graphicsstuff/DrawFBP.jnlp . The source
code and jar file are also available on SourceForge.

2.6 fixes several minor bugs in 2.5, and the File/Generate Code option
now supports NoFlo, and clicking on a component block now allows a
NoFlo component to be selected. Please let me know about any
problems.

All the best, and many thanks, Henri, and Bob C!

Paul M.

On Mar 5, 8:06 am, Henri Bergius <henri.berg...@iki.fi> wrote:
> Hi,
>
> On Sat, Mar 3, 2012 at 2:15 AM, Paul Morrison <paul.morri...@rogers.com> wrote:
> > I have a version which attempts to check if brackets - {[( - in IIPs are
> > balanced.  Quotes are checked to see if they are paired (and brackets within
> > them are ignored).
>
> Thanks! Starts to look very good. I've attached an example of a
> working NoFlo graph. The .drw source can be found from:https://github.com/bergie/noflo/blob/master/examples/linecount/count.drw
>
> From here to running the program is quite straightforward:
> * Open the .drw file in DrawFBP
> * File -> Generate Network -> NoFlo
> * Save as... -> filename.json
> * Run with noflo filename.json
>
> > Paul
>
> /Henri
>
> --
> Henri Bergius
> Motorcycle Adventures and Free Softwarehttp://bergie.iki.fi/
>
> Jabber: henri.berg...@gmail.com
> Microblogs: @bergie
>
>  count.png
> 15KViewDownload
Reply all
Reply to author
Forward
0 new messages