forked from tyoung3/streamwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbpgo.html
More file actions
88 lines (87 loc) · 5.07 KB
/
Copy pathfbpgo.html
File metadata and controls
88 lines (87 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<div id="TOC">
<ul>
<li><a href="#todo">TODO</a><ul>
<li><a href="#upload-to-githubtwyoung">Upload to github/twyoung</a></li>
<li><a href="#trials">Trials</a></li>
<li><a href="#roadmap">Roadmap</a></li>
<li><a href="#guidelines">Guidelines</a></li>
<li><a href="#signals">Signals</a></li>
<li><a href="#copyright">Copyright</a></li>
<li><a href="#publish">Publish</a></li>
<li><a href="#run-go-doc">Run Go doc</a></li>
<li><a href="#changes">Changes</a></li>
</ul></li>
<li><a href="#fbpgo">fbpgo</a><ul>
<li><a href="#goroutines">Goroutines</a></li>
<li><a href="#channels">Channels</a></li>
<li><a href="#packaging">Packaging</a></li>
<li><a href="#performance">Performance</a></li>
<li><a href="#implementation">Implementation</a><ul>
<li><a href="#components">Components</a></li>
<li><a href="#ports">Ports</a></li>
<li><a href="#nodes">Nodes</a></li>
</ul></li>
</ul></li>
</ul>
</div>
<hr />
<h1 id="todo">TODO</h1>
<h2 id="upload-to-githubtwyoung">Upload to github/twyoung</h2>
<pre><code>* Find good name
* Fix copyright
* Fix README.md
* git push (add to fbpgo.sh)</code></pre>
<h2 id="trials">Trials</h2>
<pre><code>. Try nesting fbp calls in a component. Callit Nest
. Try method calls.</code></pre>
<h2 id="roadmap">Roadmap</h2>
<pre><code>###Collate component
###Frontend
. .net conversion to running program.
. .net > (AddSemiColons) > (expand variables) > (tokeninize) >
(interpret) > (buildGo) > (Launch)
</code></pre>
<h2 id="guidelines">Guidelines</h2>
<h2 id="signals">Signals</h2>
<pre><code>. Trap signals</code></pre>
<h2 id="copyright">Copyright</h2>
<h2 id="publish">Publish</h2>
<h2 id="run-go-doc">Run Go doc</h2>
<h2 id="changes">Changes</h2>
<pre><code>Replace Launch4</code></pre>
<h1 id="fbpgo">fbpgo</h1>
<p>What follows are some thoughts on designing a comprehensive FBP-based Go language program, fbpgo.</p>
<p>Such a system makes possible the direct invocation of a program from its editable flow graph or from the flow graph's stored network text file.</p>
<p>A comprehensive system would allow a wide community of developers to share code effectively.</p>
<h2 id="goroutines">Goroutines</h2>
<p>Goroutines are lightweight(green) threads communicating with each other within a single address space. Go may schedule goroutines onto multiple operating system threads and therefore onto multiple CPU cores.</p>
<p>Go provides a number of facilities to help solve and to avoid race and deadlock problems.</p>
<h2 id="channels">Channels</h2>
<p>Go design is very FBP-like. Goroutines typically communicate over Go channels, which are ring buffers of specified capacity(default 1).<br />
Channels and goroutines are built into the Golang syntax(unlike thread libraries in other languages) clarifying and simplifying their operation. Channels can help to avoid extensive locking of critical code sections.</p>
<h2 id="packaging">Packaging</h2>
<p>The basic Go unit is a package, which is imported into a main Go program or another Go package. The single main Go program defines a Go command, an executable program.</p>
<p>Go 'modules' are collections of related packages. Modules will default with the advent of Go-2.0. Go modules are a recent development. Go 'plugins' allow for third parties to create interfacing code. The Go ecosystem avoids complex make files by the way it arranges dependent code in sub-directories. Package libraries are compiled into the ../pkg directory tree. fbpgo uses modules to allow for third parties to develop fbpgo code independently.</p>
<h2 id="performance">Performance</h2>
<p>Much has been done to make Go programs fast.<br />
A benchmark go program, available at ./github.com/tyoung3/flowfib, can run millions of goroutines communicating over millions of channels in a few seconds.</p>
<h2 id="implementation">Implementation</h2>
<p>From a graphable text file, FOO.net (which may include other files and reference subnets defined elsewhere), generate and run a Go 'main' program, FOO.go. FOO.go will import and invoke standard fbpgo go components, passing a structure(interface), providing the component's process name, interface(s), and string arguments.</p>
<h3 id="components">Components</h3>
<p>Each component is required to be reentrant. The same component may be invoked multiple times in the network definition, but each time with a different name. Components should be pre-compiled or compiled on the fly and cached.</p>
<h3 id="ports">Ports</h3>
<p>FOO.go will connect component ports as specified in FOO.net. FOO.go will intercept OS signals, SIGUSR1, SIGUSR2, etc. and act accordingly.</p>
<h3 id="nodes">Nodes</h3>
<p>FOO.go will also connect with external nodes and processes as specified(or not) in FOO.go.</p>
</body>
</html>