About this project
Bend is a high-level programming language designed for massive parallelism, developed by HigherOrderCO and powered by the HVM2 runtime. It aims to combine the expressiveness of languages like Python and Haskell with the scaling behavior of CUDA-style GPU computing.
Language features highlighted in the README include fast object allocation, full support for higher-order functions with closures, unrestricted recursion, and continuations. Parallelism is implicit: the README states there is no need for thread creation, locks, mutexes, or atomics. Code that can run in parallel will run in parallel, with nearly linear acceleration based on core count, and the project claims support for over 10000 concurrent threads.
Installation is done through Rust's cargo. Users install the HVM2 runtime with `cargo install hvm`, then install the language with `cargo install bend-lang`. Linux and macOS are covered in the instructions, with WSL2 suggested for Windows. The CUDA runtime requires the NVIDIA CUDA toolkit 12.x, and the README notes that only NVIDIA GPUs are currently supported.
Programs can be executed through several backends: `bend run-rs` uses a sequential Rust interpreter, `bend run-c` uses a parallel C interpreter, and `bend run-cu` uses a massively parallel CUDA interpreter. Bend code can also be compiled to standalone C or CUDA files via `gen-c` and `gen-cu`, though the README describes the code generator as early-stage. A `-s` flag reports reductions, runtime, and interactions per second.
The README walks through a sequential versus parallel summation example to illustrate how a divide-and-conquer formulation enables automatic parallel execution. It also presents a bitonic sorter benchmark with reported timings: 12.15 seconds on an Apple M3 Max CPU via the Rust interpreter, 0.96 seconds on the same CPU via the C interpreter, and 0.21 seconds on an NVIDIA RTX 4090 GPU via the CUDA interpreter. These figures are the project's own reported measurements.
The README cautions that the current version may have lower single-core performance and that performance should improve as code generation and optimization techniques advance. Additional resources include the HVM2 paper, a GUIDE.md, a FEATURES.md, an examples folder, and a Discord community.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.