Playground
Kukicha
Output
Click Run to compile and execute your code.

Readable Pipes and Error Handling


One of the central design goals of Kukicha is code readability. In standard Go, error checks and nested function calls can sometimes obscure what the heck is going on.

In Kukicha, two language features work together to keep logic front and center: pipes (|>) and onerr.

Flowing Data with |>

Instead of deeply nested function calls:

# Nested (hard to read)
result := transform(filter(parse(raw)))

# Piped (reads left-to-right)
result := raw
    |> parse()
    |> filter()
    |> transform()

Pipes make data transformations read like a story from left to right, top to bottom.

Elegant Errors with onerr

Errors are values in Kukicha, just like in Go. But instead of repetitive if err != nil checks on every single line, Kukicha provides automatic error propagation inside functions that return an error, and concise onerr clauses when you want custom handling:

# Default fallback value on error
port := getPort() onerr 8080

# Fail fast with an informative panic
config := loadConfig(path) onerr panic "failed to load config: {error}"

# Clean error wrap and return
data := fetch.Get(url) onerr explain "fetching API data"

Combined with Go's strong static typing and high-speed compiler, Kukicha lets you write code that is both robust and readable.