{"id":13803600,"url":"https://github.com/kvbc/brackets","last_synced_at":"2025-04-14T11:32:00.673Z","repository":{"id":142635364,"uuid":"289644985","full_name":"kvbc/brackets","owner":"kvbc","description":"An esolang with brackets, a lot of brackets","archived":false,"fork":false,"pushed_at":"2021-06-19T11:58:29.000Z","size":35,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T00:51:13.992Z","etag":null,"topics":["esolang","esolangs","interpreter"],"latest_commit_sha":null,"homepage":"https://kvbc.github.io/brackets/interpreter","language":"JavaScript","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/kvbc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-23T08:22:07.000Z","updated_at":"2025-01-05T23:08:51.000Z","dependencies_parsed_at":"2024-01-04T23:15:10.294Z","dependency_job_id":null,"html_url":"https://github.com/kvbc/brackets","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/kvbc%2Fbrackets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fbrackets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fbrackets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvbc%2Fbrackets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvbc","download_url":"https://codeload.github.com/kvbc/brackets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248871908,"owners_count":21175315,"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":["esolang","esolangs","interpreter"],"created_at":"2024-08-04T01:00:36.032Z","updated_at":"2025-04-14T11:32:00.344Z","avatar_url":"https://github.com/kvbc.png","language":"JavaScript","funding_links":[],"categories":["Languages"],"sub_categories":[],"readme":"# Brackets\r\n\r\nBrackets is an esoteric stack-based programming language. A little bit confusing, because consists only of 4 unique characters. The language uses Instruction Modification Parameter (IMP) and was heavily inspired by [whitespace](https://en.wikipedia.org/wiki/Whitespace_(programming_language)).\r\n\r\n\u0026nbsp;\r\n# Syntax\r\n\r\n| IMP  | Meaning            |\r\n| ---  | -------            |\r\n| `()` | Stack Manipulation |\r\n| `{}` | Arithmetic         |\r\n| `[]` | Flow Control       |\r\n| `\u003c\u003e` | Input / Output     |\r\n\r\n| IMP  | Command | Parameter | Meaning                                             |\r\n| :-:  | :-----: | :-------: | :------                                             |\r\n| `()` | `()`    | Number    | Push the number onto the stack                      |\r\n| `()` | `{}`    | -         | Duplicate the top item on the stack                 |\r\n| `()` | `[]`    | -         | Swap the top two items on the stack                 |\r\n| `()` | `\u003c\u003e`    | -         | Discard the top item on the stack                   |\r\n| `{}` | `()`    | -         | Pop `a` and `b` and push `a + b`                    |\r\n| `{}` | `{}`    | -         | Pop `a` and `b` and push `a * b`                    |\r\n| `{}` | `[]`    | -         | Pop `a` and `b` and push `b / a` rounded down       |\r\n| `{}` | `\u003c\u003e`    | -         | Pop `a` and `b` and push `b % a`                    |\r\n| `[]` | `()`    | -         | Pop `a`, `if (top == a) { ... }`                    |\r\n| `[]` | `{}`    | -         | Pop `a`, `if (top != a) { ... }`                    |\r\n| `[]` | `[]`    | -         | Pop `a`, `while (top != a) { ... }`                 |\r\n| `[]` | `\u003c\u003e`    | -         | Exit the program                                    |\r\n| `\u003c\u003e` | `()`    | -         | Pop `c` and output `c` as a character               |\r\n| `\u003c\u003e` | `{}`    | -         | Pop `n` and output `n` as a number                  |\r\n| `\u003c\u003e` | `[]`    | -         | Read `c` and push it onto the stack as a character  |\r\n| `\u003c\u003e` | `\u003c\u003e`    | -         | Read `n` and push it onto the stack as a number     |\r\n\r\n___\r\n### Numbers\r\n\r\nNumbers in `Braces` are in binary, where `()` represents `0`, and `{}` represents `1`.\r\nThe first bit tells us if the number is positive -`()`, or negative -`{}`. Numbers have to end with an opening arrow bracket `\u003c`.\r\n\r\nHere is an example:\r\n```\r\n(){}(){}()\u003c =\u003e 0-1010 =\u003e 10\r\n{}{}(){}()\u003c =\u003e 1-1100 =\u003e -12\r\n```\r\n___\r\nAny characters other than brackets, are simply ignored.\r\n\r\n\u0026nbsp;\r\n# Examples\r\n\r\n### Alphabet\r\n\r\nThe following program prints the whole english alphabet.\r\n\r\n```c\r\n()() (){}{}()()()(){}\u003c   push 97 'a'\r\n()() (){}{}{}{}(){}{}\u003c   push 123 'z' + 1\r\n[][]{                    while top != 123:\r\n  (){}                      dup\r\n  \u003c\u003e()                      printn\r\n  ()() (){}\u003c                push 1\r\n  {}()                      add\r\n}\r\n```\r\n\r\n### Loops\r\n\r\nSimple `while` loop:\r\n```c\r\n()() (){}{}()(){}()()\u003c   push 100\r\n()() ()()\u003c               push 0\r\n[]\u003c\u003e{                    while top != 0 do top /= 2:\r\n  (){}                      dup\r\n  \u003c\u003e{}                      printn\r\n  ()() (){}(){}()\u003c          push 10 '\\n'\r\n  \u003c\u003e()                      printc\r\n  ()() (){}()\u003c              push 2\r\n  {}[]                      div\r\n}\r\n```\r\n\r\n### Statements\r\n\r\nSimple `if` statements:\r\n```c\r\n()() (){}\u003c     push 1\r\n()() ()()\u003c     push 0\r\n[](){          if 1 == 0:\r\n  ()() (){}\u003c      push 1\r\n  \u003c\u003e{}            printn\r\n}\r\n\r\n()() (){}\u003c     push 1\r\n()() ()()\u003c     push 0\r\n[]{}{          if 1 != 0:\r\n  ()() {}{}\u003c      push -1\r\n  \u003c\u003e{}            printn\r\n}\r\n```\r\n\r\nSimple `if-else` statement:\r\n```c\r\n()() (){}{}\u003c   push 3\r\n()() (){}\u003c     push 1\r\n[](){          if 3 == 1:\r\n  ()() (){}\u003c      push 1\r\n  \u003c\u003e{}            printn\r\n  ()() (){}\u003c      push 1\r\n}\r\n()() (){}\u003c     push 1\r\n[]{}{          if 3 != 1:\r\n  ()() {}{}\u003c      push -1\r\n  \u003c\u003e{}            printn\r\n}\r\n```\r\n\r\nYou can find more examples on the online Brackets interpreter below.\r\n\r\n\u0026nbsp;\r\n# Interpreter\r\n\r\nTry out official Brackets [interpreter](https://kvbc.github.io/brackets/interpreter/) online.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvbc%2Fbrackets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvbc%2Fbrackets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvbc%2Fbrackets/lists"}