kukicha

package module
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 1 Imported by: 0

README

Kukicha

A readable language that ships as a single binary.

kukicha.org | Quick Reference | Tutorials | Stdlib Reference


A taste of Kukicha

Triage open GitHub issues with an LLM. Fetch, classify in parallel, keep the urgent ones, sort, print.

# triage.kuki — classify open issues with Claude, flag the urgent ones
import "stdlib/concurrent"
import "stdlib/fetch"
import "stdlib/json" as jsonpkg
import "stdlib/llm/chat"
import "stdlib/slice"
import "stdlib/sort"

type Issue
    number int
    title string
    body string

type Verdict
    number int
    severity int # 1 = trivial .. 5 = on fire
    kind string # bug | feature | docs | question
    summary string

func triage(issue: Issue) Verdict
    reply := chat.New("anthropic:claude-sonnet-4-6")
        |> chat.JSONMode()
        |> chat.System(`Classify GitHub issues. Reply JSON: {severity:1-5, kind, summary}`)
        |> chat.Ask("{issue.title}\n\n{issue.body}") onerr return {}

    v := jsonpkg.ParseString of Verdict from reply onerr return {}
    v.number = issue.number
    return v

func main()
    url := "https://api.github.com/repos/golang/go/issues?per_page=20"
    issues := fetch.GetJson of list of Issue from url onerr panic "github: {error}"

    urgent := issues
        |> concurrent.MapWithLimit(4, triage)
        |> slice.Filter(v => v.severity >= 4 and v.kind isnt "question")
        |> sort.ByKey(v => -v.severity)

    print("Needs attention:")
    for v in urgent
        tag := if v.severity equals 5 then "[ON FIRE]" else "[P{v.severity}]"
        print("  {tag} {v.kind}  #{v.number}  {v.summary}")

You can read this top-to-bottom without knowing the language: fetch issues, classify four at a time, filter the severe ones that aren't just questions, sort, print. English operators (and, isnt, equals, if … then … else), pipes that flow left-to-right, and stdlib names (fetch.GetJson, slice.Filter, concurrent.MapWithLimit, sort.ByKey) carry the weight. onerr keeps error handling out of the flow.

kukicha build triage.kuki produces a single static binary. Drop it on any server. No runtime to install.


Why Kukicha?

  • Readable by anyone on your team. Code that the on-call sysadmin, the new hire, and your future self can pick up cold.
  • Ships as one file. kukicha build produces a static binary — copy it to a server and run.
  • Batteries included. fetch, shell, files, db, llm, mcp, container, concurrent, crypto, html and 30+ more — no three-day debate over which HTTP library to pick.
  • Safe defaults. Compile-time checks for SQL injection, XSS, shell injection, path traversal, and SSRF. Errors are values handled with onerr.
  • No lock-in. kukicha brew file.kuki converts any file back to standard Go.

Quickstart

Grab a pre-built binary from GitHub Releases (Linux, macOS, Windows). Or, if you already have Go 1.26+ installed:

go install github.com/kukichalang/kukicha/cmd/kukicha@v0.9.2
mkdir myapp && cd myapp
kukicha init

kukicha init initializes a Go module (if go.mod is absent), extracts the stdlib, downloads dependencies, and writes an AGENTS.md language reference. Add .kukicha/ to your .gitignore.

Create hello.kuki:

function main()
    name := "World"
    print("Hello, {name}!")
kukicha run hello.kuki
Commands
Command What it does
kukicha check file.kuki Validate syntax without compiling
kukicha run file.kuki Compile and run immediately
kukicha build file.kuki Compile to a standalone binary
kukicha fmt -w file.kuki Format in place
kukicha brew file.kuki Convert back to standalone Go
kukicha-blend file.go Suggest Kukicha idioms for Go code

Already use Go?

Every .go file is valid .kuki — Kukicha is a strict superset. The Kukicha forms are sugar that desugars to standard Go before compilation; you can mix and match freely, drop them when they don't help, and run kukicha-blend on existing Go to see suggestions.

kukicha-blend main.go            # see what idioms apply
kukicha-blend --diff ./pkg/      # preview changes
kukicha-blend --apply main.go    # convert in place
kukicha brew main.kuki           # and anytime, back to Go

The translation table:

