Kida 0.3.2

Compiler intelligence, Python 3.14 modernization, consolidated AST traversals, new CLI commands

Released 2026-04-03.

Kida 0.3.2 deepens compile-time optimization, modernizes internals for Python 3.14, and consolidates AST traversals for faster compilation.

Highlights

  • Expanded partial evaluator — Handles more node types for deeper compile-time constant folding.
  • Python 3.14 patterns@final on key classes, matchstatements, stricter linting.
  • Consolidated traversals — Single-pass dependency analysis, cached AST in bytecode cache.
  • New CLI commandskida explain shows active optimizations; kida benchmeasures performance.

Added

CLI

  • kida explain — Print which compile-time optimizations are active for a template (f-string coalescing, dead code elimination, partial evaluation, component inlining, free-threading).
  • kida bench — Quick benchmarking command for template compile and render performance.

Compiler

  • Expanded partial evaluator — Now handlesDef, FuncCall, MarkSafe, NullCoalesce, OptionalFilter, SafePipeline, Slot, and SlotBlocknodes. Templates with static context see more expressions resolved to constants before codegen.
  • Partial eval benchmarks — Dedicated benchmark suite for measuring partial evaluation speedups.
  • Terminal benchmarks — Dedicated benchmark suite for terminal rendering mode.

Documentation

  • Kida vs Jinja2 comparison — Side-by-side document covering syntax, architecture, performance, and feature differences.

Changed

  • Python 3.14 modernization@final decorators on key classes; matchstatements replace if/elifchains in the partial evaluator; stricter ruff linting rules.
  • Consolidated AST traversals — Dependency analysis merged into a single-pass visitor.
  • Cached AST in bytecode cache — Parsed AST stored alongside compiled code for faster recompilation.
  • Render helper consolidation — Deduplicated patterns inrender_helpers.pyand render_context.py.
  • README rewrite — Concise, feature-focused README with architecture overview.
  • Import path cleanupTemplateSyntaxError imported from kida.exceptions.

Removed

  • analysis/visitor.py — Consolidated into analysis/node_visitor.py.

Upgrade Notes

  1. No breaking changes. Drop-in upgrade from 0.3.1.
  2. If you importTemplateSyntaxError from kida.environment.exceptions, that path still works butkida.exceptionsis now preferred.
  3. GitHub Action version tag updated to@v0.3.2.