FileDiff
5/21/2025
FileDiff is a minimalist yet fast command-line utility that reveals the exact insertions and deletions required to turn one file into another. Under the hood it implements Myers’ algorithm—the same strategy used by Git and GNU diff—written from scratch in C# / .NET 9.
Highlights
- Myers shortest-edit-script in pure C#
- Unified, human-friendly diff output
- Self-contained binaries for Windows (x64) and macOS (ARM)
- Clean separation: algorithm · parser · printer
- Optimised
OffsetArray
for constant-time diagonal look-ups
Quick Start
# build self-contained release (Windows example)dotnet publish -r win-x64 -c Release --self-contained true
# compare two filesFileDiff file1 file2
File Structure
Common/OffsetArray.cs # diagonal-buffer helper Diff/ # algorithm + pretty printer ├─ Algorithm/MyersComparer.cs ├─ FileComparer.cs └─ Data/ (Insert | Remove | Instruction) Program.cs # entry point
Roadmap
- Side-by-side diff view
- Syntax-aware colouring
- Traceback refactor to reduce duplication
FileDiff is released under the MIT license.
← Back to blog