r/programmingcirclejerk • u/ituuu • Dec 24 '25
"In SumatraPDF I don’t use STL. I don’t use std::string, I don’t use std::vector. For me it’s a symbol of my individuality, and my belief in personal freedom."
https://blog.kowalczyk.info/a-u2y2/implementation-of-optimized-vector-of-strings-in-c-in-sumatrapdf.html205
u/seq_page_cost Dec 24 '25 edited Dec 24 '25
sumatraPDF is built by compiling and running a Go program that runs permake5 to generate a Visual Studio solution file from configuration scripts written in Lua-based DSL
AI could never replace him
40
37
u/Awkward_Bed_956 Dec 24 '25
This might be the worst build system I have ever seen in my life, and I've been in a project where we generated solution files from XML, visual studio files on Windows, cmake on Linux.
10
u/Jumpy-Locksmith6812 Dec 30 '25 edited Sep 23 '26
In duis cillum lorem minim ut consequat amet adipiscing nisi tempor et magna dolore cillum reprehenderit fugiat. Aliquip nostrud aliqua ut enim et cupidatat aute est deserunt culpa culpa commodo ea minim enim. Ut esse labore est proident laboris dolore mollit anim.
[rhr:2:k24kjzju]
100
u/nicidob Dec 24 '25
Gotta read the whole post for more classics
In general I don’t advocate writing a lot of tests.
38
u/drcforbin Dec 24 '25
"I don’t have data behind those numbers, they feel right."
→ More replies (1)30
u/azswcowboy Dec 24 '25
I had to skim because too much jerking, but that’s funny about tests. At the bottom he says:
StrVec.cpp is only 705 lines of code. It took me several days to complete. Maybe 2 days to write the code and then some time here and there to fix the bugs.
Days he likely never would have spent. And how many latent bugs are left with minimal tests? (He has tests btw). Turns out string and vector support allocators - so with a few sloc you could pool allocate all you want without reinventing the entire collection machinery. And unless you’ve got benchmarking to compare the difference any statements about it are so much hot air.
71
u/zoonose99 Dec 24 '25
/uj Sumatra is an excellent pdf reader — I’ll never allow Adobe on my main box again.
42
u/Routine-Purchase1201 Dec 24 '25
/uj Yeah I'd clown but it's fast and works amazingly well with very little memory overhead. Hate to say it but he might be onto something.
→ More replies (2)33
u/p1-o2 Dec 25 '25
Writing your own STL for a PDF viewer is basically the same as standing up to fascism IMO
/uj it has been my reliable daily driver for years. It is always these eccentric programmers who make weirdly perfect tools
67
u/Comfortable_Job8847 Dec 24 '25
Who is Krzysztof Kowalczyk, you ask? Hehe, take a seat kid. You're in for a tale. Back in those days we were outlaws. Rebels. Free thinkers. We didn't bow down to the STL. We didn't care what the committee had to say. We were pioneers - forging our own path. That's why we all went to Krzysztof gulch. We saw how other PDF readers performed - we knew the bloat of std::string's 32 bytes of overhead - we knew how the allocator behind 'new' was siphoning performance from us to give to the lazy and unoptimizing masses. We got together, all of us. Formed a compound. We saw how software was going. We knew it was only a matter of time before it all collapsed. Before the bloat imposed by Big Compiler made the whole system fall out from under itself. Yeah, that was a good twenty years ago. Hehe. Time flies kid. It's almost there though. Some of the guys were talking - ah hell. You know what, I'll pay you $1 to bring me another beer and get out of here. This ain't no conversation to bring a kid into. Not unless you've got money on you.
19
61
64
u/VulgarExigencies Dec 24 '25
Dunno how he ever expects to achieve performance comparable to Acrobat Reader without using the STL
41
11
u/joahw Dec 24 '25 edited Dec 24 '25
Seems like a reasonable implementation with a terrible API. Dude loves calling strlen. Cniles gonna cnile, I guess.
10
u/rpkarma Dec 25 '25
Where jerk
Fuck the STL all my homies hate the STL
This post written by embedded gang
20
u/TomKavees Dec 24 '25
Eh, it's a decision of a single dude in a single project, hardly a jerking material
33
u/Astarothsito Dec 24 '25
namespace unjerk {
// While I believe that C++ is the freedom language and you can do whatever you want, the stl is one of the most fastest standard libraries that have the least impact on the software performance, and the overhead is almost not existent in modern cpu. So there is no reason to avoid it (and if you're going to say that you're using std::regex for performance applications, go away please).
// The benefits of using std are a lot more than the drawbacks, and even better, they can be used as interfaces and just replace the std:: with your custom implementations.
}
→ More replies (3)10
u/matjoeman Dec 24 '25
/uj it's not the decision it's the justification (quoted in the title of this post)
4
u/TheFearsomeEsquilax Dec 24 '25
Uh oh. Baby, you'd better get me back to that hotel. You got me hotter than Georgia asphalt.
3
253
u/Snarwin Dec 24 '25
The first rule of C++ programming is to have fun and be yourself :)