{"id":13432385,"url":"https://github.com/HigherOrderCO/HVM","last_synced_at":"2025-03-16T23:31:17.667Z","repository":{"id":38418814,"uuid":"443977141","full_name":"HigherOrderCO/HVM","owner":"HigherOrderCO","description":"A massively parallel, optimal functional runtime in Rust","archived":false,"fork":false,"pushed_at":"2024-09-04T09:50:14.000Z","size":7915,"stargazers_count":10476,"open_issues_count":50,"forks_count":397,"subscribers_count":98,"default_branch":"main","last_synced_at":"2024-10-29T15:39:35.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://higherorderco.com","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HigherOrderCO.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-03T07:35:16.000Z","updated_at":"2024-10-28T06:50:52.000Z","dependencies_parsed_at":"2023-02-18T22:30:42.132Z","dependency_job_id":"8e79dbd3-f68f-4d10-9089-9bd58061d535","html_url":"https://github.com/HigherOrderCO/HVM","commit_stats":{"total_commits":700,"total_committers":44,"mean_commits":"15.909090909090908","dds":"0.44285714285714284","last_synced_commit":"e0cf01b0920722bdaa0144bed5b9ea595b30481c"},"previous_names":["kindelia/hvm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HigherOrderCO%2FHVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HigherOrderCO%2FHVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HigherOrderCO%2FHVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HigherOrderCO%2FHVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HigherOrderCO","download_url":"https://codeload.github.com/HigherOrderCO/HVM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243949887,"owners_count":20373654,"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-07-31T02:01:10.976Z","updated_at":"2025-03-16T23:31:17.654Z","avatar_url":"https://github.com/HigherOrderCO.png","language":"Cuda","funding_links":[],"categories":["Programming Language","Cuda","Rust","其他_机器学习与深度学习","others","Frameworks","GPU Programming","Implementations","Uncategorized","Repos","List of features"],"sub_categories":["Libraries","Uncategorized","Symmetric Interaction Calculus"],"readme":"Higher-order Virtual Machine 2 (HVM2)\n=====================================\n\n**Higher-order Virtual Machine 2 (HVM2)** is a massively parallel [Interaction\nCombinator](https://www.semanticscholar.org/paper/Interaction-Combinators-Lafont/6cfe09aa6e5da6ce98077b7a048cb1badd78cc76)\nevaluator.\n\nBy compiling programs from high-level languages (such as Python and Haskell) to\nHVM, one can run these languages directly on massively parallel hardware, like\nGPUs, with near-ideal speedup.\n\nHVM2 is the successor to [HVM1](https://github.com/HigherOrderCO/HVM1), a 2022\nprototype of this concept. Compared to its predecessor, HVM2 is simpler, faster\nand, most importantly, more correct. [HOC](https://HigherOrderCO.com/) provides\nlong-term support for all features listed on its [PAPER](./paper/HVM2.pdf).\n\nThis repository provides a low-level IR language for specifying the HVM2 nets\nand a compiler from that language to C and CUDA. It is not meant for direct\nhuman usage. If you're looking for a high-level language to interface with HVM2,\ncheck [Bend](https://github.com/HigherOrderCO/Bend) instead.\n\nUsage\n-----\n\n\u003e DISCLAIMER: Windows is currently not supported, please use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) for now as a workaround.\n\nFirst install the dependencies:\n* If you want to use the C runtime, install a C-11 compatible compiler like GCC or Clang.\n* If you want to use the CUDA runtime, install CUDA and nvcc (the CUDA compiler).\n  - _HVM requires CUDA 12.x and currently only works on Nvidia GPUs._\n\nInstall HVM2:\n\n```sh\ncargo install hvm\n```\n\nThere are multiple ways to run an HVM program:\n\n```sh\nhvm run    \u003cfile.hvm\u003e # interpret via Rust\nhvm run-c  \u003cfile.hvm\u003e # interpret via C\nhvm run-cu \u003cfile.hvm\u003e # interpret via CUDA\nhvm gen-c  \u003cfile.hvm\u003e # compile to standalone C\nhvm gen-cu \u003cfile.hvm\u003e # compile to standalone CUDA\n```\n\nAll modes produce the same output. The compiled modes require you to compile the\ngenerated file (with `gcc file.c -o file`, for example), but are faster to run.\nThe CUDA versions have much higher peak performance but are less stable. As a\nrule of thumb, `gen-c` should be used in production.\n\nLanguage\n--------\n\nHVM is a low-level compile target for high-level languages. It provides a raw\nsyntax for wiring interaction nets. For example:\n\n```javascript\n@main = a\n  \u0026 @sum ~ (28 (0 a))\n\n@sum = (?(((a a) @sum__C0) b) b)\n\n@sum__C0 = ({c a} ({$([*2] $([+1] d)) $([*2] $([+0] b))} f))\n  \u0026! @sum ~ (a (b $([+] $(e f))))\n  \u0026! @sum ~ (c (d e))\n```\n\nThe file above implements a recursive sum. If that looks unreadable to you -\ndon't worry, it isn't meant to. [Bend](https://github.com/HigherOrderCO/Bend) is\nthe human-readable language and should be used both by end users and by languages\naiming to target the HVM. If you're looking to learn more about the core\nsyntax and tech, though, please check the [PAPER](./paper/HVM2.pdf).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHigherOrderCO%2FHVM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHigherOrderCO%2FHVM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHigherOrderCO%2FHVM/lists"}