News for hackers. Stuff that matters.

naivete

Re:Nuklear: A single-header ANSI C GUI library on Saturday February 10, 2018 @07:13PM (#16350396)
What are you talking about, C doesn't have a concept of a module or a library in the first place.

Nothing about C is easy or logical. C only makes sense in 1965 on PDP7. All these hacks just work around the inherent shittyness of C/C++.

Re:Nuklear: A single-header ANSI C GUI library on Saturday February 10, 2018 @07:04PM (#16350368)
There isn't really that much unnecessary stuff in there. It's more like 20k LoC but half of it is comments. And if included as a header most of it will get stripped away by the preprocessor.

Just for context, in C++ including std::string (after preprocessing) will pull in 25k LoC, std::vector around 20k.

Programming in C++ by the book will average around 35k LoC per every compilation unit. And it will compile significantly slower than C code.

Having that in mind, and considering that Nuklear doesn't pull in any dependencies, not even C stdlib parts. I think author has done a good job at being lean and fairly straightforward.

UI libs are usually a huge dependency and a hairy mess. This is not really the case. It's just one ~1mb 20k line header file.

There is some overhead on preprocessing over having a .c/.h combo, but that's it.

Re:Nuklear: A single-header ANSI C GUI library on Saturday February 10, 2018 @06:35PM (#16350265)
Is your naive preprocessor implementation complete and standards compatible C99? Or just some bastardization of it? If not the 600 MBps bench is as good as useless.

What's the C preprocessor speed of GCC/Clang/MSVC? Any benches?