Built with Kittine — this page is compiled Kittine (.kitty) source, not hand-written HTML or a JavaScript framework.

Kittine + Rust

The same counter, two syntaxes, one pipeline

Nothing below is a mockup. The left panel is real Kittine source; the right panel is the literal Rust that kittine-compiler emits for it today — line for line, taken from this project's own example-ssr crate.

func Counter() {
    <{count}> >> 0

    return (
        <button onClick={<{count}> >> count + 1}>
            "Clicks: "
            <{count}>
        </button>
    )
}
#[component]
pub fn Counter() -> impl IntoView {
    let (count, set_count) = signal(0f64);
    view! {
        <button on:click=move |_| set_count.update(|n| *n += 1f64)>
            "Clicks: "
            {move || count.get()}
        </button>
    }
}

Toggling the tabs above is Kittine itself: one signal, one reactive data attribute, zero JavaScript — the same fine-grained reactivity model Leptos gives Rust, just with less punctuation.

Structs, enums, and pattern matching

Newer syntax, same pipeline: litter / breed declare real Rust structs and enums, and pounce> compiles straight to a real match — no new runtime concept, just less to type.

breed Shape {
    Circle(#n),
    Square(#n),
    Idle
}

pounce> <{shape}>
    Circle(r) >> craft<r * 2>
    Square(s) >> craft<s>
    else> craft<'idle'>
#[derive(Clone, Debug)]
pub enum Shape {
    Circle(f64),
    Square(f64),
    Idle,
}

match shape.get() {
    Shape::Circle(r) => {
        leptos::logging::log!("{}", (r.clone() * 2f64));
    }
    Shape::Square(s) => {
        leptos::logging::log!("{}", s.clone());
    }
    _ => {
        leptos::logging::log!("idle");
    }
}

A litter or breed can also carry one generic type parameter, optionally bounded by a claw — Kittine's term for a trait — the same way litter NamedHolder<#t: Named> { value #t } compiles to a real Rust struct NamedHolder<T: Named> trait bound.

How it compiles

One source file, two real render targets

Every .kitty file goes through the exact same compiler. What differs downstream is what builds and serves the Rust it emits.

.kitty source
kittine-compiler
Leptos 0.7 Rust
rustc + wasm-bindgen
Vite dev server
Browser (CSR)
rustc + cargo-leptos
Axum server
Browser (SSR, HTML first)