diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 9481b791..45e3a5c3 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,7 +1,6 @@ name: Bench -on: - pull_request: +on: {} # temporarily disabled concurrency: group: bench-${{ github.ref }} @@ -28,13 +27,13 @@ jobs: git clone https://github.com/higherorderco/hvm-compare-perf cd hvm-compare-perf NO_COLOR=1 cargo run bench \ - --core ../hvm-core \ + --core ../hvm-64 \ -r main -r ${{ github.sha }} \ -m intr-singl -m intr-multi \ - > ../hvm-core/table + > ../hvm-64/table - name: write comment run: | - echo 'Perf run for [`'`git rev-parse --short ${{ github.sha }}`'`](https://github.com/higherorderco/hvm-core/commit/${{ github.sha }}):' >> comment + echo 'Perf run for [`'`git rev-parse --short ${{ github.sha }}`'`](https://github.com/higherorderco/hvm-64/commit/${{ github.sha }}):' >> comment echo '```' >> comment cat table >> comment echo '```' >> comment @@ -50,7 +49,7 @@ jobs: gh api graphql -F pr=${{ github.event.number }} -f query=' query($pr: Int!) { organization(login: "higherorderco") { - repository(name: "hvm-core") { + repository(name: "hvm-64") { pullRequest(number: $pr) { comments(last: 100) { nodes { id author { login } } diff --git a/.github/workflows/delete-cancelled.yml b/.github/workflows/delete-cancelled.yml index 98a69975..117cd050 100644 --- a/.github/workflows/delete-cancelled.yml +++ b/.github/workflows/delete-cancelled.yml @@ -5,12 +5,12 @@ on: inputs: run_id: type: string - description: "" + description: "" jobs: delete: runs-on: ubuntu-latest steps: - - run: gh api "repos/higherorderco/hvm-core/actions/runs/${{ inputs.run_id }}" -X DELETE + - run: gh api "repos/higherorderco/hvm-64/actions/runs/${{ inputs.run_id }}" -X DELETE env: GH_TOKEN: ${{ secrets.PAT }} diff --git a/Cargo.lock b/Cargo.lock index 6fdc86c2..5c99187a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,15 +276,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809e18805660d7b6b2e2b9f316a5099521b5998d5cba4dda11b5157a21aaef03" [[package]] -name = "hvmc" -version = "0.2.26" +name = "hvm64" +version = "0.3.0" dependencies = [ "clap", - "hvmc-ast", - "hvmc-host", - "hvmc-runtime", - "hvmc-transform", - "hvmc-util", + "hvm64-ast", + "hvm64-host", + "hvm64-runtime", + "hvm64-transform", + "hvm64-util", "insta", "libloading", "ordered-float", @@ -294,51 +294,51 @@ dependencies = [ ] [[package]] -name = "hvmc-ast" -version = "0.1.0" +name = "hvm64-ast" +version = "0.3.0" dependencies = [ "TSPL", "arrayvec", - "hvmc-util", + "hvm64-util", "ordered-float", "thiserror", ] [[package]] -name = "hvmc-host" -version = "0.1.0" +name = "hvm64-host" +version = "0.3.0" dependencies = [ - "hvmc-ast", - "hvmc-runtime", - "hvmc-util", + "hvm64-ast", + "hvm64-runtime", + "hvm64-util", "parking_lot", ] [[package]] -name = "hvmc-runtime" -version = "0.1.0" +name = "hvm64-runtime" +version = "0.3.0" dependencies = [ - "hvmc-util", + "hvm64-util", "nohash-hasher", "parking_lot", ] [[package]] -name = "hvmc-transform" -version = "0.1.0" +name = "hvm64-transform" +version = "0.3.0" dependencies = [ - "hvmc-ast", - "hvmc-host", - "hvmc-runtime", - "hvmc-util", + "hvm64-ast", + "hvm64-host", + "hvm64-runtime", + "hvm64-util", "ordered-float", "parking_lot", "thiserror", ] [[package]] -name = "hvmc-util" -version = "0.1.0" +name = "hvm64-util" +version = "0.3.0" dependencies = [ "arrayvec", "stacker", diff --git a/Cargo.toml b/Cargo.toml index aa359fc6..26649ed1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,14 +13,14 @@ missing_safety_doc = "allow" new_ret_no_self = "allow" [package] -name = "hvmc" -version = "0.2.26" +name = "hvm64" +version = "0.3.0" edition = "2021" description = "HVM-Core is a massively parallel Interaction Combinator evaluator." license = "MIT" [[bin]] -name = "hvmc" +name = "hvm64" path = "src/main.rs" bench = false required-features = ["std"] @@ -39,11 +39,11 @@ ordered-float = { version = "4.2.0" } parking_lot = "0.12.2" thiserror = "1.0.58" -hvmc-ast = { path = "./ast" } -hvmc-runtime = { path = "./runtime" } -hvmc-transform = { path = "./transform" } -hvmc-util = { path = "./util" } -hvmc-host = { path = "./host" } +hvm64-ast = { path = "./ast" } +hvm64-runtime = { path = "./runtime" } +hvm64-transform = { path = "./transform" } +hvm64-util = { path = "./util" } +hvm64-host = { path = "./host" } [dev-dependencies] insta = { version = "1.34.0", features = ["glob"] } @@ -52,4 +52,4 @@ serial_test = "3.0.0" [features] default = ["std"] std = [] -trace = ["hvmc-runtime/trace"] +trace = ["hvm64-runtime/trace"] diff --git a/README.md b/README.md index e54ed457..f2620bed 100644 --- a/README.md +++ b/README.md @@ -1,523 +1,3 @@ -# HVM-Core: a parallel Interaction Combinator evaluator +# HVM-64 -HVM-Core is a parallel evaluator for extended [Symmetric Interaction Combinators](https://www-lipn.univ-paris13.fr/~mazza/papers/CombSem-MSCS.pdf). - -We provide a raw syntax for specifying nets and a Rust implementation that -achieves up to **10 billion rewrites per second** on Apple M3 Max CPU. HVM's -optimal evaluation semantics and concurrent model of computation make it a great -compile target for high-level languages seeking massive parallelism. - -HVM-Core will be used as the compile target for -[HVM](https://github.com/higherorderco/hvm) on its upcoming update. - -## Usage - -Install HVM-Core as: - -``` -cargo +nightly install hvm-core -``` - -Then, run the interpreter as: - -``` -hvmc run file.hvmc -s -``` - -Or compile it to a faster executable: - -``` -hvmc compile file.hvmc -./file -``` - -Both versions will compute the program's normal form using all available cores. - -## Example - -HVMC is a low-level compile target for high-level languages. It provides a raw -syntax for wiring interaction nets. For example: - -```javascript -@add = (<+ a b> (a b)) - -@sum = (?<(#1 @sumS) a> a) - -@sumS = ({2 a b} c) - & @add ~ (e (d c)) - & @sum ~ (a d) - & @sum ~ (b e) - -@main = a - & @sum ~ (#24 a) -``` - -The file above implements a recursive sum. As you can see, its syntax isn't -meant to be very human readable. Fortunately, we have -[HVM-Lang](https://github.com/HigherOrderCO/hvm-lang), a tool that generates -`.hvmc` files from a familiar functional syntax. On HVM-Lang, you can write -instead: - -```javascript -add a b = (+ a b) - -sum 0 = 1 -sum +p = (add (sum p) (sum p)) - -main = (sum 24) -``` - -Which compiles to the first program via `hvml compile main.hvm`. For more -examples, see the [`/examples`](/examples) directory. If you do want to -understand the hardcore syntax, keep reading. - -## Language - -HVM-Core's textual syntax represents interaction combinators via an AST: - -``` - ::= - ::= "*" - ::= "(" " " ")" - ::= "[" " " "]" - ::= "{"