I love well written C libraries, like the sokol or stb libraries.
20 karma · joined March 9, 2017
I love well written C libraries, like the sokol or stb libraries.
No problem at all for your initial comment! I share similar sentiment, I've found a lot easier in the past glueing C libraries to do something more than trying to integrate a C++ library for the exact reasons you're describing...
HashMap and proper Map<K,V> are already on the roadmap https://pagghiu.github.io/SaneCppLibraries/library_container...
Stack can be easily created with Vector.
I think Queue is pretty specialized, but I will think about it.
https://en.wikipedia.org/wiki/CMake#CMakeLists.txt
Most "declarative" build systems are not actually what they "declare" to be. I've seen too many DSLs introducing half backed imperative concepts here and there to do _if_ and _for_ constructs or function calls, redoing the same as imperative languages but poorly.
I like to market it as an "alternative world" where the C++ stdlib is more a platform abstraction library focused on carrying practical tasks like networking, Async I/O, HTTP etc.
It's also definitively placing itself in the middle between unsafe C and bloated C++.
I think that handling errors with ErrorOr<T,E> or similar techniques (I use something similar too) is very different from exception handling.
My main problems with exception handling are:
1. It's not zero-overhead (brings in RTTI often) 2. You can't know if a function throws something by looking at its signature 3. You don't know what types exceptions a function can throw 4. It doesn't force users to handle errors that can happen, leading tomore "happy path" style code
Something like ErrorOr or similar with [[nodiscard]] ticks all the above 4 points.
Every library having its own version of common data structure is unfortunately something that C++ programmers can't really seem to agree on :)
What containers, beside Vector<T> (and Map<K,V> made with Vector) + variants would you like to see the most?
The documentation here states:
https://pagghiu.github.io/SaneCppLibraries/library_reflectio...
Note Reflection uses more complex C++ constructs compared to other libraries in this repository. To limit the issue, effort has been spent trying not to use obscure C++ meta-programming techniques. The library uses only template partial specialization and constexpr.
https://pagghiu.github.io/SaneCppLibraries/library_algorithm...
Hopefully it will get expanded with more useful algorithms, it has not been a priority in the first releases cycle.
What macros are bothering you the most?
And yes, complex stuff sometimes tries to handle "everyone's use case" but if you can limit yourself to 95% of use cases, your code suddenly become a lot simpler. The backward compatibility consideration holds true as well.
For example, I have been creating an Async Library (plus a few other things like the FileSystemWatcher etc.) that cover a good portion of what is done in libuv. Of course libuv code handles A TON more of edge cases and has a lot of compatibility constraints, but with a lot less code I can provide enough functionality to satisfy a lot of use cases. Not all use cases, but a lot of use cases.
Thanks for the good luck! I am definitively doing it just for fun :)
One large open source project that is using Exception free C++ is SerenityOS for example https://github.com/SerenityOS/serenity
The best way to write proper exception free C++ is not to use the C++ Standard Library.
This is all in an effort to bring down compile times, avoiding including anything from the standard because you can never know if including <atomic> is bringing 10K lines of code in your header.
I will probably provide an optional USE_STANDARD_HEADERS flag someday to allow including a few standard things, including atomics, to avoid doing things wrong on compilerS that are not tested enough (as I clearly can't test every compiler).
Regarding UniquePtr<T> I used to have one but I later on decided to remove it.
https://github.com/Pagghiu/SaneCppLibraries/commit/9149e28
However, that being said the library is lean enough so that you can still use it with smart pointers provided by any other library (including the standard one) if that's your preference.
I have not been working (yet) on custom allocators, but that's on the roadmap: https://pagghiu.github.io/SaneCppLibraries/library_container...
By giving a quick read, I see that they also have asynchronous IO capability, and this makes it somewhat similar. Not sure about their build times, but knowing Boost I would not expect to be in the 5 seconds range. From what I understand they are tied to be used inside a browser, while we can generate regular desktop UI that also work in browser. I think that UI latency of our method is better than their system, but our approach requires far more computational resources and bandwidth. Their method probably scales better with many users connected.