获取 hpc,几秒后在 Windows x64 上把 .hp 编译成原生可执行文件。无需运行时、无需虚拟机。Grab hpc and compile .hp to native executables on Windows x64 in seconds. No runtime, no VM.
-O2。
v0.1.0 · Platform: Windows 64-bit (x64). Bundles the LLVM backend & LLD linker, no-CRT by default, default -O2.
当前唯一发行平台。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.
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.
hpc.exe(或克隆仓库、按编译器页步骤从源码 CMake 构建)。Download the Windows x64 hpc.exe (or clone & CMake-build from source per the Compiler page).hpc.exe 所在目录加入 PATH。它自带 LLVM/LLD,无需安装运行时或 MSVC。Put hpc.exe's folder on PATH. It bundles LLVM/LLD — no runtime or MSVC to install.-O2)把 hello.hp 编译为同目录的 hello.exe 并运行。One command (default -O2) turns hello.hp into a sibling hello.exe, then run it.module { "<std.io>" }
fn main() {
std.io.print("Hello, HP!")
}
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
直接看示例库,或跟着教程写出第一段 HP 程序。Jump straight to the examples, or follow the tutorial to write your first HP program.