Skip to content

Guide · Open source

How to use HVM1: clone, run examples and understand the runtime

Updated · written with AI from the project's own documentation and checked against our catalogue data

HVM1 is a prototype runtime for a minimalist pure functional language. It is lazy, has no garbage collector, and the project says it can run work across many cores automatically. This guide shows how to get the code, which examples to read first, what the published benchmarks show, and whether HVM1 suits your work.

HVM1HigherOrderCO/HVM1 · ★ 11.4k · MIT

Quick start

  1. 1Clone the repository. Run the git clone command for HigherOrderCO/HVM1 from GitHub to get a local copy.
  2. 2Read the README in full. The excerpt we reviewed does not include build or run instructions, so check the complete README in the repo for them.
  3. 3Open the sort examples. Look at examples/sort/bubble/main.hvm and examples/sort/radix/main.hvm next to their .hs counterparts.
  4. 4Compare with the lambda example. Open examples/lambda/multiplication/main.hvm to see how HVM1 encodes binary numbers and multiplication.
  5. 5Check the benchmark charts. Review the README results for bubble and radix sort to see where extra cores help and where they do not.
  6. 6Decide on production use. If you need production software, look at HVM-Core, which the README names as the planned production version.

Clone the HVM1 repository

The README gives one install step: clone the repository from GitHub. Our analysis lists no prerequisites for HVM1, but the README excerpt we reviewed does not show build or run commands, so read the full README in the repo before you try to build it.

git clone https://github.com/HigherOrderCO/HVM1

Understand what HVM1 is before you run it

HVM1 is a runtime for a minimalist functional language. The README describes it as lazy, non-garbage-collected and massively parallel. It is built on Interaction Nets, a model of computation the README presents as an alternative to the Turing Machine and the Lambda Calculus.

The README also says HVM1 is beta-optimal. For some higher-order computations it can be exponentially faster than alternatives, including GHC. The project calls itself a prototype, so treat these claims as the authors' own.

  • Lazy evaluation
  • No garbage collector
  • Automatic parallelism across cores
  • Built on Interaction Nets

Read the bundled examples: bubble sort, radix sort and lambda multiplication

The README points to example programs in the repository, each with an HVM version (.hvm) and a Haskell version (.hs) for comparison. Reading the two side by side is the fastest way to see how HVM1 code is written.

Bubble sort is at examples/sort/bubble/main.hvm. Radix sort is at examples/sort/radix/main.hvm. Lambda multiplication is at examples/lambda/multiplication/main.hvm. Each file defines its functions with pattern-matching equations, much like the Haskell version.

  • examples/sort/bubble/main.hvm: a recursive bubble sort
  • examples/sort/radix/main.hvm: a radix sort based on merging immutable trees
  • examples/lambda/multiplication/main.hvm: multiplication of binary numbers in lambda style

Know what the benchmarks show

Bubble sort is inherently sequential. The README reports that HVM1 and GHC perform similarly, with HVM1 having a small edge, and that HVM1 does not get faster with more cores on this algorithm.

Radix sort is inherently parallel. The README reports that GHC was faster on a single thread, but with 8 threads HVM1 sorted a large list 2.5 times faster than GHC. The README notes that GHC could be parallelised with par annotations, but that this takes refactoring and may not reach all available parallelism.

Decide whether HVM1 fits your goal

The README says the code is a prototype and that the first production-ready version is planned in a separate project, HVM-Core. If you need a stable runtime, follow HVM-Core instead.

HVM1 is a good fit for research on parallel evaluation and interaction nets, for studying optimal evaluation, and for benchmarking parallel workloads against GHC. Our analysis notes that the README does not describe a mature ecosystem, libraries or tooling.

  • Good fit: researchers, students of lambda calculus, developers curious about how functional runtimes schedule work
  • Poor fit: production systems, sequential workloads expecting large speedups, projects needing libraries and mature tooling

What people use it for

  • Studying how interaction nets evaluate a functional program
  • Comparing parallel sorting performance of HVM1 and GHC on a multi-core machine
  • Learning lambda calculus through the multiplication example
  • Testing which algorithms gain from extra cores and which stay sequential

Frequently asked questions

Is HVM1 production ready?

No. The README calls the code a prototype and says the first production-ready version is coming soon in a separate project, HVM-Core.

Is HVM1 free to use?

HVM1 is listed under the MIT licence, which is a permissive open-source licence. Check the LICENSE file in the repository for the full terms.

How do I install HVM1?

The README gives a clone step: git clone https://github.com/HigherOrderCO/HVM1. The excerpt we reviewed does not show build steps, so consult the full README in the repo.

Does HVM1 get faster with more cores?

It depends on the algorithm. The README reports no speedup from extra cores on bubble sort, which is inherently sequential, but a 2.5x speedup over GHC on radix sort with 8 threads.

How does HVM1 compare to GHC?

The README reports similar bubble sort performance with HVM1 slightly ahead, and GHC faster on a single thread for radix sort. HVM1 pulls ahead on radix sort with 8 threads.

What are the alternatives to HVM1?

Projects the analysis lists as comparable are GHC, HVM2 and Idris. For production work, the README points to HVM-Core.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

HVM1 suits researchers, students and developers who want to explore parallel evaluation, interaction nets and optimal evaluation. If you need a production-ready runtime or a mature ecosystem with libraries and tooling, pick HVM-Core or a established tool such as GHC.

Install options & downloads