The short version
Think of Foglio as two parts. The part you see (windows, menus, the grid of cells) is written with Apple's own tools, so it looks and behaves like every other Mac app. The part that does the maths (reading files, understanding formulas, recalculating) is a separate engine written in Rust, a language that produces very fast, compact programs.
The two parts talk through a small, plain interface. Nothing sits in between: no hidden browser, no virtual machine, no runtime to download. That is why the whole app is a 7.5 MB download, launches in 0.24 s and needs about 58 MB of memory with an empty sheet.
The Mac app: Swift and AppKit
The interface is written in Swift on AppKit, the framework behind Finder and most of the Mac's own apps. Documents are real macOS documents, so Open Recent, Save As, Revert, Duplicate, window tabs, full screen, dark mode, printing and Export PDF work the way you expect.
The sheet itself is a custom NSView grid, not a table control. It asks the engine only for the cells that are visible, in batches ready to draw, which keeps scrolling smooth on sheets with hundreds of thousands of rows. Charts, pictures and the formula bar are drawn by the app too.
Foglio also contains its own player for EMF and WMF metafiles, the vector picture format of older Office documents (clip art, MathType equations, pasted Visio diagrams). Pictures that other Mac apps show as blank boxes are drawn properly and saved back unchanged.
The engine: Rust and a patched IronCalc
Formulas are parsed and evaluated by IronCalc, an open-source spreadsheet engine in Rust. Foglio uses a patched fork of IronCalc 0.9.1 with every change marked and documented in the repository.
The fork adds incremental recalculation: when you edit a cell, only the formulas that depend on it are recalculated, instead of the whole workbook. On a workbook with 100,000 rows and 300,000 formulas, an edit takes 16 ms; a full recalculation takes 64 ms.
It also adds indexed lookups. The first VLOOKUP, MATCH or XLOOKUP into a range reads it once and builds a hash index; later lookups are a single probe. 1,000 exact VLOOKUPs over 10,000 rows went from 1,703 ms in upstream IronCalc to 1.3 ms in Foglio's fork. The fork also fixes a dozen functions so that 191 of the 195 functions in Foglio's compatibility audit match Excel on every test case.
- Older
.xls, binary.xlsband LibreOffice.odsfiles are read with calamine, a fast Rust reader. - CSV and TSV files go through a Rust importer that detects the text encoding, the delimiter and the decimal separator.
- Formulas typed in Italian, German, Spanish or French are translated to Excel's standard English form before they are stored.
The bridge: a plain C interface
The Rust engine is compiled as a static library and exposes a small C interface (foglio_core.h): open and save a file, edit a cell, return a batch of visible cells. Swift calls it directly through a bridging header. There are no generated bindings, no frameworks and no inter-process messages, so a call into the engine costs about as much as a normal function call.
No Xcode project
Foglio is built with two commands: cargo builds the Rust library and swiftc compiles the app and links it. A shell script produces a universal app for Apple silicon and Intel and wraps it in a disk image with Apple's own hdiutil. You need the Xcode Command Line Tools and Rust; full Xcode is not required.
Fewer layers mean fewer things to go wrong, faster builds, and a project that anyone can read from top to bottom.
Tested with real keyboard and mouse events
Foglio has 69 UI tests that drive the real app with real keyboard and mouse events: typing formulas, filling ranges, sorting, undoing, saving and reopening files. The file importers and the formula engine have their own Rust test suites, and a special mode re-checks every incremental recalculation against a full one.
Why this makes Foglio small and fast
An Electron app carries a full copy of the Chromium browser, typically well over 100 MB before it does anything. A Java or cross-platform suite carries its runtime and its own UI toolkit. Foglio carries only its own code and uses the frameworks already on every Mac.
The Rust core is compiled with full link-time optimization and stripped of debug symbols. The result is a universal app of about 19 MB on disk, 7.5 MB as a compressed download, that idles at 0 % CPU.