Sandor Dargo
sandordargo.com · Personal blog · on HN since 2019
Sandor Dargo is a C++ developer who writes about new language and standard library features, especially C++26, and practical C++ habits.
What HN saysHN links it for explanations of C++ standard features such as stacktrace in C++23, along with C++26 changes like hardening and std::optional.
30HN people shared it
3linked it in comments
171stories submitted
1.1Kstory points
3 months agolast shared
2019people per year2026
Most-shared posts
- 1C++26: Standard Library Hardening – Sandor Dargo's Blog4 people · 6 points · first shared 2026 · discussion on HN
- 2C++26: Std:Optional3 people · 39 points · first shared 2025 · 2 comments on HN
- 3C++26: std:format improvement (Part 1)3 people · 5 points · first shared 2025 · discussion on HN
- 4C++26: Embed3 people · 3 points · first shared 2026 · discussion on HN
- 5C++26: String and String_view Improvements3 people · 3 points · first shared 2026 · discussion on HN
- 6C++26: range support for std:optional2 people · 78 points · first shared 2025 · 84 comments on HN
- 7C++26: Pack Indexing2 people · 62 points · first shared 2025 · 79 comments on HN
- 8Use std:span instead of C-style arrays2 people · 9 points · first shared 2024 · discussion on HN
- 9C++26: no more undefined behaviour in lexing2 people · 8 points · first shared 2025 · 1 comments on HN
- 10C++26: Variadic Friends2 people · 7 points · first shared 2025 · 2 comments on HN
- 11Time in C++: Understanding std:chrono:steady_clock2 people · 6 points · first shared 2025 · discussion on HN
- 12Three key philosophies behind C++2 people · 4 points · first shared 2024 · discussion on HN
- 13C++26: Constexpr Virtual Inheritance2 people · 4 points · first shared 2026 · discussion on HN
- 14The Rule of 5 and Inheritance2 people · 4 points · first shared 2024 · discussion on HN
- 15Keeping Code Reviews from Dragging2 people · 3 points · first shared 2026 · discussion on HN
What HN people wrote when they linked it
eatonphil · 2023-11-09
Looks like <stacktrace> is already part of C++23 [0]. But if you must use an older C++, why link the entire Swift runtime rather than something GCC's builtin backtraces [1] or libbacktrace [2]?
[0] https://www.sandordargo.com/blog/2022/09/21/cpp23-stacktrace-library
[1] https://www.gnu.org/software/libc/manual/html_node/Backtraces.html
[2] https://github.com/ianlancetaylor/libbacktrace
jstimpfle · 2023-07-09
> they should simply use c++, like k&r did to compile their example code in their 2nd ed - see preface to book if you don't believe.
So what? And GCC allegedly has been C++ for many years. Please take a look at the repo and tell me why anyone cares about that.
My personal experience with C++ is that I seem to always end up peeling off my nice abstractions again later. Most of what it offers hasn't stuck for me, at least for systems programming. There's a lot of bad C code I've had to work on over the years, but overzealously architected C++ codebases take the crown for inflicting the most pain for sure. One recent experience was when I replaced 4 files and 200 lines of C++ classes with 4 lines of straight C code. Not even a function was necessary. And that was one of the less bad experiences because it was actually possible to fix.
In my most recent attempt to be open-minded about it I've ended up keeping a few short methods, which can be nice for code brevity at the call site, and there is less of a tax about having to come up with naming schemes. But I have otherwise found classes (and in particular methods) to be painful for two reasons: All the procedures operating on the class have to be declared in the class (or as part of a friend class, but then they have to be declared there). This includes private methods and is just one more level of annoyance for a small (and debatable) syntactic convenience. It's pretty f***ing bad to have to turn implementation details to…
elcritch · 2022-11-07
To be fair I've mostly used concepts in Nim, not C++ x0 concepts. However, your comparisons of C++ concepts to Rust traits seems to be lacking a lot of details or is plain inaccurate. It also misses the flexibility of C++ concepts.
> C++ 0x Concepts was similar to Rust's Trait system in many ways. Particularly notable features of C++ 0x Concepts you might recognise in Rust's traits:
Perhaps at the loosest level of comparison around only defining limitations on possible types. However, C++ x0 concepts enable much more powerful combinations of logic to specify if a template fulfills a concept. In Nim the concept can be any arbitrary boolean statement.
This blog has some good examples of C++ concepts: https://www.sandordargo.com/blog/2021/03/10/write-your-own-cpp-concept…
It's trivial to specify that a C++ concept can be either a float or an integer:
template <typename Base, typename Exponent>
concept HasPower = (std::integral<Exponent> || std::floating_point<Exponent>) && requires (Base base, Exponent exponent)
{
base.power(exponent);
};
That's not possible AFAICT with Rust's traits.
> 1. Third parties can implement a C++ 0x Concept for some type which was not originally conceived with this Concept in mind, they just write the implementation and it works.
That's true for C++ concepts, but not entirely true for Rust traits. You can only implement a Rust trait if you own the type or own the trait. If you use two third party libraries, you…