Configs2026年5月20日·1 分钟阅读

HVM — Massively Parallel Runtime for Functional Programs

HVM (Higher-order Virtual Machine) is a parallel runtime that executes functional programs across all available CPU and GPU cores automatically, using a novel interaction-net reduction model.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
HVM Overview
通用 CLI 安装命令
npx tokrepo install a1e05da1-5447-11f1-9bc6-00163e2b0d79

Introduction

HVM (Higher-order Virtual Machine) is a runtime and compiler for functional programming that automatically parallelizes programs across CPU cores and GPUs. Built by HigherOrderCO, HVM uses interaction nets — a computation model from the theory of linear logic — that enables safe parallel reduction without locks, mutexes, or manual concurrency annotations. Programs written in the Bend language compile to HVM for execution.

What HVM Does

  • Executes functional programs in parallel across all available CPU cores automatically
  • Compiles programs to C or CUDA code for native and GPU execution
  • Reduces interaction nets using a lock-free, garbage-collection-free algorithm
  • Supports higher-order functions, pattern matching, and algebraic data types
  • Serves as the backend for the Bend programming language

Architecture Overview

HVM is based on interaction combinators, a model of computation where programs are represented as graphs of interacting nodes. Reduction rules are local — each node pair can be reduced independently — which makes the model inherently parallel. The runtime dispatches interaction-net reductions across threads without synchronization. HVM compiles to C with pthreads for CPU parallelism and to CUDA for GPU execution. The absence of a garbage collector is fundamental to the design: interaction nets naturally deallocate memory as nodes are consumed during reduction.

Self-Hosting & Configuration

  • Install the HVM binary via Cargo (Rust toolchain required)
  • Write programs directly in HVM's core syntax or use the Bend language as a frontend
  • Compile to standalone C executables for deployment without the Rust toolchain
  • Control thread count with the -t flag for CPU execution
  • Use hvm compile --cuda to target GPU execution via CUDA

Key Features

  • Automatic parallelism with no manual thread management or async annotations
  • Lock-free and garbage-collection-free design for predictable performance
  • Compiles to standalone C or CUDA code for deployment
  • Optimal beta-reduction via interaction nets based on Lamping's algorithm
  • Supports the Bend language for a Python-like high-level programming experience

Comparison with Similar Tools

  • GHC (Haskell) — mature compiler with sophisticated optimizations but limited automatic parallelism; HVM parallelizes by default through its computation model
  • Erlang BEAM — process-level concurrency with message passing; HVM provides instruction-level parallelism without explicit process management
  • Futhark — functional GPU language for array computations; HVM targets general-purpose functional programs, not just numerical workloads
  • Chapel — parallel programming language; HVM achieves parallelism through its computation model rather than language-level parallel constructs

FAQ

Q: Do I need to write parallel code to get parallelism from HVM? A: No. HVM automatically parallelizes any functional program. The interaction-net model is inherently parallel without annotations.

Q: What is Bend and how does it relate to HVM? A: Bend is a high-level programming language with Python-like syntax that compiles to HVM. It is the recommended way to write programs for the HVM runtime.

Q: Does HVM support GPU execution? A: Yes. HVM can compile programs to CUDA for execution on NVIDIA GPUs.

Q: Is HVM production-ready? A: HVM is under active development and is suitable for experimentation and research. Production readiness depends on the specific workload.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产