{"id":13819758,"url":"https://github.com/jweinst1/Wind","last_synced_at":"2025-05-16T07:32:00.616Z","repository":{"id":97724452,"uuid":"111324735","full_name":"jweinst1/Wind","owner":"jweinst1","description":"The Flow-based Programming Language","archived":false,"fork":false,"pushed_at":"2018-06-22T22:54:06.000Z","size":6889,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T13:54:09.567Z","etag":null,"topics":["compiler","data-processing","flow-based-programming","programming-language","reactive-programming"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jweinst1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-19T19:21:44.000Z","updated_at":"2025-04-01T09:19:14.000Z","dependencies_parsed_at":"2023-07-22T21:17:04.067Z","dependency_job_id":null,"html_url":"https://github.com/jweinst1/Wind","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweinst1%2FWind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweinst1%2FWind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweinst1%2FWind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweinst1%2FWind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jweinst1","download_url":"https://codeload.github.com/jweinst1/Wind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254488318,"owners_count":22079402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["compiler","data-processing","flow-based-programming","programming-language","reactive-programming"],"created_at":"2024-08-04T08:00:52.630Z","updated_at":"2025-05-16T07:31:59.180Z","avatar_url":"https://github.com/jweinst1.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Wind\n\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/jweinst1/Wind/blob/master/LICENSE.md)\n\n![Logo](images/windlogo.png)\n\nThe Flow-based Programming Language\n\n![Main Md Gif](images/intro_wind.gif)`\n\n# Table of Contents\n\n- [Intro](#intro)\n- [Installation](#installation)\n  - [Memory Customization](#memory-customization)\n     - [wind mem buf](#wind_mem_buf)\n     - [wind mem load](#wind_mem_load)\n     - [wind mem comp](#wind_mem_comp)\n- [Usage](#usage)\n- [Guide](#guide)\n  - [Syntax](#syntax)\n     - [Syntax Errors](#syntax-errors)\n  - [Types](#types)\n     - [None](#none)\n     - [Bools](#bools)\n     - [Numbers](#numbers)\n  - [Commands](#commands)\n     - [out](#out)\n     - [push](#push)\n     - [clr](#clr)\n     - [map](#map)\n     - [filter](#filter)\n     - [reduce](#reduce)\n     - [save](#save)\n     - [load](#load)\n- [Stage](#stage)\n\n## Intro\n\n`Wind` is a fast, portable programming language based on the concept of flows, or specifically Flow-based programming . `Wind` is designed to make it easy to filter, map, reduce, through large amounts of dynamic data. Wind is built in a highly unique way that allows data to flow from one container to another. `Wind` views code as a continuous flow of information, not singular programs. `Wind` uses no virtual machine, but a method of transporting and transforming data from one place to another.\n\nWind filters data with simple, straight forward syntax:\n\n```\nwind\u003e push 5 6 77 44 -\u003e out -\u003e filter \u003e 10 -\u003e out -\u003e filter -\u003e out\n[ 5 6 77 44 ]\n[ 77 44 ]\n[ 77 44 ]\nwind\u003e out\n[ 77 44 ]\n```\n\nIt can also seamlessly reduce and transform data\n\n```\nwind\u003e push 5 5 5 -\u003e out\n[ 5 5 5 ]\nwind\u003e map ** 4 | - 1 -\u003e reduce +\nwind\u003e out\n[ 1872 ]\n```\n\nTo optimize both speed and memory usage, `Wind` does not use dynamic memory allocation. It relies on static memory. The advantages of this is to allow the amount of memory Wind uses to be highly customizable at compile time, and to make `Wind` a truly scalable language, one that fits in embedded systems, or much larger, heavy systems.\n\nWind, although not a *natively* compiled language, also is not a true interpreted language. It does not use it's own byte code instruction set, nor does it form abstract syntax trees from source code. It reads code as data and executes it directly.\n\n## Installation\n\nTo build `Wind` from source, run the following command in your terminal\n\n```\n$ make all\n```\n\nTo clean excess build files, run\n\n```\n$ make clean\n```\n\n### Memory Customization\n\nIn `Wind`, you can fully customize and scale the amount of memory wind uses. To do this, there are a few vars in `Makefile` that control the memory used by various buffers in the language.\n\n#### `WIND_MEM_BUF`:\n\nThis variable determines the sizes of the active and inactive buffers, where the current data of the running wind program lives. This size correlates to an amount of bytes.\n\n#### `WIND_MEM_LOAD`:\n\nControls the amount of memory used by the loading buffer. Generally limits the amount of arguments that can \"flow\" over a command.\n\n#### `WIND_MEM_COMP`:\n\nControls the amount of memory used by the computation buffer. This limits the size of individual values `Wind` can handle.\n\nHowever, you can just leave these as is and use their default values.\n\n## Usage\n\nOnce you build `Wind`, you will have an executable under the `bin/` directory. You can run it with several commands.\n\nRunning the executable with no commands opens the repl, which allows you to interactively execute Wind code. Here's an example:\n\n```\nWind - Version (0.0.1)\nThe Wind Programming Language REPL\nTo exit, simply enter 'exit'.\nwind\u003e push 7 7 7 8\nwind\u003e out\n[ 7 7 7 8 ]\nwind\u003e map + 5 | / 3\nwind\u003e out\n[ 4 4 4 4.333 ]\nwind\u003e filter \u003e 4 -\u003e out\n[ 4.333 ]\nwind\u003e exit\n```\nAt any time in the repl, typing `exit`, will close the program.\n\n#### `-c`:\n\nThe `-c` flag allows you to run a string of `Wind` code, like this\n\n```\n$ Wind -c \"push 5 -\u003e out -\u003e clr\"\n[ ]\n```\n\n#### `-d`:\n\nThe `-d` flag allows you to run a string of `Wind` code and also get debug information\n\n```\n$ Wind -d \"push 5 6 77 44 -\u003e out -\u003e filter \u003e 10 -\u003e out -\u003e filter \u003c 76 -\u003e out\"\n[ 5 6 77 44 ]\n[ 77 44 ]\n[ 44 ]\n_____Wind___Debug_______\n..........State.........\nHas Error: false\nMode: Command\nCommand: null\n..........Data.........\nLoad Buffer: -\u003e [ ]\nActive Buffer: -\u003e [ 44 ]\nInactive Buffer: -\u003e [ 77 44 ]\n________________________\n```\n\n#### `-t`:\n\nThe `-t` flag allows for a string of `Wind` code to be run and timed:\n\n```\nWind -t \"push 5 3 4 -\u003e reduce + -\u003e out -\u003e push 6 6 6 6 6 6 6 -\u003e reduce + -\u003e out -\u003e push 6 5 -\u003e map * 7 -\u003e reduce + -\u003e out\"\n[ 12 ]\n[ 54 ]\n[ 455 ]\nTime: 0.000081\n```\n\n#### `-h`:\n\nThe `-h` flag prints the `Wind` help manual to stdout. You can find more detailed guides in the wiki for this repo. A website in the near future will have a full fledged documentation.\n\n## Guide\n\nThe following details the language components, features, and syntax.\n\n### Syntax\n\nThe `Wind` language uses a continuous, stream-like syntax. It is meant to be read in a linear, straight fashion that emphasizes fixed units of commands and computation.\n\nThe general format of `Wind` is the following:\n\n```\n(command) (arguments ...) -\u003e (command) (arguments ...)\n```\n\nComments are denoted by bounded semicolons, between `;`, such as\n\n```\npush 5 -\u003e ;this is a comment; out\n```\nwhere anything between the semicolons is ignored.\n\nThe `-\u003e` symbol indicates the end of one command-argument sequence and the transition of `Wind` to execute that command with the read arguments. More information about the low level architecture of `Wind` will be available in the wiki.\n\n#### Syntax Errors\n\nCommands and arguments to commands, (values), share separate namespaces. Any incorrect command or value picked up by `Wind` will result in a syntax error. Here is an example:\n\n```\nwind\u003e push l -\u003e out\nError: Expected argument or value, found 'l'\n```\n`l` does not correspond to any recognizable value.\n\n### Types\n\nThe `Wind` language uses several types, all of which are immutable. `Wind` formats data in a marked, binary format. The language does not use heap-allocated types or objects. All types are kept on various `static` arrays. This enables very simple copying and flowing of data.\n\n#### None\n\nThe `None` type in Wind signifies a singular state value of being nothing. It is similar to `nil` or `null` in other languages. There isn't a whole lot to do with None, but None corresponds to a false boolean value. \n\nIn certain boolean operations, like the not operator, `!`, it will evaluate to `False`.\n\n```\nwind\u003e push None None None -\u003e out\n[ None None None ]\nwind\u003e map ! -\u003e out\n[ False False False ]\n``` \n\n#### Bools\n\nThe `Bool` type in `Wind` consists of two possible values, `True` and `False`. This type is used to represent logical false and true results and data. Depending on the operation, bools can also be represented as `Number` values. In the case of filtering, the situation of not being a `Number` causes them to fail the greater than filter.\n\n```\nwind\u003e push 5 True False -\u003e out\n[ 5 True False ]\nwind\u003e filter \u003e 0 -\u003e out\n[ 5 ]\n```\n\nHowever, with mapping, True corresponds to `1` while False corresponds to `0`.\n\n```\nwind\u003e push 5 -\u003e map + True False | * True -\u003e out\n[ 6 ]\n```\n\n#### Numbers\n\nIn `Wind`, numbers represent numerical data. They are implemented as 64-bit, double precision floating point numbers. Yet, in printed representation, they are represented as either integers, or floats, depeneding on their value.\n\n```\nwind\u003e push 5 5 5 -\u003e out\n[ 5 5 5 ]\n```\nYet if numbers aren't convertible to integers, they will be printed differently:\n\n```\nwind\u003e push 5 5 5 -\u003e out\n[ 5 5 5 ]\nwind\u003e  map / 60 -\u003e out\n[ 0.083 0.083 0.083 ]\nwind\u003e  map ** 0.3 -\u003e out\n[ 0.475 0.475 0.475 ]\n```\n\n#### Strings\n\nStrings in `Wind` don't have too much functionality right now, but a lot more is planned for the future. Mentioned elsewhere in this guide is using strings as paths to load and save `.bwind` files.\n\nStrings are always bounded by `\"` double quotes.\n\n### Commands\n\nThe `Wind` language uses an effecient set of commands to manipualte and process a flow of data. Commands are named words that appear before an arbitrary sequence of arguments.\n\n#### out\n\nThe `out` command prints the currently active data into stdout.\n\n*Example*\n\n```\nwind\u003e push 5 -\u003e out\n[ 5 ]\nwind\u003e clr -\u003e out\n[ ]\n```\n\n#### push\n\nThe `push` command appends new data to the end of the active data. It can take an arbitrary number of arguments.\n\n*Example*\n\n```\nwind\u003e push None True False 0 1 2 3\nwind\u003e out\n[ None True False 0 1 2 3 ]\n```\n\n#### clr\n\nThe `clr` command clears all the data from the active buffer. This doesn't incur the cost of erasing data, it simply sets the end of the active buffer back to the beginning, and allows overwriting of the old data. It takes no arguments.\n\n*Example*\n\n```\nwind\u003e push 3 3 3 3 -\u003e out\n[ 3 3 3 3 ]\nwind\u003e clr -\u003e out\n[ ]\n```\n\n#### map\n\nThe `map` command transforms data over a flow of operations. Mapping can take place with a variety of operations, such as adding, subtracting, assigning, and much more. Besides for the `Del` op, mapping never erases data.\n\n```\nwind\u003e push 6 7 8 9 10 12 14\nwind\u003e out -\u003e map + 1 | * 3 -\u003e out\n[ 6 7 8 9 10 12 14 ]\n[ 21 24 27 30 33 39 45 ]\nwind\u003e map / 55 | ** 3 -\u003e out\n[ 0.056 0.083 0.118 0.162 0.216 0.357 0.548 ]\n```\nWithin the arguments read after a `map` command, each oper symbol can have only specific values that are valid after it. The pipe `|` is used to transition to the mapping of another symbol and it's sub-arguments. Attempting to map unmappable types results in an error:\n\n```\nwind\u003e push 5 5 5\nwind\u003e map + 5 3 2\nwind\u003e out\n[ 15 15 15 ]\nwind\u003e map + 4 - 3\nError: Attempted to use + operator on arg with type: 'Minus'\n```\nSome types in `Wind` can be treated as having number values. In this case, they can be used in mapping operations that involve typically number operations such as `+`:\n\n```\nwind\u003e push 7 -\u003e out\n[ 7 ]\nwind\u003e push 5 -\u003e map + True False 1 -\u003e out\n[ 9 7 ]\n```\n\n#### filter\n\nThe `filter` command allows the limitation and restriction of a data flow. It permits the passing or failing of flowing from the one buffer to another based on a boolean condition. The `filter` command can be used with operators like `\u003e` and `\u003c`.\n\n```\nwind\u003e push 6 7 8 9 15.04 -\u003e out\n[ 6 7 8 9 15.040 ]\nwind\u003e filter \u003e 8 -\u003e out\n[ 9 15.040 ]\nwind\u003e filter \u003e 15.02 -\u003e out\n[ 15.040 ]\n```\n\n#### reduce\n\nThe `reduce` command fuses and squashes data together into smaller data, or in many cases a single value. For now, `reduce` only works with one operator, `+`, but many more will be added in the future.\n\n```\nwind\u003e push 666 777 888 -\u003e out\n[ 666 777 888 ]\nwind\u003e map ** 3 -\u003e out -\u003e reduce +\n[ 295408296 469097433 700227072 ]\nwind\u003e out\n[ 1464732801 ]\n```\n\n#### save\n\nThe `save` command allows the current, active data inside Wind to be saved to an file on disk with the `.bwind` file extension. More info on the binary specification can be found in the wiki. The idea behind this command, and the `load` command is it allows `Wind` to process and emit data in an instantly available format. Internally, `save` is just a write of the active buffer bytes to a file.\n\n```\nwind\u003e push True False 3 2 -\u003e out\n[ True False 3 2 ]\nwind\u003e save \"samplefile\"\nSaved at: samplefile.bwind\n```\n\nThe argument to save is always a string that indicates a path, without the extension. The newly created file will have a sequence of bytes formatted like this:\n\n```\n[bool mark][bool body = 1]\n[bool mark][bool body = 0]\n[number mark][number body = 3 \u003cdouble\u003e]\n[number mark][number body = 2 \u003cdouble\u003e]\n```\nWhere the bool body is a single byte, and the number body is a 64-bit floating point number. The pattern of the `Wind` binary format is using typed sequences of bytes. A large advantage of this is internally, it makes data easily copyable and immutable.\n\n#### load\n\nThe `load` command is used to load `.bwind` files into the active buffer. This command permits direct, instant access to `Wind` typed data stored on disk. As explained previously, the loading and saving components of `Wind` allows the processing of data across a broader, vaster set of data than what can be stored inside the active buffer.\n\n```\nwind\u003e push None 5 5 -\u003e out\n[ None 5 5 ]\nwind\u003e save \"test\"\nSaved at: test.bwind\nwind\u003e clr -\u003e out\n[ ]\nwind\u003e load \"test\" -\u003e out\nLoaded data from: test.bwind\n[ None 5 5 ]\n```\nIf the file path attempting to be loaded from cannot be read or does not exist, you will get an error like this:\n\n```\nwind\u003e load \"test1\"\nError: File path 'test1' cannot be read from.\n```\n\n## Stage\n\n`Wind` is currently in the alpha development stage, the first production release version is still in progress. The language format and overall scheme will not change, but many components and values will be added to it in the near future. When an initial release is made, a specification for the language will also be published.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjweinst1%2FWind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjweinst1%2FWind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjweinst1%2FWind/lists"}