{"id":37087082,"url":"https://github.com/tyoung3/sw","last_synced_at":"2026-01-14T10:43:13.426Z","repository":{"id":39669044,"uuid":"187624061","full_name":"tyoung3/sw","owner":"tyoung3","description":"StreamWork Go Code Generation and Flow-Based-Programming Engine","archived":false,"fork":false,"pushed_at":"2022-08-24T11:11:08.000Z","size":64793,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T11:19:44.487Z","etag":null,"topics":["abstract-syntax-tree","bnfc","code-generation","dataflow","dataflow-compiler","fbp","go","graph-editor","graph-editor-gui","graph-visualization","graphviz","prototype","prototyping"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tyoung3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2019-05-20T11:02:59.000Z","updated_at":"2022-06-17T13:39:58.000Z","dependencies_parsed_at":"2022-09-11T23:41:04.678Z","dependency_job_id":null,"html_url":"https://github.com/tyoung3/sw","commit_stats":null,"previous_names":[],"tags_count":103,"template":false,"template_full_name":null,"purl":"pkg:github/tyoung3/sw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyoung3%2Fsw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyoung3%2Fsw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyoung3%2Fsw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyoung3%2Fsw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyoung3","download_url":"https://codeload.github.com/tyoung3/sw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyoung3%2Fsw/sbom","scorecard":{"id":905200,"data":{"date":"2025-08-11","repo":{"name":"github.com/tyoung3/sw","commit":"237fc147d8ab0e348085901e9afcf32e0cac9cd7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/c-cpp.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":10,"reason":"SAST tool detected: CodeQL","details":["Info: SAST configuration detected: CodeQL","Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":4,"reason":"binaries present in source code","details":["Warn: binary detected: bin/TestSWL.exe:1","Warn: binary detected: bin/sw.exe:1","Warn: binary detected: src/bnfc/TestSWL:1","Warn: binary detected: src/bnfc/TestSWL.exe:1","Warn: binary detected: src/model/sw:1","Warn: binary detected: src/model/sw.exe:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.TXT:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.TXT:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.19.1 not signed: https://api.github.com/repos/tyoung3/sw/releases/55904218","Warn: release artifact v0.19.1 does not have provenance: https://api.github.com/repos/tyoung3/sw/releases/55904218"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Info: Possibly incomplete results: error parsing shell code: [ must follow a name: bin/swgen.sh:0","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/c-cpp.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/tyoung3/sw/c-cpp.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/tyoung3/sw/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/tyoung3/sw/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/tyoung3/sw/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/tyoung3/sw/codeql-analysis.yml/master?enable=pin","Warn: containerImage not pinned by hash: src/Dockerfile:1: pin your Docker image by updating golang:1.16 to golang:1.16@sha256:5f6a4662de3efc6d6bb812d02e9de3d8698eea16b8eb7281f03e6f3e8383018e","Warn: goCommand not pinned by hash: bin/swskel.sh:688","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T17:06:33.957Z","repository_id":39669044,"created_at":"2025-08-24T17:06:33.957Z","updated_at":"2025-08-24T17:06:33.957Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstract-syntax-tree","bnfc","code-generation","dataflow","dataflow-compiler","fbp","go","graph-editor","graph-editor-gui","graph-visualization","graphviz","prototype","prototyping"],"created_at":"2026-01-14T10:43:12.871Z","updated_at":"2026-01-14T10:43:13.418Z","avatar_url":"https://github.com/tyoung3.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STREAMWORK -- SW-0.28.8 \n\n\nCopyright (C) 2019,2020,2021,2022 Thomas W. Young, sw@twyoung.com \n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file or its derivitaves except in compliance with the License.\nYou may obtain a copy of the License  at\n\n[Apache License](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nAll files in this repo are included in this license.\n\n\u003c!-- https://phrase.com/blog/posts/internationalization-i18n-go/ --\u003e\n \n![StreamWork Logo](http://sw.twyoung.com/images/StreamWork.svg)\n\n## StreamWork\n         \n   Go language code generator.\n         \n[![CodeQL](https://github.com/tyoung3/sw/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/tyoung3/sw/actions/workflows/codeql-analysis.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/tyoung3/sw)](https://goreportcard.com/report/github.com/tyoung3/sw)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Contents\n * [Description](#description)\n   * [Synopsis](#synopsis)\n * [Return code](#returncode)\n * [**_TestSWL_** program](#testswl) \n * [Network Definition](#networkdefinition)\n   * [Network Definition Files](#networkfiles)\n * [QuickStart on Linux](#quickstart) \n    * [Requirements](#requirements)  \n    * [Installation](#installation)   \n    * [Post Install](#postinstall) \n    * [Foo Bar test](#foobartest)\n  * [Building on Linux](#buildingonlinux)\n  * [StreamWork Language(SWL) Notes](#swlnotes)\n      * [Stream types and component arguments](#streamtypes)\n      * [Variables](#variables)\n      * [Semi-colon commentary](#semicolons)\n      * [Left Arrow comments](#leftarrow)\n    * [Collate/Merge Example](#collatemerge)\n  * [Bash Scripts](#bashscripts)\n    * [Hello World](#helloworld)   \n    * [**_swgo_** script](#swgo)\n    * [**_swgraph_** Script](#swgraph)\n    * [**_gofbp_ script**](#gofbpscript)\n      * [gofbp Example](#gofbpexample)\n        * [LOADBAL.SW](#loadbal)\n    * [Generate a project](#generateaproject)\n      * [**_sw.sh_** Synopsis](#synopsis)\n  * [BUGS](#bugs)\n  * [Home Page](#homepage)    \n  * [Release Notes](#releasenotes)\n  * [Author](#author)\n  \n## Description\u003ca name=\"description\"/\u003e\n\nStreamWork is a simple system for building complex programs. \n\nStreamWork can generate and test a complete Golang project from a simple\ntext file. It can also create a nice graph showing the components and \ntheir connections.\n\nBy default, StreamWork reads, parses, and analyzes; a simple \nSWL language StreamWork network definition(ND) file,  \nthen generates a main Go program.\n\nOptions allow you to produce an abstract syntax tree, a GraphViz dot file,  or a goFBP main prgram instead.\n\n\n### Synopsis\u003ca name=\"synopsis\"/\u003e\n\n**_sw_** [-m MODE] [-cfg CONFIGURATION_FILE] [-d DEFAULT_PATH] [ SW_FILE ]\n\n**_sw_** -v\n\n**_sw_** --help \n\nIf SW_FILE is omitted, **_sw_**  will read from stdin.\n\n```\t \n\t\tMODE= \n\t\t\t0-GOMODE\t\t. Generate a main SW Go program[DEFAULT].\n\t\t\t1-ASTMODE\t\t. Display the Abstract Syntax Tree \n\t\t\t2-GENTREE\t\t. Display the Linearized tree\n\t\t\t3-GRAPHMODE\t\t. Generate Graphviz .dot file code\n\t\t\t4-JAVAFBP\t\t. Incomplete and untested. Looking for help.\n\t\t\t5-PROJECT\t\t. Generate **_swgen.sh_** code for a project tree.\n\t\t\t7-CMODE\t\t\t. Incomplete and untested. Looking for help.\n\t\t\t8-GENGOFBP      . Generate main go code for J. P. Morrison's gofbp. \n```\n\n## Return code\u003ca name=\"returncode\"/\u003e\n**_sw_** returns SUCCESS unless it encounters an error, in which case **_sw_** returns FAILURE.\nSee package documention for component return codes. \n\n## **_TestSWL_** program\u003ca name=\"testswl\"/\u003e \n**_TestSWL_** syntax checks stdin or a SteamWork network definition file or a SteamWork configuration file.\n### synopsis\u003ca name=\"testswlsynopsis\"/\u003e\n\n```\n    usage: Call with one of the following argument combinations:\n\t--help\t\tDisplay this help message.\n\t(no arguments)\tParse stdin verbosely.\n\t(files)\t\tParse content of files verbosely.\n\t-s (files)\tSilent mode. Parse content of files silently.\n```\n\n## Network Definition \u003ca name=\"networkdefinition\"/\u003e\n\nA StreamWork network definition describes a program as a  list of data streams.\nEach data stream consists of a source process, a director, and a sink process. \nThe network definition is a compact text-based representation of a data flow diagram. \n\nStreamWork is concerned primarily with Go language FBP programs,\nhowever, the network definition described here is language agnostic.  It is quite possible \nto generate corresponding code in other languages from a StreamWork ND.         \n\nThe script, **_swgo_**, reads and executes a network definition employing **_sw_** to properly launch and connect the processes.  By default, **_sw_** generates \nand builds a single main Go program which:  \n  * imports sw compatible component package(s) as specified in the network definition,  \n  * launches a goroutine for each process,  \n  * connects these processes via Golang interface channels, and \n  * waits for all processes to finish.  \n  * Once the processes launched, StreamWork has no subsequent\n   interaction with them.\n\nOn option, **_sw_** will read, parse and interpret a network definition file then  create either a:\n \n * a StreamWork Go main program,\n * a gofbp      Go main program (see github.com/jpaulm/gofbp), \n * a GraphViz   .dot file(script,( **_swgraph_** will create and display a graph(s) directly)\n * a bash script, (**_swproject_** generates a complete GO language project tree and \n \t tests it)\n * an abstract syntax tree (a reverse polish notation rendition of the essential language components), \n    OR\n * a linearized tree (a network definition reconstruction).   \n\n### Network Definition Files\u003ca name=\"networkfiles\"/\u003e\n\nA network definition file (in the SWL language[see below]) consists of a list of \nstreams(aka dataflows); and may also contain subnet definitions, \nINCLUDE and PREFIX statements, and comments.  \n\nINCLUDEd files are also network definitions which may in turn contain\nINCLUDE statements.  Exceeding 100 levels of includes will \ncause program termination.\n\nA stream definition looks something like:\n\n```\n(a C \"ARG...\" ) -ipType\u003e (b D);\n     or [reversing direction and using default component names]\n(E)IN \u003c- OUT.1(F)0 \u003c- (G); \n```\n\n![Figure 1](http://sw.twyoung.com/images/fig1.svg)\nand consists of a list of streams.  Each stream consists of \na source process, a stream director, a sink process and a terminating semicolon(;).   Each process consists of\n\n\n  * a processname\n  * optional component identifier \n  * optional string arguments, and \n  * optional process attributes [surrounded by brackets].  Attributes\n    consist  of KEY=STRING|NUMBER statements, used mainly to enhance\n    graphic images.\n   \nall surrounded by parens, and followed and/or preceded by optional \nport identifiers consisting of a port number preceded by an optional port name and period(.).  Omitted port identifiers default to zero(0).\n\nThe stream director points from the source process to the sink process.  A director may \ninclude a type identifier and/or a stream buffer size: e.g. \"\u003ctype_A 10-\"  or \"-type_B 2\u003e\".  If not included, buffer size defaults to zero.\n\nExample with anonymous process names and default components:\n\n```\n  (_) -int 3\u003e (_); #[integer stream with buffersize of three]; \n```\n\n![Figure 2](http://sw.twyoung.com/images/fig2.svg)\nIn this example, the default components [as specified in a config file, send their process names to the channel or to stdout: \n\n```\n    (Hello) \u003c- (World); \n```\n\nproduces:\n\n```\nHello World\n``` \n\nA process is defined by its process name, its component identifier, component arguments,\nand process attributes; all surrounded by parens.   \nThe component identifier, arguments, and attributes will default if omitted. \nProcess names are not apparent to Go and so need not follow Go naming \nrules, just the StreamWork conventions. \n\nA component identifier consists of its import module/package identifier, \na slash, '/', and the component name.  Go component names need to be capitalized.\nIf  the path is omitted,  a configuration default path is assumed.  \nIf the component name is also omitted, configuration default component names\nare assumed for sink, source, and filter(has both inputs and outputs) processes.\nSubnet components are identified by ```'``` prefixing its identifier, as in\n(A ^SubnetName) ...\n \nStream directors consist of ```\u003c```, an optional, comma-separated list of type identifiers,\nan optional buffersize integer, and ```-```. Example: ```\u003c100-```\nThe reverse (Ex: `-myDataType,yourType 100\u003e`) is also valid.\n \nInformation packets(IPs) are designed as nil(empty) interfaces.  The\ndata type is determined by the sending component.  It is possible for \nproperly coded sink components to handle multiple data types.\nA type mis-match will be reported by incompatible receiving \ncomponents.  Components can be coded to handle any\ntype, including user-defined types and structures. \nSome components  can process strings and integers; \nother components just a single type; on each receiving port.   \n \n**_sw_** versions beginning with v1.0.0 are backward compatible within the same major \nversion(currently v0).  There is no such guarantee with v0.N.N versions, but we will\nincrease the minor version in such cases.  The master github branch may have many commits without creating a new version.  \n\n**_sw_** builds a network model in memory, then optionally generates\neither \n  \n  * an abstract syntax tree, \n  * a linearized tree(a network definition reconstruction), \n  * a GraphViz .dot file, \n  * input to **_swproject_** to build a complete working project tree, \n  * or Go source code from the network model.\n  * or Go main source code for JFM's gofbp. \n\nC and other languages could also be generated, but this has not been implemented.\nJavaFBP is possible, for instance.   \n\nComments and critiques are welcome.    Contributors are encouraged.  \n\nPlease do not submit code before contacting the project.  Contact by \ne-mailing streamwork@twyoung.com or Discord/gofbp message is preferred to posting a request on Github.     \n\n## QuickStart on Linux\u003ca name=\"quickstart\"/\u003e \n  \n### Requirements\u003ca name=\"requirements\"/\u003e  \n  * Gcc, etc.\n  * Graphviz should be installed, but installation may proceed\n    without it.\n  * The ...github/tyoung3/StreamWork backend is no longer required.  \n  * **_sw_** is written in C. \n  \n### Installation\u003ca name=\"installation\"/\u003e   \n  * cd to any convenient workspace (/usr/local/src for example).\n  * Download the latest sw-0.28.0.tar.gz file \n\t  from https://github.com/tyoung3/sw/build\n  * Run 'tar -xzf .../sw-0.28.0.tar.gz' to extract source files\n  * cd  sw-0.28.0\n  * Run ./configure \u0026\u0026 make check\n  * Run sudo make install.  \n\t  **_sw_** and associated scripts will be installed in /usr/local/bin\n\t  \n### Post Install\u003ca name=\"postinstall\"/\u003e\n   \n#### Foo Bar test\u003ca name=\"foobartest\"/\u003e\n\n  mkdir /tmp/x/\t \n  * **_echo_** \"(Foo) \u003c- (Bar);\" | **_sw_** \u003e /tmp/x/fb.go \n  \n  **_cd_** /tmp/x/\n  **_go_** mod tidy \n\n  * Run: **_go_** run /tmp/fb.go\n  \n  This is what the **_swgo_** script does: \n  try  **_swgo_** .../nds/fb.sw  \n```\nOUTPUT: \n\nFoo Bar-1\nFoo Bar-2\nFoo Bar-3\nFoo Bar-4\nFoo Bar-5\nFoo Bar-6\nFoo Bar-7\n```\n\n\n## Building on Linux\u003ca name=\"buildingonlinux\"/\u003e\n\n  * Install autotools, ctags, libyaml-dev, bnfc, bison, and flex \n  * cd to your project workspace (like /usr/local/src )\n  * git clone https://github.com/tyoung3/sw.git\n  * bin/sw.sh build;  # Runs autotools including .../sw/bin/configure. \n  * bin/sw.sh c;      # Runs make check in .../sw/src\n  * bin/sw.sh bw;     # Builds Windows/sw.exe.  Requires mingw.  Run make distclean first.\n\n## StreamWork Language(SWL) Notes\u003ca name=\"swlnotes\"/\u003e\n\nSWL is an unambiguous, context free grammar, making it directly interpretable, without preprocessing. \n\nSee the bnfc StreamWork language description file, SWL.pdf. \n\nSWL has few reserved words,  making it somewhat natural language\nagnostic.   \n\nEvery effort is made to ensure that all currently valid SWL\nstatements will remain valid.  Should \nthis prove impractible,  the minor version will be incremented.\nOnce v1.0.0 is reached, the major version will be incremented instead.\nBackward conpatibility is enforced for network definition files,\n**_sw_**, and published Go modules only.  \n\nLinux scripts and Go modules, are separately versioned.  \n\n#### Stream types and component arguments\u003ca name=\"streamtypes\"/\u003e\nStream channels can be any Go language type: int, string, struct, \nor interface.  '_' is shorthand for an interface channel type.   \nComponents with channels of varying types, should group \ntypes to simplify their entry points. \n \nAutojoin and autosplit work only with interface types.\n\nWhile StreamWork packages a number of components, none of them\nare required.  It is quite possible to define a network with no \ndependencies (other than Go packages) at all.  \nThe only requirement for a component is \nan entry point with two or more parameters: wait group, argument string \nslice, and a channel for each port. \n\n#### Variables\u003ca name=\"varaibles\"/\u003e\nSWL accepts string($NAME), environment string($_NAME), symbol(\u0026NAME),  and numeric(%NAME) variables.  See SWL.pdf for acceptable usage.\n\nStreamWork uses the following environment variables:\n  * $BROWSER -- WWW browser \n  * $GOPATH  -- Go language path\n  * $DEBUG   -- 'Y' will cause some messages to print.\n    \n#### Semi-colons\u003ca name=\"semicolons\"/\u003e\nStatements in SWL, are terminated with a semi-colon.  Semi-colons in code are like \nperiods at the end of English statements -- \nthey tell the reader (and the SWL interpreter) when\nyou have reached the end of a statement. This makes reading the statements easier. \nImagine trying to read a book without any periods (or initial capitals). \nAdditionally, without semi-colons line breaks become part of the language \ndefinition, leading to awkward, confusing syntax rules; difficult for the\nreader to interpret.  \n\n#### Left Arrow comments\u003ca name=\"leftarrow\"/\u003e\nThe, ```\u003c-```,  token is employed in order to be consistent with its \nusage in the Go language.  The ```-\u003e``` token is also available:\n\"(A) -\u003e (B)1 \u003c- (C);\"  is valid SWL.   \n\n### Collate/Merge Example\u003ca name=\"collatemerge\"/\u003e\n\nRun the following (in Linux):\n\n```\n\tmkdir /tmp/collate\n\tsw \u003c  sw/nds/collate.sw   \u003e /tmp/collate.go\n\tgo run /tmp/collate.go |grep Match0  \n\t\nto produce: \n\nMatch0 Int: 5\nMatch0 Int: 7\nMatch0 Int: 9\nMatch0 Int: 11\nMatch0 Int: 17\nMatch0 Int: 23\n\n``` \n\n## Hello World\u003ca name=\"helloworld\"/\u003e\n\n\n```\necho \"(HELLO)-\u003e(WORLD);\" |sw \u003e /tmp/hello.go\ngo run  /tmp/hello.go \nProduces:\nWORLD HELLO-1\nWORLD HELLO-2\nWORLD HELLO-3\nWORLD HELLO-4\nWORLD HELLO-5\nWORLD HELLO-6\nWORLD HELLO-7\n```\n\n\n```\t  \n\tsw -m 3 \u003c  sw/nds/collate.sw | dot -Tsvg \u003e /tmp/collate.svg\n```\n\nproduces \n\n![/tmp/collate.svg](http://sw.twyoung.com/images/collate.svg)\nan image of the collate \nnetwork.  \n\n## Bash Scripts\u003ca name=\"bashscripts\"/\u003e\n### **_swgo_** script\u003ca name=\"swgo\"/\u003e\nThe bash script, **_swgo_**, will generate and run a GO program from a network definition:\n\n```\n  .../nds/hw.sw\n(Hello) \u003cstring- (World);\n```\n\n**_swgo_** .../nds/hw\nproduces:\n\n```\n\npackage main\n\n/*\n                  StreamWork Go code. \n\tGenerated by sw/swgo.c-0.22.0 Wed Mar 16 14:48:30 2022\n\tfrom Network file: /usr/local/src/sw/src/nds/hw.sw\n\tConfiguration file: /usr/local/src/sw/src/nds/sw.cfg\n            ***  Expanded Network Definition  ***\n(Hello sw.Print ) \t\t\u003c_-\t0(World sw.Gens);\t\n1 stream, 2 processes, 2 components, 1 partition, 0 cycles.\n*/\n\nimport \"sync\"\nimport \"github.com/tyoung3/sw\"\n\n\nfunc main() {\nvar wg sync.WaitGroup\n\ncs0 := make(chan interface{},0)\t//World.0-\u003eHello.0\n\n\twg.Add(1)\n\nvar cp1 []chan interface{}\ncp1=append(cp1,cs0)\ngo\tsw.Gens(\u0026wg,[]string{\"World\"},cp1) // World\n\nvar cp2 []chan interface{}\ncp2=append(cp2,cs0)\ngo\tsw.Print(\u0026wg,[]string{\"Hello\"},cp2) // Hello\n\nwg.Wait()\n}\n\n\nWhich in turn produces:\n\nHello World-1\nHello World-2\nHello World-3\nHello World-4\nHello World-5\nHello World-6\n```\n\n### **_swgraph_** Script\u003ca name=\"swgraph\"/\u003e\n\nAnother bash script, **_swgraph_**, will display a graphic image of a network definition:\n   \n```\n    .../nds/mvc.sw\n(m Model)1      -change\u003e         (v View);\n(c)2            -update\u003e        1(v);\n(v)2            -event\u003e          (c Control); \n(c)1            -request\u003e       (m);\n```\n\n**_swgraph_** .../nds/mvc\nproduces: \n\n![Model/View/Control image](http://sw.twyoung.com/images/mvc.jpg)\nfor instance.\nProcesses are colored such that all components in the same package have the same color.\nNot shown here, unfortunately, are the tooltips and html references.  Arrows are colored according to stream buffersize: 0 - black; 1-green; 2 or more - orange.   Coloring rules \nare not guaranteed to remain unchanged in future sw versions. \n**WARNING:** buffersize is related to deadlock potential in cyclic networks.\n\nThe resulting image is an annotated Data Flow Diagram.\n\n### **_gofbp_ script**\u003ca name=\"gofbpscript\"/\u003e \n**_gofbp_** produces and runs a gofbp program \n(see [github.com/jpaulm/gofbp](https://github.com/jpaulm/gofbp)  )\nfrom a StreamWork net definition file.\n\n#### gofbp Example (from sw/src/model/tests/gofbp/loadbal.sw)\u003ca name=\"gofbpexample\"/\u003e\n\n##### Given: LOADBAL.SW\u003ca name=\"loadbal\"/\u003e\n\n```\n$core = \"github.com/jpaulm/gofbp/core\";\n$trtn = \"github.com/jpaulm/gofbp/components/testrtn\";\n(Sender $trtn/Sender \"10 COUNT=10\")OUT\t-load\u003e IN.0(LoadBalance $trtn/LoadBalance );\n(LoadBalance)OUT.1 -load\u003e IN(Receiver0 $trtn/DelayedReceiver);\n(LoadBalance)OUT.2 -load\u003e IN(Receiver1 $trtn/Receiver);\n(LoadBalance)OUT.3 -load\u003e IN(Receiver2 $trtn/Receiver);\n```\n\n`gofbp -b loadbal`\n\u003cp\u003eproduces \u003c/p\u003e\n\n![a graphic image of loadbal.sw](http://sw.twyoung.com/images/loadbal.svg)\nand (on console)\n\n```\nInput to Receiver: Receiver1 \u003e IP - # 1\nInput to Receiver: Receiver1 \u003e IP - # 4\nInput to Receiver: Receiver1 \u003e IP - # 6\nInput to Receiver: Receiver1 \u003e IP - # 8\nInput to Receiver: Receiver2 \u003e IP - # 0\nInput to Receiver: Receiver2 \u003e IP - # 3\nInput to Receiver: Receiver2 \u003e IP - # 7\nInput to DelayedReceiver: Receiver0 \u003e IP - # 2\nInput to DelayedReceiver: Receiver0 \u003e IP - # 5\nInput to DelayedReceiver: Receiver0 \u003e IP - # 9\n```\n\n### Generate a project\u003ca name=\"generateaproject\"/\u003e\n**_swproject_** -yaml YAML  -cfg ./src/nds/postage.cfg ./src/model/tests/postage.sw\n\nproduces the following source tree:\n\n```\n├── cmd\n│   └── postage.go\n├── ComputePostage.go\n├── ComputePostage_test.go\n├── config.go\n├── GetLoc.go\n├── GetLoc_test.go\n├── GetWeight.go\n├── GetWeight_test.go\n├── go.mod\n├── go.sum\n├── internal\n│   ├── gen.sh\n│   ├── postage.sw\n│   └── sw.cfg\n├── ipT.go\n├── PostageT.go\n├── postage.yaml\n├── PrintLabel.go\n├── PrintLabel_test.go\n├── Rates.go\n├── Rates_test.go\n├── RateT.go\n├── testdata\n│   └── README\n└── WeighT.go\n\n3 directories, 23 files\n\n```\n\nthen produces this graph \n![postage.svg](http://sw.twyoung.com/images/postage.svg)\nvets the code, and finally runs it.\nThe result is a running program ready for your enhancements.\n\n#### **_sw.sh_** Synopsis\u003ca name=\"sw.sh\"/\u003e\n\n```\nsw.sh-1.0.1 USAGE: \n\t\tb|build\t\t. Build project with Autotools.\n\t\tc\t\t. Make check\n\t\tcl       \t. Show release check list. \n\t\td  [OPTs]\t. Switch to docker container. \n\t\te\t\t. Exit SW shell.\n\t\td build [OPTs]\t. Build SWdemo docker container. \n\t\tdoc\t\t. Run and browse Doxygen \n\t\tj\t\t. Graph collate.sw with swgraph\n\t\tjl\t\t. Generate and view locusts.png \n\t\tp  [NAME..]\t. Generate project(s) named NAME... \n\t\tpoc\t\t. Build and run Proof of Concept \n\t\trm\t\t. View README in /opt/google/chrome/chrome \n\t\trc\t\t. Build and run Collate program \n\t\trl\t\t. Run locusts program\n\t\ts\t\t. Enter SW shell.  'e' to exit the shell. \n\t\tv\t\t. Display this script version\n\t\tx\t\t. Edit this script\n\t\t--help\t. Display this help\n```\t\t\n\n## BUGS:\u003ca name=\"bugs\"/\u003e\n\n**_sw.Gen_** fails unless all three arguments are present.\n\nStream directors like =\u003e and \u003c= are accepted, but treated the same\nas -\u003e and \u003c-, except for appearing differently in graphs.  \nThe meaning is reserved for future use, which could \nbreak existing networks.\n\t \n\t \n### Fixed\t \n[Fixed with v0.28.7] Subnet process names must be unique, \nbut this is not guaranteed.  Using the same process name in different\nsubnet definitions will no longer cause \nunpredictable, negative consequences.\n\n## Home Page\u003ca name=\"homepage\"/\u003e\n\n(https://sw.twyoung.com)\n## Release Notes\u003ca name=\"releasnotes\"/\u003e\n\n### 0.18.0\n  * Reorganized repo tree structure \n  * Renamed package swbase to sw and moved code to repo root\n  * Changed package swutility to import package sw\n  \n### 0.18.4\n  * Fixes for restructure problems\n  * Fixes to bash scripts \n  * Fixes to githup builds   \n  \n### 0.18.5\n  * More fixes\n  * Moved .../sw/c to .../sw/src\n  \n### 0.18.6\n  * Created gofbp script  \n  * Added sw/testrtn package\n  \n### 0.18.7\n  * Moved build process to project tree root\n  \n### 0.18.8\n  * Fixed count in swbal.sw\n  \n### 0.18.9\n  * Fix testrtn/Sender\n  \n### 0.19.0 \n  * Many fixes to **_swproject_** script     \n  \n### 0.20.1\n  * Fix swgraph file search    \n  \n### 0.20.6\n  * Incorporate component attributes in SWL for future graphing enhancements.\n  * Fix fan logic when connection is missing. \n    \n### 0.20.7\n  * Improve gofbp script\n  * Update README\n\n### 0.20.8 \n  * Created fileio package with GetFile and PutFile and FileT \n    \n### 0.20.10\n  * Provide process attributes.  \n  \n### 0.21.0 \n  * Can generate projects with or without YAML configurationswpro. \n  * Fixes to Wrap function.  \n  \n### 0.21.1\n  * README updates  \n  * Updated SWL.pdf\n  \n### 0.22.0\n  * Go code generation revamped\n  * Typed channels partly implemented, possibly breaking networks\n    with types specified in a director. \n      \n### 0.26.6\n  * Fixed double arrow graph error      \n  \n### 0.26.7\n  * Introduced mkdocs\n  * Attempt to fix go.in yaml  Dependabot alert\n  * Fix build error in swgraph.cswpro\n  \n### 0.26.8\n  * Removed 'default:' error from swgraph.c \n  \n## 0.26.9\n  * Fixed bug with subnet attributes  \n  \n## 0.26.10\n  * Fixed maximum subnet level checking\n  * Introducted mkdocs web site docs\n  \n## 0.26.11\n  * Changed type mismatches from FAILing to WARNING.   \n  \n## 0.27.0 \n  * Changed package name from sw/linux to sw/os\n  * Added sw/os/Debug function   \n  \n## 0.28.0 \n  * Implemented typing of component channels. \n  * Defined underscore '_' as shorthand for 'interface{}' type.\n  * Changed component argument from interface slice to interface in SW components with a single port. \n  * For components with multiple ports; adjacent channels of the same   \n    type are combined into a channel slice.     \n  * Fixed numerous problems with swproject. \n  \n## 0.28.1\n   * Fixed IP type bugs\n   * Updated docs  \n   \n## 0.28.2\n\t* Fixed subnet expansion bugs   \n\t\n## 0.28.3\n    * Fix project generation i/o bug\t\n    \n## 0.28.4\n    * More project generation fixes\t\n    \n## 0.28.6\n    * Fix cfg initialization\n    * Check Wextra warnings.\n    * Remove some dead code    \n    \n## 0.28.7\n    * Prefix subnet process names to make them unique.    \n  \n## 0.28.8 \n    * Fix go.mod yaml.v3 dependency failure -- 'require stretch..v1.1\n    * Point package names to github.com.../sw\n    * Use src/model/sw not bin/sw(removed) in sw.sh/run script\n      \n## Author\u003ca name=\"author\"/\u003e\n\n    Tom Young, streamwork@twyoung.com\n    \n    with thanks to J. Paul Morrison, Phillip W. Young, Sam Watkins, \n    the contributors to flow-based-programming@googlegroups.com, \n    and to the developers/maintainers of Go, gcc, Linux/Ubuntu, \n    BNFC, git, GraphViz, Github and others. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyoung3%2Fsw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyoung3%2Fsw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyoung3%2Fsw/lists"}