個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證A small, strict expression language for LLM-written JSON, HTTP and PostgreSQL programs. Exact decimals, explicit effects, one callback syntax.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Documentation (GitHub Pages): kiroha-lang.github.io/kiroha
Claude Code plugin: claude plugin marketplace add kiroha-lang/kiroha, then claude plugin install kiroha@kiroha-lang. Guide.
Kiroha 0.8.0 replaces the earlier check function with .as[...] and
.as(schema). See the 0.8 migration guide.
Kiroha (きろは) combines the original working name Kiri with iroha, the basics of a language. The executable and source extension are kiroha and .kiroha. See the naming and migration note.
Kiroha is a small, strict, immutable expression language for programs that
manipulate JSON, call web services, serve HTTP APIs and use PostgreSQL, MySQL or MariaDB. It was
designed to be written by LLMs: the standard surface is 30 global functions, 19 collection methods
and one .size property, numbers are exact decimals, every effect is explicit and
capability-checked, and there is exactly one way to pass a callback — a
mandatory trailing lambda.
type User = open({id:int, name:str, active:bool});
get("https://api.example/users").as[[User]]
.filter{u => u.active}
.map{u => {id:u.id, name:u.name}}
This repository is a complete Rust implementation of the
Kiroha 0.8.0 / Web1 specification (spec.md), including the
kiroha command-line tool, a deterministic conformance runner and production
adapters for HTTP/1.1 (+ verified TLS), PostgreSQL 16, MySQL 8.4, MariaDB 11.4, an HTTP server and the
local filesystem.
| Area | State |
|---|---|
| Embedded conformance corpus (spec §16) | 263 / 263 pass, including explicit types, generics, compact definitions and receiver members (kiroha conformance spec.md --json) |
| Integration scenarios I01–I08 (spec §15.3) | All pass (PostgreSQL 16.4; additional backend tests use MySQL 8.4.4 / MariaDB 11.4.5) |
| Extra prose-rule regressions | Pass (tests/prose_regressions.rs) |
| Formal verification | TLA+ models of parallel and tx model-checked with TLC; property-based tests of decimals and JSON against oracles (details) |
| 30 globals + 19 methods + size + 5 schema atoms | Implemented; inventory matches the generation card |
CLI protocol kiroha-cli/1 | Implemented |
| Acceptance | Release CI exercises PostgreSQL/MySQL/MariaDB and syntax regressions; the dated 0.3 baseline passed audit 23 (record) |
Details, versions and known deviations are in docs/conformance-report.md.
curl -fsSL https://github.com/kiroha-lang/kiroha/releases/latest/download/install.sh | bash
export PATH="$HOME/.local/bin:$PATH"
kiroha --version
Prebuilt releases support Linux/WSL (glibc 2.35+) and macOS 13+, on x86_64 and
ARM64. No Rust build environment is needed. The installer verifies SHA-256
and defaults to ~/.local/bin; see installation options
for version pinning, alternate directories and source builds.
Requires Rust 1.89+ (tested with 1.96), a C compiler and libclang (for the
embedded PostgreSQL parser, pg_query; set LIBCLANG_PATH if it is not
found automatically).
cargo build --release
cp target/release/kiroha ~/.local/bin/ # or anywhere on PATH
kiroha --version
Give an agent Kiroha's versioned generation card, API guidance and runnable examples:
codex plugin marketplace add kiroha-lang/kiroha
codex plugin add kiroha@kiroha-lang
Use $kiroha:write-kiroha to write, review, debug or migrate Kiroha programs.
See the plugin guide for usage, local development and packaging.
echo 'fun fac(n:int):int if n<=1 then 1 else n*fac(n-1) end fun fac fac(20)' > fac.kiroha
kiroha check fac.kiroha --json # lex, parse, resolve and type-check
kiroha run fac.kiroha --json # evaluate
# {"protocol":"kiroha-cli/1","ok":true,"result":{"t":"number","v":"2432902008176640000"}}
By default a program may compute and sleep but every external capability
(network, files, environment, clock, randomness, logging, database, listening)
is denied. Grant capabilities with a host file:
{
"format": "kiroha-host/1",
"capabilities": {
"http": ["https://api.example"],
"log": true
}
}
kiroha run program.kiroha --json --host host.json
See the examples and their setup instructions for runnable programs.
| Document | Contents |
|---|---|
| Language guide | Tutorial: syntax, callbacks, scope, pipes, errors, schemas, concurrency, HTTP, SQL, servers |
| Types and generics | Local inference, annotations, explicit any, structural types and simple generics |
| Database guide | Shared API, backend configuration and SQL/type differences |
| 0.6 migration | Type declarations and checked function signatures |
| 0.5 migration | Compact definitions, collection methods and .size |
| 0.4 migration | fun name(...) ... end fun name, body sequences and reserved words |
| 0.8 migration | Replace check with .as, and use SQL blocks |
| Built-in reference | All globals, collection members and 5 schema atoms: signatures, defaults, validation, errors |
| Values and numbers | Value kinds, exact decimals, canonical spelling, JSON, equality |
| Errors and aborts |
cargo test # unit + integration tests
KIROHA_TEST_PG_DSN="host=127.0.0.1 port=55432 user=kiroha dbname=postgres" cargo test # include PostgreSQL I03/I04
cargo run --release -- conformance spec.md --json
./formal/check.sh # TLA+ model checking (needs Java)
python scripts/measure.py --check # requires tiktoken==0.14.0
Without KIROHA_TEST_PG_DSN the PostgreSQL tests print SKIP and pass
vacuously; the conformance report states which environment was used.
MySQL and MariaDB use the same database abstraction (backend in a host
database_pools entry: postgresql (default), mysql or mariadb). Their
real-server tests in tests/database_backends.rs are enabled by DSNs and skip
without them:
KIROHA_TEST_MYSQL_DSN='mysql://user:[email protected]:3306/db' \
KIROHA_TEST_MARIADB_DSN='mariadb://user:[email protected]:3307/db' cargo test --test database_backends
The verification workflow provisions PostgreSQL
16 and runs the build, tests, conformance corpus, warning-free Clippy, TLC
models and measurement check. Regenerate measurements after editing spec.md
with python scripts/measure.py.
| Error codes and data, aborts, precedence |
| CLI | Commands, envelopes, wire values, exit codes |
| Installation | One-command installer, versions, platforms and release verification |
| Host configuration | kiroha-host/1 capabilities, pools, limits |
| Architecture | Implementation design: CEK machine, scheduler, adapters, memory accounting |
| Conformance report | Test results, environment, deviations |
| Formal verification | TLA+ models (scheduler, transactions) and property-based tests (decimals, JSON) |
| Specification | The normative Kiroha 0.8.0 / Web1 contract |
| Acceptance record | Requirement-by-requirement completion evidence and final independent audit |
| Handoff | Completed state, verification and maintenance workflow |