{"id":20051862,"url":"https://github.com/p-ranav/box","last_synced_at":"2025-08-22T03:31:56.720Z","repository":{"id":57416167,"uuid":"377000435","full_name":"p-ranav/box","owner":"p-ranav","description":"box is a text-based visual programming language inspired by Unreal Engine Blueprint function graphs.","archived":false,"fork":false,"pushed_at":"2021-08-08T12:22:27.000Z","size":330,"stargazers_count":121,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-23T08:22:18.811Z","etag":null,"topics":["blueprints","blueprints-visual-scripting","box","drawing","esoteric-language","esoteric-programming-language","flow-based-programming","function-graphs","functions","node-graph","python3","transpiler","unreal-engine","visual-programming-language"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p-ranav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-15T01:23:52.000Z","updated_at":"2024-11-11T15:16:44.000Z","dependencies_parsed_at":"2022-08-23T16:40:45.494Z","dependency_job_id":null,"html_url":"https://github.com/p-ranav/box","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-ranav%2Fbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-ranav%2Fbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-ranav%2Fbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p-ranav%2Fbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p-ranav","download_url":"https://codeload.github.com/p-ranav/box/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230554330,"owners_count":18244234,"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":["blueprints","blueprints-visual-scripting","box","drawing","esoteric-language","esoteric-programming-language","flow-based-programming","function-graphs","functions","node-graph","python3","transpiler","unreal-engine","visual-programming-language"],"created_at":"2024-11-13T12:07:19.826Z","updated_at":"2024-12-20T08:08:45.506Z","avatar_url":"https://github.com/p-ranav.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg height=\"90\" src=\"https://user-images.githubusercontent.com/8450091/123720914-cb9a5200-d84a-11eb-97d9-830776297b87.PNG\"/\u003e  \n\u003c/p\u003e\n\n`Box` is a text-based visual programming language inspired by Unreal Engine blueprint function graphs.\n\n```console\n$ cat factorial.box\n\n ┌─ƒ(Factorial)───┐                     ┌─[Branch]─────┐                       ┌─[Set]─┐\n │               ►┼─────────────────────┼►       True ►┼───────────────────────┼►     ►┼─────────┐         ┌─[For Loop]───────────┐                   ┌───────┐\n │             n ○┼──┐               ┌──┼○      False ►┼──┐  ┌──────────┐  ┌───┼○      │         └─────────┼►          Loop body ►┼───────────────────┼►      │\n └────────────────┘  │    ┌────────┐ │  │              │  │  │  result ○┼──┘ ┌─┼○      │                   │                      │ ┌──────────┐ ┌────┼○  *=  │\n             ┌────┐  └────┼○  \u003e=  ○┼─┘  └──────────────┘  │  └──────────┘    │ └───────┘         ┌────┐    │                      │ │  result ○┼─┘  ┌─┼○      │\n             │ 1 ○┼───────┼○       │                      │       ┌────┐     │                   │ 1 ○┼────┼○ start               │ └──────────┘    │ └───────┘\n             └────┘       └────────┘                      │       │ 1 ○┼─────┘                   └────┘    │                      │                 │\n                                                          │       └────┘                                   │               index ○┼─────────────────┘\n                                                          │                        ┌────┐                  │                      │\n                                                          │                        │ n ○┼─┐  ┌───────┐     │                      │\n                                                          │                        └────┘ └──┼○  +   │     │                      │\n                                                          │                        ┌────┐ ┌──┼○     ○┼─────┼○ end                 │\n                                                          │                        │ 1 ○┼─┘  └───────┘     │                      │\n                                                          │                        └────┘                  │                      │\n                                                          │                                      ┌────┐    │                      │\n                                                          │   ┌─[Return]─┐                       │ 1 ○┼────┼○ step                │\n                                                   ┌────┐ └───┼►         │                       └────┘    │           Completed ►┼────┐\n                                                   │ 1 ○┼─────┼○         │                                 └──────────────────────┘    │  ┌─[Return]─┐\n                                                   └────┘     └──────────┘                                               ┌─────────┐   └──┼►         │\n                                                                                                                         │ result ○┼──────┼○         │\n                                                                                                                         └─────────┘      └──────────┘\n\n$ box factorial.box -e 5\n120\n\n$ box factorial.box -o factorial.py\n\n$ cat factorial.py\ndef Factorial(n):\n    if (n \u003e= 1):\n        result = 1\n        for index_8b6ee4f2 in range(1, (n + 1), 1):\n            result *= index_8b6ee4f2\n        return result\n    else:\n        return 1\n```\n\n### Getting Started\n\nInstall the box interpreter with `pip`\n\n```console\npip3 install boxlang\n```\n\nNow open your text editor and start drawing your program! Check out existing samples [here](https://github.com/p-ranav/box/tree/main/samples). \n\n### Anatomy of a Box\n\nA Box has 2 types of ports: control flow ports (`─►┼─`) and data flow ports (`─○┼─`). These ports can additionally be classified as input or output ports. All ports to the left side of a box are input ports and all ports on the right side of the box are output ports. \n\nBelow, you can see a `[For Loop]` box which is a special type of box that the interpreter can parse - It has 1 input control flow port, 3 input data flow ports (start, end, and step), 2 output control flow ports (the loop body and completed control flows), and 1 output data flow port (the index)\n\n![image](https://user-images.githubusercontent.com/8450091/124202730-a69f1c80-daa0-11eb-8cd8-55a8447dc224.png)\n\n### Function Graphs\n\n`Box` programs are function graphs. Functions have a single entry point designated by a node with the name of the Function containing a single output control flow port. \n\nHere's a simple hello world example. This example declares a `Greet()` function that prints the string \"Hello, World!\" to the console. It calls the built-in print function.\n\n![image](https://user-images.githubusercontent.com/8450091/124202751-b28ade80-daa0-11eb-8be6-6d5157eed822.png)\n\nExecute the above program with the box interpreter like so:\n\n```console\n$ box samples/hello_world.box -e\nHello,World!\n```\n\n### Features\n\n* ✅ Function declarations\n* ✅ Defining constants and variables\n* ✅ Operators - Unary, binary, and assignment operators\n* ✅ `[Set]` - set the value of variables\n* ✅ Function calls - Call Python built-in functions\n* ✅ `[Branch]` - if-else box\n* ✅ `[For Loop]` - Python-style for loop with (start,end,step)\n* ✅ `[While Loop]` - Python-style while loop\n* ✅ `[For Each]` for iterables\n* ✅ `[Break]` and `[Continue]` boxes\n* ✅ `[Return]` box to return values from functions\n\n### Gotchas\n\n* The interpreter will likely fail if you have tabs in your file - replace all tabs with the appropriate number of spaces\n* There are a number of UNICODE character you'll need for this to work - Just look through the samples and COPY-PASTE (no, seriously)\n\n## Contributing\nContributions are welcome, have a look at the [CONTRIBUTING.md](CONTRIBUTING.md) document for more information.\n\n## License\nThe project is available under the [MIT](https://opensource.org/licenses/MIT) license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-ranav%2Fbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp-ranav%2Fbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp-ranav%2Fbox/lists"}