shiping
An interview assistant and an exam assistant that uses AI to provide solution ideas in real time during 「面试」 or 「在线考试」.
AI translation
A friendly place to learn Kiroha, one small program at a time.
Translation pending
EducationRust · PythonGitHub @kiroha-langOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
A small, strict expression language for LLM-written JSON, HTTP and PostgreSQL programs. Exact decimals, explicit effects, one callback syntax.
Taken from the repository README
Loading the full README.
Read the full 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 |