GET THE COMPILER

下载 HP 编译器Download HP

hpc 以源码形式随标准库一同发布;按下方步骤在几分钟内拿到原生编译器。无需运行时、无需虚拟机。hpc ships as source alongside the standard library — follow the steps below to get a native compiler in minutes. No runtime, no VM.

当前版本:Current release: v1.0 · 零运行时 · LLVM 22 原生后端 · 中英双语关键字。预编译包与发布说明见项目仓库的 Releases 页面(链接占位)。 v1.0 · zero-runtime · LLVM 22 native backend · bilingual keywords. Prebuilt packages & release notes live on the project's Releases page (link placeholder).
🪟

Windows x64

需要 LLVM SDK + MSVC cl.exe 工具链。Requires the LLVM SDK + MSVC cl.exe toolchain.

依赖:Deps:
LLVM 22.1.8 (clang+llvm)
MSVC 14.5+ (cl.exe)
CMake 3.20+
🐧

Linux x64 / arm64

需要 LLVM + GCC/Clang 与开发头文件。Needs LLVM + GCC/Clang and dev headers.

依赖:Deps:
LLVM 22 (llvm-dev)
Clang / GCC 12+
CMake 3.20+ · make
🍎

macOS arm64 / x64

通过 Homebrew 安装 LLVM,再用 CMake 构建。Install LLVM via Homebrew, then build with CMake.

依赖:Deps:
LLVM 22 (brew install llvm)
Apple Clang / Clang
CMake 3.20+ · Xcode CLT

三步拿到 hpcThree Steps to hpc

  1. 获取源码:Get the source: 克隆仓库或下载 Releases 中的源码压缩包,内含 hpc 与标准库。Clone the repo or grab the source tarball from Releases — it includes hpc and the standard library.
  2. 配置工具链:Configure the toolchain: 编辑 config.txt 指向本机的 LLVM / MSVC 路径(参见编译器页)。Point config.txt at your local LLVM / MSVC paths (see the Compiler page).
  3. 构建并运行:Build & run: 用 CMake 生成 hpc,一句命令编译你的第一个 .hpUse CMake to produce hpc, then compile your first .hp in one command.
bash
# 1) 克隆
git clone https://example.com/hp-lang/hpc.git
cd hpc

# 2) 配置工具链(Windows 示例)
#   编辑 config.txt:
#   llvm sdk 地址: D:\clang+llvm-22.1.8-x86_64-pc-windows-msvc
#   cl.exe 地址:   D:\msvc\VC\Tools\MSVC\14.51.36231\bin\Hostx64\x64

# 3) 构建
cmake -B build -S .
cmake --build build --config Release

# 试试看
./build/hpc -O3 -o hello.exe examples/helloworld.hp
./hello.exe

已经装好 hpc?Already have hpc?

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