kukicha

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 1 Imported by: 0

README

Kukicha

Brewed from Go. Use readable forms while you learn, or plain Go when you're fluent; same file, same compiler. The standard library stays steeped in simplicity no matter how you write it. 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"
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(i Issue) Verdict
    reply := llm.New("anthropic:claude-sonnet-4-6")
        |> llm.JSONMode()
        |> llm.System(`Classify GitHub issues. Reply JSON: {severity:1-5, kind, summary}`)
        |> llm.Ask("{i.title}\n\n{i.body}") onerr return {}

    v := Verdict{number: i.number}
    jsonpkg.UnmarshalString(reply, reference of v) onerr return {}
    return v

func main()
    issues := fetch.Get("https://api.github.com/repos/golang/go/issues?per_page=20")
        |> fetch.CheckStatus()
        |> fetch.Json(empty list of Issue) onerr panic "github: {error}"

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

    print("Needs attention:")
    for v in urgent
        print("  [P{v.severity}] {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, sort, print. The stdlib names carry the weight — fetch.Json, slice.Filter, concurrent.MapWithLimit, sort.ByKey and onerr keeps error handling out of the flow. A Go developer can write the same program in plain Go []Issue, &v, != nil, closures and Kukicha will compile it unchanged.


Two tiers, one stdlib

Kukicha is a strict superset of Go: the language you graduate into is Go itself. The Kukicha tier gives you scannable forms while you're learning; the Go tier is waiting whenever you're ready. Pick the one that fits or mix them in the same file.

Concept Kukicha form Go form
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 if err != nil { return err }
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 Kukicha forms are syntactic sugar; the Go forms are the Go they desugar to. Every .go file is valid .kuki unchanged, and every .kuki file transpiles to standard Go before compilation.

What stays constant across both tiers is the stdlibfetch, slice, sort, llm, mcp, concurrent, html, crypto, shell, and 30+ more. fetch.Get(...) |> fetch.Json(...) onerr ... reads the same whether the surrounding code is list of string or []string.


Quickstart

Requires Go 1.26+ (download) | Pre-built binaries on GitHub Releases

go install github.com/kukichalang/kukicha/cmd/kukicha@v0.3.0
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

Why bother

  • Skimmable at every skill level — beginners read the Kukicha forms, Go developers write plain Go, both call the same friendly stdlib
  • Compile-time security checks — catches SQL injection, XSS, SSRF, path traversal, command injection, and open redirects before you ship
  • 42+ batteries-included stdlib packagesfetch, slice, sort, mcp, llm, html, crypto, shell, and more
  • Ships as Go — single binary, cross-compile, WASM, full Go ecosystem
  • kukicha brew file.kuki converts any file back to standard Go; existing .go files compile as .kuki unchanged

Starting from Go

Already have a Go codebase? You don't have to rewrite anything, Kukicha can suggest idioms incrementally or convert files on request.

# See what your Go code looks like with Kukicha idioms
kukicha-blend main.go

# Convert Go to Kukicha (preview first, then apply)
kukicha-blend --diff main.go
kukicha-blend --apply main.go

# Convert Kukicha back to Go anytime
kukicha brew main.kuki

Editor support

  • VS Code: Search kukicha-lang in extensions (repo)
  • Zed: kukichalang/zed-kukicha
  • Other: make install-lsp and point your editor at kukicha-lsp

Documentation


Version: 0.3.0 | 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/importer.
gengostdlib generates internal/semantic/go_stdlib_gen.go by inspecting Go standard library function signatures via go/importer.
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.
deploy-status command
internal
ast
ir
lsp
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