Xtk: A Rule-Based Expression Rewriting Toolkit for Symbolic Computation
We present Xtk (Expression Toolkit), a powerful and extensible system for symbolic expression manipulation through rule-based term rewriting. Xtk provides a simple yet expressive framework for pattern matching, expression transformation, and symbolic computation. The system employs an Abstract Syntax Tree (AST) representation using nested Python lists, enabling intuitive expression construction while maintaining formal rigor. We demonstrate that Xtk’s rule-based approach is Turing-complete and show its applicability to diverse domains including symbolic differentiation, algebraic simplification, theorem proving via tree search algorithms, and expression optimization. The toolkit includes an extensive library of predefined mathematical rules spanning calculus, algebra, trigonometry, and logic, along with an interactive REPL for exploratory computation. We present the theoretical foundations of the system, describe its implementation architecture, analyze its computational complexity, and provide comprehensive examples demonstrating its practical applications.
Discussion & Related
Long Echo in Practice: 5,874 Bookmarks in a Single File
Graceful degradation made concrete: years of bookmarks exported to a self-contained HTML app that works offline, forever.
December 18, 2025 · 2 min read
The Long Echo Toolkit
Three CLI tools for preserving your digital intellectual life: conversations, bookmarks, and books. SQLite-backed, exportable, built to outlast the tools themselves.
December 16, 2025 · 6 min read
Rerum: Pattern Matching and Term Rewriting in Python
A Python library for symbolic computation with a readable DSL, pattern matching, and a security model that separates rules from computation.
December 16, 2025 · 5 min read
Crier: Cross-Post Your Content Everywhere
A CLI tool for cross-posting content to dev.to, Hashnode, Bluesky, Mastodon, and more, with LLM-powered auto-rewrite for short-form platforms.
December 16, 2025 · 4 min read
repoindex: Collection Awareness for Your Git Repos
A metadata index that gives LLM tools like Claude Code awareness of your entire repository collection.
December 16, 2025 · 2 min read