CalcKernel README

The project's README from github.com/luxine/CalcKernel. As one markdown file: README.md.

CalcKernel

Website · Get started · Documentation · Download · VS Code extension · Performance measurements · MIT license

CalcKernel (CK) is a statically typed language for numerical computation kernels: focused calculations that can be called from a larger application. Write a .ck source file and use ckc to check, run, or build it. CK can produce native programs and libraries, or emit C and WebAssembly for integration with existing systems.

CK is designed to handle the calculation while your application keeps responsibility for the surrounding work, such as user interfaces, input and output, and data storage. Its typed function interfaces and caller-owned data slices make that boundary explicit.

The latest stable release is 0.15.2, a WebAssembly performance and correctness update.

Why CalcKernel

Start using CK

  1. Download the compiler for your system.
  2. Follow the first-program tutorial to create and run a CK program.
  3. Use any text editor, or install the optional CalcKernel extension for Visual Studio Code.

The extension provides CK syntax support, live diagnostics, code navigation, and commands to check, run, and build the current file. See the VS Code guide for setup details.

Learn more

Performance depends on the algorithm, implementation, libraries, and target machine. The linked measurements describe specific workloads and are not a general ranking of languages.

Build from source

The default feature set builds and tests the frontend, C, and WebAssembly components without LLVM:

cargo test --locked
cargo build --release --locked

Native builds require the pinned static LLVM prefix specified in native/llvm/manifest.toml. The bootstrap script checks the source archive's SHA-256 before building it:

rustc_host="$(rustc -vV | sed -n 's/^host: //p')"
llvm_archive="$PWD/llvm-project-22.1.8.src.tar.xz"
curl -fL 'https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz' -o "$llvm_archive"
llvm_prefix="$PWD/build/llvm/prefix-$rustc_host-release"
./scripts/bootstrap-llvm.sh --archive "$llvm_archive" \
  --prefix "$llvm_prefix" --target "$rustc_host" --profile release
CKC_LLVM_PREFIX="$llvm_prefix" cargo build --release --features native-toolchain --locked

This prefix is needed to build CalcKernel's Native feature; release binaries do not require it at runtime. Windows MSVC build requirements are described in the getting-started guide.

Community

Contributions are welcome. Please read the contributing guide, security policy, and code of conduct.

License

CalcKernel is distributed under the MIT License.

CalcKernel (luxine/CalcKernel)

Searching Database…

这是什么?CalcKernel(CK)是一种静态类型语言,用于编写供更大规模应用调用的专注数值计算内核,而不是一门完整的应用级语言。
CK 是独立应用、库,还是编译器工具链?CK 是一门编程语言,自带编译器(ckc)。你编写 .ck 源文件,ckc 可以检查、运行它们,或将它们构建为原生程序/库,也可以生成 C 或 WebAssembly 以嵌入其他系统。
我怎么编写并运行我的第一个 CK 程序?下载适用于你系统的预构建编译器,然后按照首个程序教程创建并运行一个 CK 程序;任何文本编辑器都可以,还可以选择安装 VS Code 扩展来获得语法帮助。
使用 CK 需要安装 LLVM 吗?使用预构建版本不需要。只有当你从源码构建 CalcKernel 的 Native 功能时才需要 LLVM,此时要使用由 bootstrap 脚本通过 SHA-256 校验的固定版本静态 LLVM 前缀;发行版二进制文件在运行时并不需要它。
CalcKernel 的性能声明有多可靠?README 明确警告,其性能测量只覆盖特定机器上的特定工作负载,并不是针对其他语言的通用排名,因此结果可能因算法和目标硬件而异。
我可以在哪些平台上构建和运行 CK 程序?你下载适用于自己系统的编译器构建版本,可以选择生成原生机器码或 WebAssembly;文档单独介绍了 Windows MSVC 构建要求,原生/跨平台构建流程也体现了对 Linux 和 macOS 的支持。
CalcKernel 的 VS Code 扩展提供了什么?它提供 CK 语法支持、实时诊断、代码导航,以及直接在编辑器中检查、运行和构建当前 .ck 文件的命令。
simd128 配置是用来做什么的?它是一个可选启用的 WebAssembly 配置,用于矢量化受支持的数组映射和整数归约操作;不支持的用例会自动回退到普通标量代码。
CK 如何保障其处理数据的内存安全?应用程序通过类型化的、由调用方持有的数据切片提供并保留传入 CK 的所有内存的所有权,原生/C 构建还可以选择启用整数溢出和切片边界检查。
为什么用 CK 而不直接用 C 编写数值代码?CK 在数值边界处增加了静态类型和明确的、由调用方持有的数据切片,同时仍可编译为原生代码、C-ABI 库或 WebAssembly,在集成方式类似的情况下提供比手写 C 更强的保证。
What are similar projects?scriptc, Tov, Singeli, raddebugger, spinel, perry, carbon-lang, goose
Creator
luxine
Size
3.9 MB
Stars
152
Age
21d
Commits · 90 Days