{"id":20304048,"url":"https://github.com/erp12/plushi","last_synced_at":"2025-09-22T20:30:48.143Z","repository":{"id":80365685,"uuid":"117872739","full_name":"erp12/plushi","owner":"erp12","description":"An embeddable, language agnostic Push language interpreter","archived":false,"fork":false,"pushed_at":"2019-05-16T12:59:04.000Z","size":250,"stargazers_count":5,"open_issues_count":12,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-14T16:48:46.115Z","etag":null,"topics":["automatic-programming","clojure","interpreter","language-agnostic","machine-learning","pushgp","software-synthesis"],"latest_commit_sha":null,"homepage":"https://erp12.github.io/plushi/index.html","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erp12.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.html","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-17T17:59:24.000Z","updated_at":"2024-11-02T11:22:11.000Z","dependencies_parsed_at":"2023-06-06T09:15:26.201Z","dependency_job_id":null,"html_url":"https://github.com/erp12/plushi","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/erp12%2Fplushi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erp12%2Fplushi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erp12%2Fplushi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erp12%2Fplushi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erp12","download_url":"https://codeload.github.com/erp12/plushi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233884354,"owners_count":18745389,"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":["automatic-programming","clojure","interpreter","language-agnostic","machine-learning","pushgp","software-synthesis"],"created_at":"2024-11-14T16:42:36.766Z","updated_at":"2025-09-22T20:30:42.826Z","avatar_url":"https://github.com/erp12.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plushi\n\n[![CircleCI](https://circleci.com/gh/erp12/plushi.svg?style=svg)](https://circleci.com/gh/erp12/plushi)\n\n\nPlushi is an embadable language agnostic push interpreter capable of running\npush programs via JSON interface.\n\nPush is a programming language designed for AI systems to write software in.\nIt has virtually no syntax and supports all common data types and can express\na variety of control structures and data structures.\n\nTo read more about the push language, see the [Push Redux](https://erp12.github.io/push-redux/).\n\n\n## Installation\n\nDownload the standalone jar from https://github.com/erp12/plushi/releases.\n\nTo build your own standalone jar, clone the repository and run the following\n[leiningen](https://leiningen.org/) commands.\n\n```\nlein deps\nlein uberjar\n```\n\nFor easy integration with Clojure projects, a public clojars release coming soon!\n\n\n## Usage\n\nThe Plushi interpreter is wrapped in an HTTP server written using [ring](https://github.com/ring-clojure/ring).\nAny environment capable of making POST requests can use Plushi. JVM languages\ncan also attempt to use plushi via inerop, although this is not the primary\ndesign goal.\n\n\n### Starting the Plushi Server\n\nTo start the plushi HTTP server, simply run the jar with the `--start` flag.\n\n```sh\njava -jar plushi-0.1.0-standalone.jar --start\n# or\n$ java -jar plushi-0.1.0-standalone.jar -s\n```\n\nThe default port is `8075`. To specify the port number, supply the `--port` flag\nfollowed by a valid port number.\n\n```sh\njava -jar plushi-0.1.0-standalone.jar --start --port 8076\n# or\n$ java -jar plushi-0.1.0-standalone.jar -s -p 8076\n```\n\n## Request Actions\n\nAll of the actions required to synthesis plushi programs are available via POST\nrequests to the plushi HTTP server. Other applications can send JSON blobs that\ndescribe what action the plushi server should take.\n\n### Getting the Supported Instructions\n\nThe Plushi interpreter supports a set of instructions which can appear in\nprograms along side literals (ints, floats, strings, booleans). These instructions\nand literals in a linear sequence is a \"plush program\" which can be executed by\nthe plushi interpreter.\n\nTo request the Plushi instruction set, the JSON blob in the request body must\nhave 2 keys: `\"action\"` and `\"arity\"`. The value of the `\"action\"` key must\nbe `\"instructions\"` and the value of the `\"arity\"` key should be an integer\ndenoting how many inputs the programs you would like to generate will accept.\n\nBelow is an example of this in python.\n\n```py\nimport json, requests\ninstr_set = requests.post(\"http://localhost:8075/\", json=json.dumps({\n  'action': 'instructions',\n  'arity': arity\n})).json()\n```\n\n### Getting the Supported Types\n\nDepending on what kinds of programs you intend on synthesizing, it maybe be\nhelful to know what kinds of data types the Plushi interpreter is capable of\nmanipulating. The `\"types\"` action returns this information on requst.\n\nBelow is an example of this in python.\n\n```py\nimport json, requests\nplushi_types = requests.post(\"http://localhost:8075/\",\n                             json=json.dumps({'action': 'types'})).json()\n```\n\n### Running a Plushi Program\n\nIf the value associated with the `\"action\"` key is `\"run\"` then Plushi will\nexpect to be running a given plush program.\n\nBelow is an example of request made through python. All of the required and\noptional values are described in detail in the paragraphs below.\n\n```py\nimport json, requests\nX = json.load(\"data.json\")\nrequest_body = {\n  'action': 'run',\n  'code': [1, 2, \"plushi:integer_add\"],\n  'arity': 1,\n  'output-types': ['integer'],\n  'dataset': X\n}\noutputs = requests.post(\"http://localhost:8075/\",\n                        json=json.dumps(request_body)).json()\n```\n\n#### `\"code\"`\n\nThe value for the `\"code\"` key should be a flat list containing valid plushi atoms.\nA valid plushi atom can be any of the following:\n\n- an integer\n- a float\n- a boolean\n- a string\n\nIf a string atom is equal to a name of any instruction (ie `\"plushi:float_mult\"`)\nPlushi will assume that the atom at that position should be the instruction.\nOtherwise the string (or any other atom) will be assumed to be a literal.\n\nUnlike other implemenations of the the Push language, Plushi programs are always\nlinear. Certain instructions (ie. `exec_if`) assume that the subsequent atom is\na nested Push expression (or \"code block\"). Plushi has a dedicated instruction\ncalled `close` which denotes the closing of a code block. Using these instructions\na linear Plushi program can be translated into a traditional, executable Push\nprogram. If no code blocks are open, the `close` instructions are a noop.\n\n#### `\"arity\"`\n\nAn integer denoting how many inputs the program specified by `\"code\"` will expect. This is also the number of features in the dataset.\n\n#### `\"output-types\"`\n\nA list of plushi types to return after program execution. If more than one value\nof a certain type should be output, that type name should appear in the list\nmultiple times.\n\nFor example a program which returns two integer and a string should set the\n`\"output-types\"` value to `[\"integer\", \"integer\", \"string\"]`.\n\n### `\"dataset\"`\n\nPlushi is designed to be used inside of inductive machine learning frameworks.\nThus, it is expected that each program will need to be run on an entire dataset\nof inputs for evaluation.\n\nThe value of the `\"dataset\"` key is expected to be a list of JSON objects.\nEach JSON object is one record in the dataset with the keys being feature names\nand values being feature values.\n\n```json\n[\n  {\"name\" : \"Alice\", \"age\": 31},\n  {\"name\" : \"Bob\", \"age\": 45},\n  {\"name\" : \"Cathy\", \"age\": 24},\n]\n```\n\n\u003e The dataset should not contain the training label you are trying to predict.\n\u003e Currently Plushi only requires you specify the arity of the program, not the\n\u003e names of which feature to use, and thus Plushi may  use your label as an input\n\u003e by mistake.\n\n## Examples\n\nBelow is a list of other projects which use Plushi:\n\n- [plushi-annealing](https://github.com/erp12/plushi-annealing) - A simple simulated annealing algorithm for synthesizing Plushi programs.\n\n\n## Contributing\n\nAll contributions and ideas are strongly encouraged!\n\nTo see the list of proposed new features and changes, check the issues on the\nproject's issues. Feel free to open new issues with any ideas or suggestions.\n\nIf you would like to contribute to either the source code or the documentation,\nplease follow the \"GitHub Flow\" which is simply summarized\n[here](https://guides.github.com/introduction/flow/).\n\nTLDR:\n1. Fork the official repository.\n2. Create a branch for your contribution.\n3. Make commits (Including tests).\n4. Open a pull request and await review and merge.\n\n\n## License\n\nCopyright © 2018 Edward Pantridge\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferp12%2Fplushi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferp12%2Fplushi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferp12%2Fplushi/lists"}