|
| 1 | +# CellWright |
| 2 | + |
| 3 | +Cross-platform quantitative spreadsheet built with C++20 and Dear ImGui. Designed for financial and scientific workflows: columnar storage, formula engine with dependency tracking, SIMD aggregation, embedded DuckDB SQL, plugin system, and charting via ImPlot. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +**Core Engine** |
| 8 | +- Columnar storage with dense `vector<double>` and sparse non-numeric overlay |
| 9 | +- Recursive-descent formula parser with arena-allocated AST |
| 10 | +- 50+ built-in functions (math, statistics, text, logic, date) |
| 11 | +- Dependency graph with topological recalculation and cycle detection |
| 12 | +- Undo/redo (command pattern, 200 depth) |
| 13 | +- JSON (`.magic`) and CSV serialization |
| 14 | + |
| 15 | +**SIMD Aggregation** |
| 16 | +- ARM NEON / AVX2+FMA / scalar fallback |
| 17 | +- NaN-aware `sum`, `min`, `max`, `count`, `sum_of_squares` |
| 18 | +- Fast path in evaluator for single-column SUM/MIN/MAX/COUNT |
| 19 | + |
| 20 | +**Embedded SQL** |
| 21 | +- DuckDB v1.1.3 in-process engine (lazy init, pimpl) |
| 22 | +- `=SQL("SELECT ...")` formula function |
| 23 | +- Interactive SQL editor panel |
| 24 | +- Generation-based skip of redundant imports |
| 25 | + |
| 26 | +**Plugin System** |
| 27 | +- Three conventions: C++ (IFunction, hot-reloadable), C ABI (language-agnostic), Python (pybind11) |
| 28 | +- SHA-256 trust store with codesign verification (macOS) |
| 29 | +- Hot reload with mtime polling |
| 30 | +- Panel plugins (custom ImGui windows) |
| 31 | + |
| 32 | +**Arrow C Data Interface** |
| 33 | +- Zero-copy export of sheet data to Arrow struct arrays |
| 34 | +- Import Arrow record batches into sheets |
| 35 | +- Interop with PyArrow, Polars, and pandas |
| 36 | + |
| 37 | +**UI** |
| 38 | +- Spreadsheet grid with freeze panes, drag-to-move, fill handle, range selection |
| 39 | +- Formula bar with autocomplete, signature tooltips, reference highlighting |
| 40 | +- Line / bar / scatter / histogram / stacked bar charts via ImPlot |
| 41 | +- Find & replace, conditional formatting, per-column filtering |
| 42 | +- Dark / light theme, DPI awareness |
| 43 | +- Toast notifications, unsaved-changes guard, auto-save recovery |
| 44 | +- Native file dialogs, drag-and-drop plugin loading |
| 45 | + |
| 46 | +## Technology Stack |
| 47 | + |
| 48 | +| Layer | Choice | |
| 49 | +|-------|--------| |
| 50 | +| Language | C++20 | |
| 51 | +| UI | Dear ImGui (docking) + GLFW 3.4 + OpenGL 3 | |
| 52 | +| Charting | ImPlot | |
| 53 | +| Plugin framework | [cpp_plugin_arch](https://github.com/bdcbqa314159/cpp_plugin_arch) | |
| 54 | +| Python plugins | pybind11 v2.13.6 | |
| 55 | +| SQL engine | DuckDB v1.1.3 | |
| 56 | +| SIMD | ARM NEON / AVX2+FMA / scalar | |
| 57 | +| Interop | Arrow C Data Interface | |
| 58 | +| File dialogs | nativefiledialog-extended v1.2.1 | |
| 59 | +| Tests | Google Test v1.15.2 + pytest | |
| 60 | +| Build | CMake 3.20+ | |
| 61 | + |
| 62 | +## Build |
| 63 | + |
| 64 | +```bash |
| 65 | +# Configure (fetches all dependencies via FetchContent) |
| 66 | +cmake -B build -DCMAKE_BUILD_TYPE=Release |
| 67 | + |
| 68 | +# Build |
| 69 | +cmake --build build --parallel |
| 70 | + |
| 71 | +# Run |
| 72 | +./build/bin/cellwright |
| 73 | +``` |
| 74 | + |
| 75 | +### Options |
| 76 | + |
| 77 | +| Option | Default | Description | |
| 78 | +|--------|---------|-------------| |
| 79 | +| `CELLWRIGHT_BUILD_PLUGINS` | `ON` | Build bundled plugins | |
| 80 | +| `CELLWRIGHT_BUILD_TESTS` | `ON` | Build test suite | |
| 81 | + |
| 82 | +### Platform dependencies |
| 83 | + |
| 84 | +**macOS** — Xcode command line tools (ships with OpenGL, Cocoa frameworks) |
| 85 | + |
| 86 | +**Linux** — install before building: |
| 87 | +```bash |
| 88 | +sudo apt-get install libgl-dev libx11-dev libxrandr-dev libxinerama-dev \ |
| 89 | + libxcursor-dev libxi-dev libgtk-3-dev python3-dev |
| 90 | +``` |
| 91 | + |
| 92 | +**Windows** — Visual Studio 2022 with C++ workload |
| 93 | + |
| 94 | +## Tests |
| 95 | + |
| 96 | +```bash |
| 97 | +# C++ tests (254 tests across 34 suites) |
| 98 | +ctest --test-dir build --output-on-failure |
| 99 | + |
| 100 | +# Python tests (Arrow interop, smoke tests) |
| 101 | +python -m venv .venv |
| 102 | +source .venv/bin/activate |
| 103 | +pip install -r requirements.txt |
| 104 | +pytest tests/python -v |
| 105 | +``` |
| 106 | + |
| 107 | +## Bundled Plugins |
| 108 | + |
| 109 | +| Plugin | Type | Functions | |
| 110 | +|--------|------|-----------| |
| 111 | +| `example_stats` | C++ IFunction | `STDEV_P` | |
| 112 | +| `scientific` | C++ IFunction | Trig, log, statistical | |
| 113 | +| `bond` | C ABI | `BOND_PRICE`, `BOND_YIELD`, `BOND_DURATION`, `BOND_CONVEXITY` | |
| 114 | +| `py_bond` | Python | Bond pricing via pybind11 | |
| 115 | + |
| 116 | +## License |
| 117 | + |
| 118 | +[MIT](LICENSE) -- Bernardo Cohen / deLaPatada Software |
0 commit comments