{"id":17250666,"url":"https://github.com/statusfailed/hyperast","last_synced_at":"2025-03-26T06:43:00.373Z","repository":{"id":239589264,"uuid":"792383071","full_name":"statusfailed/hyperast","owner":"statusfailed","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-15T05:36:23.000Z","size":26,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T08:18:55.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/statusfailed.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-26T14:57:27.000Z","updated_at":"2024-05-14T13:47:55.000Z","dependencies_parsed_at":"2024-05-13T14:02:38.543Z","dependency_job_id":"67015ec3-331e-4b67-ac10-a4298dbb30a4","html_url":"https://github.com/statusfailed/hyperast","commit_stats":null,"previous_names":["statusfailed/hyperast"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fhyperast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fhyperast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fhyperast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statusfailed%2Fhyperast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statusfailed","download_url":"https://codeload.github.com/statusfailed/hyperast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245605709,"owners_count":20643030,"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":[],"created_at":"2024-10-15T06:49:17.330Z","updated_at":"2025-03-26T06:43:00.352Z","avatar_url":"https://github.com/statusfailed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HyperAST\n\nA (currently experimental) frontend to\n[open-hypergraphs](https://github.com/statusfailed/open-hypergraphs/)\nwhich lets you define open hypergraphs in a pointful\n(i.e., not [point-free](https://en.wikipedia.org/wiki/Tacit_programming) ) style.\nHere's a 1-bit adder circuit:\n\n    @hypergraph\n    def adder(x0, x1):\n        y0 = x0 + x1 # sum\n        y1 = x0 * x1 # carry\n        return [y0, y1]\n\nThis builds an open hypergraph representing a string diagram like this:\n\n![adder diagram](./propaganda/adder.png)\n\nUnlike python code, hypergraphs are fully combinatorial: there is no implicit\nassumption of 'causal' control flow.\nFor example, we can define a hypergraphs with *feedback*, such as a\n[ring oscillator](https://en.wikipedia.org/wiki/Ring_oscillator):\n\n    @hypergraph\n    def ring_oscillator():\n        x0 = node()\n        x1 = ~x0 # we use x0 before declaring it - this is OK!\n        unify(x0, ~x1) # connect x0 and x1\n        return [x0]\n\nThis defines a string diagram like the one below:\n\n![ring oscillator diagram](./propaganda/ring_oscillator.png)\n\n# Alternative interface\n\nThere is also a WIP alternative interface which inspects python syntax to define\na hypergraph.\nVariables serve as hypernodes while functions and python operators are (labeled)\nhyperedges.\n The first example looks the same:\n\n    @hypergraph\n    def adder(x0, x1):\n        y0 = x0 + x1 # sum\n        y1 = x0 * x1 # carry\n        return [y0, y1]\n\n... but there is less overhead when writing hypergraphs with more unusual\nstructure:\n\n    @hypergraph\n    def ring_oscillator():\n        x1 = ~x0 # we use x0 before declaring it - this is OK\n        x0 = ~x1\n        return [x0]\n\nUnlike the normal interface, this style does not execute the python code; it\nonly inspects it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatusfailed%2Fhyperast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatusfailed%2Fhyperast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatusfailed%2Fhyperast/lists"}