AppliedGo / comments

Utteranc.es comments for appliedgo.net
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

flow #3

Open christophberger opened 1 year ago

christophberger commented 1 year ago

Written on 02/25/2017 13:30:47

URL: https://appliedgo.net/flow/

christophberger commented 1 year ago

Migrated comment, written by Scott Johnston on 03/03/2017 01:06:34

Flow graphs are the way to go! Nice writeup on this package. You might want to take a look at GitHub.com/vectaport/flowgraph as well or read about it at https://github.com/vectapor....

christophberger commented 1 year ago

Migrated comment, written by Juliano on 03/03/2017 02:45:38

What software or lib did you use to make this animated flow charts? Is it javascript only? Thanks!

christophberger commented 1 year ago

Migrated comment, written by Christoph on 03/03/2017 15:08:45

Hi Juliano,
I use Tumult Hype to make the animations for this blog. The output is pure HTML/JS/CSS that should run in any modern browser.

christophberger commented 1 year ago

Migrated comment, written by Yves Cloutier on 03/03/2017 16:30:43

How would one use Flow Based programming in the context of web programming? Maybe also combining something like Mango nanomsg protocol? Or is FBP more for a non-web domain?

christophberger commented 1 year ago

Migrated comment, written by Christoph on 03/05/2017 20:44:03

FBP is a general programming paradigm. It is certainly possible to model a Web server, a Web Application server, and/or the related back-end functionality as FBP networks. Here is an example of an FBP Web Server built with NoFlo (a JavaScript-based FBP framework): http://bergie.iki.fi/blog/8...

christophberger commented 1 year ago

Migrated comment, written by Ihar Suvorau on 04/07/2017 21:18:53

I'm new to the FBP concept, so try to understand. Could you please explain the difference between your code in the example + the goflow framework and the simple program like this:

var wg sync.WaitGroup

func wordCounter(input string) (int, string) {
return len(strings.Split(input, " ")), "words"
}

func letterCounter(input string) (int, string) {
re := regexp.MustCompile("[a-zA-Z]")
return len(re.FindAllString(input, -1)), "letters"
}

func printer(line string) bool {
fmt.Println(line)
return true
}

func done(i interface{}) {
wg.Done()
}

func scheduler(in chan string) {
// information packets splitted between concurrent processes
for ip := range in {
wg.Add(1)
go done(printer(fmt.Sprintln(wordCounter(ip))))
wg.Add(1)
go done(printer(fmt.Sprintln(letterCounter(ip))))
}
}

func main() {
in := make(chan string)
go scheduler(in)

in <- "Hello, World!"
in <- "Hello, the Graph World!"
close(in)

wg.Wait()
}

The concept of Black Boxes here is also in use. We're controling the flow of the data in the controller func and passing only input-output between entities concurrently.

christophberger commented 1 year ago

Migrated comment, written by Christoph on 04/10/2017 08:00:06

indeed, there are many ways to achieve the same. (See also the follow-up article https://appliedgo.net/flow2go/ that also explores a framework-less option.) The goflow framework is certainly targeted towards complex cases where hand-coding (and, more importantly, maintaining that code) could become cumbersome. And let's not forget that one goal of FBP is to provide a more intuitive approach via graphical, editable representations of the data flow. A framework like goflow could be a suitable intermediate layer between the graph representation and the generated code.

christophberger commented 1 year ago

Migrated comment, written by paper writing services on 08/14/2017 07:51:33

Another form of tutorial that would help many people in understanding more about this Go programming language. At least, they could promote that kind of output and even help other students to use this as one of their knowledge.