logoalt Hacker News

FabCH • today at 8:20 AM • 0 replies • view on HN

It's a tradeoff. The length itself is not a problem. It will happily diff normal multi-MB files.

The problem is the degenerative syntax tree that TreeSitter produces in case of, for example a multi-million array of bytes. This causes a stack overflow in the TreeSitter C code which takes down the Rust process with it.

The correct solution would be to prevent TS from crashing, or isolate the C<->Rust boundary better.

Or just, not support that for v0.3. Because if you are diffing the collected works of Shakespeare as a binary blob in a C++ header, maybe diffing isn't your biggest problem.