Oddbean new post about | logout
 I genuinely feel like TG is not getting nearly the level of attention it deserves

https://github.com/tidwall/tg

A single C file that gives you extensively tested, threadsafe geospatial operations against GeoJSON, WKT and WKB with no external dependencies and two innovative new spatial indexing strategies?

How often does something like that show up? 
 I am by no means a C programmer but the code is giving me similar vibes to the first time I looked at Redis - it just feels so obviously right 
 @4ebb1885 I think it's because it should be in Rust these days (and can still provide a C API). No shade on the author or the algorithms, but I saw enough C things to make me skeptical. 
 @0609534c I feel like implementing that kind of a library in Rust would reduce its potential impact, because integrating Rust libraries into other languages, while possible, still isn't nearly as well trodden a path as C 
 @0609534c plus the README seems to be making the right noises in terms of "100% coverage using memory sanitizer and Valgrind" 
 @4ebb1885 Mmm, I think you are wrong here. It is really not difficult to give a Rust library a C API. You give the structs a C layout via an annotation, and then provide functions as a C library would. 
 @0609534c I didn't say it was hard, I just said it was a path less trodden - for something as fundamental as a base library for this kind of geospatial work C feels like a defensible choice to me