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 —
@finalon key classes,matchstatements, stricter linting. - Consolidated traversals — Single-pass dependency analysis, cached AST in bytecode cache.
- New CLI commands —
kida explainshows 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 handles
Def,FuncCall,MarkSafe,NullCoalesce,OptionalFilter,SafePipeline,Slot, andSlotBlocknodes. 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 —
@finaldecorators on key classes;matchstatements replaceif/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 in
render_helpers.pyandrender_context.py. - README rewrite — Concise, feature-focused README with architecture overview.
- Import path cleanup —
TemplateSyntaxErrorimported fromkida.exceptions.
Removed
analysis/visitor.py— Consolidated intoanalysis/node_visitor.py.
Upgrade Notes
- No breaking changes. Drop-in upgrade from 0.3.1.
- If you import
TemplateSyntaxErrorfromkida.environment.exceptions, that path still works butkida.exceptionsis now preferred. - GitHub Action version tag updated to
@v0.3.2.