GET THE COMPILER

下载 HP 编译器Download HP

获取 hpc,几秒后在 Windows x64 上把 .hp 编译成原生可执行文件。无需运行时、无需虚拟机。Grab hpc and compile .hp to native executables on Windows x64 in seconds. No runtime, no VM.

当前版本:Current release: v0.1.0 · 平台:Windows 64 位(x64)。内置 LLVM 后端与 LLD 链接器,默认去 CRT、默认 -O2 v0.1.0 · Platform: Windows 64-bit (x64). Bundles the LLVM backend & LLD linker, no-CRT by default, default -O2.
🪟

Windows x64

当前唯一发行平台。hpc.exe 开箱即用:自带 LLVM 后端 + LLD 链接器,链接用内置 LLD 且默认去 msvcrt,无需安装任何运行时或工具链。The only release platform right now. hpc.exe works out of the box — it bundles the LLVM backend + LLD linker, linking with bundled LLD and no-CRT. No runtime or toolchain required.

二进制依赖:Binary deps:  ·  构建源码时依赖:Source build deps: LLVM 22(clang+llvm SDK,LLVMConfig.cmake)· CMake 3.20+ · C++20 编译器

其他平台 · 规划中Other Platforms · Planned

Linux x64 (即将支持)(coming soon) macOS arm64 / x64 (规划中)(planned) Bare-metal x64

编译器已内置 --target linux--target bare-metal 目标后端;预编译发行将逐步补齐。期间可自行从源码 构建 到其他平台。The compiler already carries --target linux and --target bare-metal backends; official builds will follow progressively. Meanwhile you can build from source for other platforms.

三步拿到 hpcThree Steps to hpc

  1. 获取:Get: 下载 Windows x64 预编译 hpc.exe(或克隆仓库、按编译器页步骤从源码 CMake 构建)。Download the Windows x64 hpc.exe (or clone & CMake-build from source per the Compiler page).
  2. 加入 PATH:Add to PATH: hpc.exe 所在目录加入 PATH。它自带 LLVM/LLD,无需安装运行时或 MSVC。Put hpc.exe's folder on PATH. It bundles LLVM/LLD — no runtime or MSVC to install.
  3. 编译并运行:Compile & run: 一条命令(默认 -O2)把 hello.hp 编译为同目录的 hello.exe 并运行。One command (default -O2) turns hello.hp into a sibling hello.exe, then run it.
hello.hp
module { "<std.io>" }

fn main() {
    std.io.print("Hello, HP!")
}
terminal
hpc hello.hp            # 默认 -O2,产出 hello.hp 同目录的 hello.exe
./hello.exe             # 输出: Hello, HP!

# 从源码构建(仅需要源码时)
cmake -B build -S . -DCMAKE_PREFIX_PATH=D:/clang+llvm-22.1.8
cmake --build build --config Release

已经装好 hpc?Already have hpc?

直接看示例库,或跟着教程写出第一段 HP 程序。Jump straight to the examples, or follow the tutorial to write your first HP program.