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
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.
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.
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.
// 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.
The C++ STL library is great within the constraints of its own ABI / non-functional requirements.
It's just that the ABI/requirements are often chosen poorly. std::regex, std::string, std::map, std::unordered_map, std::vector<bool> are just some of the victims of this.
As a developer, I find it a bit sad that the C++ committees hold backwards compatibility as the highest virtue, thereby crippling performance.
To be fair I tend to abuse std::regex more than I should. Somehow it feels cleaner than to write a lambda or a separate function to validate a string format.
If I should ever be asked to provide an example of peek cringe I can now respond with: "For me it’s a symbol of my individuality, and my belief in personal freedom."
The first rule of C++ programming is to have fun and be yourself :)
You just made an enemy for life! 😤
You just initialized the wrong pointer, buddy.
You just typecast into the wrong class, pal.
You just dereferenced a null pointer, laddy.
You just overloaded the wrong operator, fam
segmentation fault (core dumped), bro
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
Waow. Based.
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.
What part of
doit.batdid you not understand.Gotta read the whole post for more classics
In general I don’t advocate writing a lot of tests.I had to skim because too much jerking, but that’s funny about tests. At the bottom he says:
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.
"I don’t have data behind those numbers, they feel right."
A whole different kind of vibe coating
/uj Sumatra is an excellent pdf reader — I’ll never allow Adobe on my main box again.
/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.
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
A large proportion of this is the use of mupdf as the PDF renderer, which I assume is 95%+ of the work done by the application.
Mupdf does have it's own pdfviewer which feels like a suckless application. /uj atleast on linux no clue on the state on the w32 and java versions
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.
Objectivist Oriented Programming
https://en.uncyclopedia.co/wiki/Objectivism-oriented_programming
Why doesn't he just use
std::pdf?std::pdf is considered harmful, you need to write your own StrVecPage
Dunno how he ever expects to achieve performance comparable to Acrobat Reader without using the STL
Rewrite it in Python?
[removed]
Seems like a reasonable implementation with a terrible API. Dude loves calling strlen. Cniles gonna cnile, I guess.
Where jerk
Fuck the STL all my homies hate the STL
This post written by embedded gang
Eh, it's a decision of a single dude in a single project, hardly a jerking material
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.
}
The C++ STL library is great within the constraints of its own ABI / non-functional requirements.
It's just that the ABI/requirements are often chosen poorly. std::regex, std::string, std::map, std::unordered_map, std::vector<bool> are just some of the victims of this.
As a developer, I find it a bit sad that the C++ committees hold backwards compatibility as the highest virtue, thereby crippling performance.
[removed]
[removed]
[removed]
lol std::vector<bool>
lol no simplicity
To be fair I tend to abuse std::regex more than I should. Somehow it feels cleaner than to write a lambda or a separate function to validate a string format.
/uj it's not the decision it's the justification (quoted in the title of this post)
Uh oh. Baby, you'd better get me back to that hotel. You got me hotter than Georgia asphalt.
I bet he also wears a snakeskin jacket
If I should ever be asked to provide an example of peek cringe I can now respond with: "For me it’s a symbol of my individuality, and my belief in personal freedom."