Spreadsheets as Code. Define complex spreadsheets declaratively, version them with Git, and export to Excel, Google Sheets, or LibreOffice.
// Example: Sales Report
@compose(Product, Sales)
table SalesReport {
@label("Product") @style(bold)
name: Product.name
@label("Revenue") @style(currency)
revenue: Formula(Sales.units * Product.price)
}
- Declarative Syntax – Define tables, formulas, and styles in code.
- Export Everywhere – Compile to
.xlsx, Google Sheets, or.ods. - Version Control – Human-readable diffs (unlike binary
.xlsxfiles). - IDE Support – Autocomplete, diagnostics, and hover docs via LSP.
- Template Reuse – Inherit and compose spreadsheets with
@import.
cargo install xgslxgsl compile report.xgsl --target excelxgsl fmt report.xgsl// Relative references (like Excel’s A1 notation, but readable)
growth: Formula((.up.revenue - this.revenue) / .up.revenue)
// Pull data from other tables
inventory: Formula(Inventory[this.product_id].stock)
// Import templates from GitHub
@import("github:company/report-templates@v1.2")
table Q4Report extends QuarterlyTemplate { ... }
| Feature | Status |
|---|---|
| Excel Exporter | 🔜 Planned |
| Google Sheets Exporter | 🔜 Planned |
| Language Server (LSP) | 🔜 Planned |
| Dependency Resolver | 🔜 Planned |
We welcome contributions! See:
- RFC 0001 – Design overview.
| Problem | XGSL Solution |
|---|---|
| Manual edits break logic | Spreadsheets defined as code |
| Unreadable Git diffs | Clean, versionable syntax |
| No template reuse | @import and inheritance |
📌 Star this repo to stay updated!
💬 Questions? Open a GitHub Discussion.