Concept Kukicha Go
Booleans and, or, not &&, ||, !
Comparison equals, isnt ==, !=
Lists list of string []string
Maps map of string to int map[string]int
Pointers reference User, reference of user *User, &user
Nil empty nil
Errors onerr return, error "msg" if err != nil { return err }, errors.New("msg")
Pipes x |> h() |> g() |> f() f(g(h(x)))
If-expression x := if cond then a else b (no Go equivalent)
Enums enum Status with named variants const + iota
Lambdas (x: int) => x * 2 func(x int) int { return x*2 }
Interpolation "hi {name}" fmt.Sprintf("hi %s", name)

The stdlib stays useful either way: fetch.GetJson of T from url onerr ... reads the same whether the surrounding code is list of string or []string.


Editor support


Documentation


Version: 0.9.2 | License: MIT


[!NOTE] Portions of this codebase were written with AI assistance. Commits are reviewed by human maintainers before merge.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SkillFS embed.FS

SkillFS contains docs/SKILL.md — the concise Kukicha language reference for AI coding agents. Extracted and upserted into AGENTS.md in user projects by `kukicha init`, tied to the same KUKICHA_VERSION stamp as the stdlib.

View Source
var StdlibFS embed.FS

StdlibFS contains the embedded Kukicha standard library source files. This includes all transpiled .go files from stdlib sub-packages. The .kuki source files are not embedded since only the Go code is needed. A go.mod file for the extracted stdlib is generated at extraction time.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
gengostdlib command
gengostdlib generates internal/semantic/go_stdlib_gen.go by inspecting Go standard library function signatures via go/packages.
gengostdlib generates internal/semantic/go_stdlib_gen.go by inspecting Go standard library function signatures via go/packages.
genstdlibregistry command
genstdlibregistry generates internal/semantic/stdlib_registry_gen.go by scanning all stdlib/*.kuki source files and extracting exported function signatures: return counts, per-position return types, and parameter names.
genstdlibregistry generates internal/semantic/stdlib_registry_gen.go by scanning all stdlib/*.kuki source files and extracting exported function signatures: return counts, per-position return types, and parameter names.
kukicha command
kukicha-blend command
kukicha-lsp command
kukicha-proxy command
kukicha-wasm command
Package main is the WASM entrypoint for the Kukicha playground.
Package main is the WASM entrypoint for the Kukicha playground.
api-explorer command
beads_kukicha command
deploy-status command
internal
ast
cache
Package cache provides an opt-in on-disk cache for compiler outputs keyed by source content + compiler version.
Package cache provides an opt-in on-disk cache for compiler outputs keyed by source content + compiler version.
ir
lsp
pipeline
Package pipeline provides a small bounded-concurrency Map helper used by the CLI to run independent per-file work (parsing, per-file semantic analysis) in parallel without sacrificing deterministic output ordering.
Package pipeline provides a small bounded-concurrency Map helper used by the CLI to run independent per-file work (parsing, per-file semantic analysis) in parallel without sacrificing deterministic output ordering.
profile
Package profile provides an opt-in compiler phase profiler.
Package profile provides an opt-in compiler phase profiler.
project
Package project loads a Kukicha "package" — a single .kuki file or a directory of .kuki files — into a shared compilation context that the CLI subcommands (check, build, run) and the LSP can consume without duplicating directory walking, source pre-reads, or parse plumbing.
Package project loads a Kukicha "package" — a single .kuki file or a directory of .kuki files — into a shared compilation context that the CLI subcommands (check, build, run) and the LSP can consume without duplicating directory walking, source pre-reads, or parse plumbing.
semantic
Package semantic performs semantic analysis on a parsed Kukicha program: scope construction, symbol resolution, type checking, lint collection, and diagnostic emission.
Package semantic performs semantic analysis on a parsed Kukicha program: scope construction, symbol resolution, type checking, lint collection, and diagnostic emission.
summary
Package summary flattens an *ast.Program into a list of named symbols (top-level declarations and their nested children) with positions.
Package summary flattens an *ast.Program into a list of named symbols (top-level declarations and their nested children) with positions.
version
Package version provides the Kukicha compiler version.
Package version provides the Kukicha compiler version.
stdlib
cli
ctx
db
env
git
llm
mcp
obs
set

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL