{"id":15639027,"url":"https://github.com/presidentbeef/brat","last_synced_at":"2025-04-16T04:44:12.827Z","repository":{"id":550239,"uuid":"180578","full_name":"presidentbeef/brat","owner":"presidentbeef","description":"Brat is a little language for people who don't like to be told what to do.","archived":false,"fork":false,"pushed_at":"2022-10-08T16:34:30.000Z","size":17890,"stargazers_count":94,"open_issues_count":4,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-10T04:57:30.577Z","etag":null,"topics":["brat","language","lua","luajit","programming-language"],"latest_commit_sha":null,"homepage":"https://www.brat-lang.info/","language":"C","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/presidentbeef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-04-20T06:10:27.000Z","updated_at":"2024-11-30T14:02:27.000Z","dependencies_parsed_at":"2023-01-11T15:47:21.234Z","dependency_job_id":null,"html_url":"https://github.com/presidentbeef/brat","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/presidentbeef%2Fbrat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presidentbeef%2Fbrat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presidentbeef%2Fbrat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/presidentbeef%2Fbrat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/presidentbeef","download_url":"https://codeload.github.com/presidentbeef/brat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249197453,"owners_count":21228569,"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":["brat","language","lua","luajit","programming-language"],"created_at":"2024-10-03T11:24:24.843Z","updated_at":"2025-04-16T04:44:12.806Z","avatar_url":"https://github.com/presidentbeef.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brat\n\n[![Build Status](https://travis-ci.org/presidentbeef/brat.svg?branch=master)](https://travis-ci.org/presidentbeef/brat)\n\n[Try Brat online!](http://try.brat-lang.org/)\n\nBrat is a simple little toy language that lets you do what you want. It is primarily object-oriented with first-class functions and very little syntax.\n\nBrat is flexible enough that you can get by with a very small core and write any functionality that most languages use keywords for. For example, you can write and use a while loop like so:\n\n    # Loops until the block returns false\n    while = { block |\n        true? block, { while -\u003eblock }\n    }\n\n    # Print 1 through 9\n    n = 1\n    while {\n        p n\n        n = n + 1\n        n \u003c 10\n    }\n\nIf you would rather have your conditions be separated out, you could define it this way instead:\n\n    # Loops until condition is false\n    while = { condition, block |\n        true? condition, { block; while -\u003econdition, -\u003eblock }\n    }\n\n    n = 1\n    while { n \u003c 10 } { p n; n = n + 1 }\n\nBrat compiles to Lua and runs on [LuaJit](http://luajit.org/).\n\n# Features\n\n* Dynamically typed\n* Everything is object, except functions\n* And functions are closures, which can be attached to objects to make methods\n* Objects use a prototyping system and are completely open\n* Built-in hash tables and dynamic arrays\n* Very flexible unary and binary operators\n* Tail calls are optimized to make infinite loops faster (and more infinite)\n\n# Requirements\n\nPlease have on hand:\n\n* Linux or OS X\n* The usual development tools (like `make` and `gcc`)\n* Git if you want to check it out of the repository directly - `sudo urpmi git-core` (or the equivalent for your platform)\n\n# Installation\n\nPlease follow the following steps, in the order in which they are ordered. Otherwise, results are not guaranteed.\n\nWith Git:\n\n   1. Clone the latest Brat version: `git clone git://github.com/presidentbeef/brat.git`\n   2. Change to new directory: `cd brat`\n   3. Run `sh ./build.sh`\n   4. Optionally, run `sudo sh ./install.sh`. This will install in `/usr` by default. Append a directory to change this.\n\n\nWithout Git:\n\n   1. Download the [latest](https://github.com/presidentbeef/brat/archive/master.zip)\n   2. Decompress the archive (`unzip brat-master.zip`)\n   3. Change to the new directory (`cd brat-master`)\n   3. Run `sh ./build.sh`\n   4. Optionally, run `sudo sh ./install.sh`. This will install in `/usr` by default. Append a directory to change this.\n\n# Testing\n\nTry out your newly discovered power thusly:\n\n   1. Create a new file, perhaps called `test.brat`\n   2. In that file, type something like: `p \"OK COMPUTER\"`\n   3. Save and close it\n   4. Return to the comfort of your command line\n   5. Type `brat test.brat` (or `./brat test.brat` if you did not run the install script)\n   6. Cross fingers\n   7. Press enter\n   8. Marvel or weep, as appropriate\n\n# More Testing\n\nRun `brat test/test.brat` to run the test suite. SWEET.\n\n# More fun\n\nRunning Brat without specifying a file will launch interactive mode.\n\n    $ ./brat\n    # Interactive Brat\n    brat:1\u003e 1 + 1\n    #=\u003e 2\n\n# Even more fun\n\nTake a look at [some examples](http://brat-lang.org/examples.html) of Brat code.\n\n# Problems\n\nSometimes there are problems. Everyone has issues. Report Brat issues [here](https://github.com/presidentbeef/brat/issues).\n\n# License\n\nThe MIT License\n\nCopyright (c) 2009-2019, Justin Collins\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresidentbeef%2Fbrat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpresidentbeef%2Fbrat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpresidentbeef%2Fbrat/lists"}