Hacker Blogs
Work in progress: 15,409 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #2316

F

foonathan::blog()

Personal blog · foonathan.netprogramming

foonathan::blog() is a personal blog at foonathan.net about programming. Since 2016, 35 different Hacker News readers have linked it 63 times, most often “Nifty Fold Expression Tricks”. It is still writing: the last post was on 2024-11-20, and you can follow it by feed.

Visit the blog
63mentions?
35HN people?
2016–2026first – last linked?
Links on Hacker News per year · peak 16 in 2022

Thoughts from a C++ library developer.

Most-linked posts?

  1. Nifty Fold Expression Tricks
    2 people · 3 mentions · first linked 2020-05-05
  2. /2017/09/destructive-move/
    2 people · 2 mentions · first linked 2025-07-20
  3. New integer types I’d like to see
    2 people · 2 mentions · first linked 2022-09-29
  4. Malloc() and free() are a bad API
    2 people · 2 mentions · first linked 2022-08-31
  5. C++20’s Iterator Sentinels
    2 people · 2 mentions · first linked 2020-03-25
  6. The CRTP Interface Technique
    2 people · 2 mentions · first linked 2021-10-12
  7. Malloc() and free() are a bad API (2022)
    2 people · 2 mentions · first linked 2022-08-31
  8. Technique: Compile Time Code Generation and Optimization
    2 people · 2 mentions · first linked 2022-01-27
  9. Technique: Recursive Variants and Boxes
    2 people · 2 mentions · first linked 2022-06-01
  10. Replacing std:move and std:forward
    2 people · 2 mentions · first linked 2020-09-23

What Hacker News says?

  1. "Every feature you have in C++, Rust does it better" How does one perform generic fold expressions in Rust lang ? (Possible in C++ 17 and above) https://foonathan.net/2020/05/fold-tricks/ https://en.cppreference.com/w/cpp/language/fold

    Comment linking /2020/05/fold-tricks/

    on “Rust in the Android Platform”
  2. Submitted Carbon’s most exciting feature is its calling convention as a story · 243 points

    HN discussion
  3. > isn't even legit in modern C++. That's just move semantics. When you move it, it's gone at the old name. Exactly the opposite actually. Rust has destructive move while modern C++ has nondestructive move. So in Rust, an object is dead after you move out of it, and any further attempts to use it are a compiler diagnosed error. In contrast, a C++ object is remains alive after the move, and further use of it isn't for…

    Comment linking /2017/09/destructive-move/

    on “The borrowchecker is what I like the least about Rust”
  4. Submitted Is the C++ preprocessor still needed? as a story · 106 points

    HN discussion
  5. I don't think ditching the "basic" operator precedence (MDAS etc.) is a good idea, but I strongly agree that operator precedence should be a partial order, not a total order. See also [1]. [1] https://foonathan.net/2017/07/operator-precedence/

    Comment linking /2017/07/operator-precedence/

    on “Wuffs the Language”
  6. Submitted New integer types I’d like to see as a story · 101 points

    HN discussion
  7. You can use inline namespaces for versioning symbols. https://www.foonathan.net/2018/11/inline-namespaces/

    Comment linking /2018/11/inline-namespaces/

    on “Learning that you can use unions in C for grouping things into namespaces”
  8. Submitted Constexpr is a Platform (2020) as a story · 101 points

    HN discussion
  9. An interesting article relating to "operator precedence is broken". https://www.foonathan.net/2017/07/operator-precedence/

    Comment linking /2017/07/operator-precedence/

    on “Ivy – An interpreter for an APL-like language”
  10. Submitted What is the unit of a text column number? as a story · 59 points

    HN discussion
  11. I'm reminded of https://www.foonathan.net/2022/08/malloc-interface/#problem-... . While initially I was skeptical of the author's criticism of C's allocation APIs, this bug seems to be one that could've been avoided by using the proposed try_expand() instead of realloc(). Of course ideally we'd move away from provenance-based UB and Rust's third-class aliased mutability, to simpler conservative aliasing semantics by…

    Comment linking /2022/08/malloc-interface/

    on “GCC's new fortification level: The gains and costs”
  12. Submitted Malloc() and free() are a bad API (2022) as a story · 49 points

    HN discussion
  13. There's still plenty of ways to shoot yourself in the foot if you are "not careful" with the modern C++ code you write. See for example http://foonathan.net/blog/2017/03/22/string_view-temporary.h... Modern C++ has a lot of great stuff to help, but the sense of safety you get when you use Rust is something else entirely.

    Comment linking /blog/2017/03/22/string_view-temporary.html

    on “Building a Website with C++”
  14. Submitted Is the preprocessor still needed in C++? (2017) as a story · 43 points

    HN discussion
  15. Sorry to be the nitpicker here, but - the best incremental improvement would probably have seen move-destruction instead of just moves, which keep the source object alive and force the allowance for a valid 'empty' or 'dummy' state. See also: * https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n13... move designs * https://www.foonathan.net/2017/09/destructive-move/

    Comment linking /2017/09/destructive-move/

    on “C++ move semantics from scratch (2022)”
  16. Submitted Malloc() and free() are a bad API as a story · 33 points

    HN discussion
  17. I remember reading an article about the difficulties of extracting AST from clang [1]. Even when there are less politics involved, seems like a hard problem. With GCC, the problem becomes an Stallman order of magnitude harder :-) 1: https://foonathan.net/2017/04/cppast/

    Comment linking /2017/04/cppast/

    on “Extracting the abstract syntax tree from GCC (2015)”
  18. Submitted Nifty Fold Expression Tricks as a story · 31 points

    HN discussion
  19. Most of what the author suggests is available in (modern) C++ - while maintaining backwards compatibility with C code: * Textual inclusion : C++20 has modules, where you include sematically, not textually. * Bitwise operator precedence: Not soundly supported, but you can sort-of have custom infix operators in C++, see: https://stackoverflow.com/questions/15632217/defining-new-in... so, specifically, one could implem…

    Comment linking /2016/10/strong-typedefs/

    on “A Reply to “Let’s stop copying C””
  20. Submitted Technique: Recursive Variants and Boxes as a story · 18 points

    HN discussion
  21. I thought he was saying the `end` in range begin/end was now allowed to be some empty signifier to tell things to look for the null pointer (null is a sentinel, but `end` itself is now empty). That may not be right, I don't know enough about the new concepts stuff and range seems to be part of that. edit: looking at this it maybe covers it: https://foonathan.net/2020/03/iterator-sentinel/

    Comment linking /2020/03/iterator-sentinel/

    on “Writing a custom iterator in modern C++”
  22. Submitted C++20 concepts are structural: What, why, and how to change it? as a story · 5 points

    HN discussion
  23. I believe programmers are still free to define specific operators in lieu of the compiler-derived ones for such cases. I found a blog post which raised similar concerns [0], and P1185 [1] proposes some solutions. I don't know whether they made it into the standard, though. [0]: https://foonathan.net/2018/10/spaceship-proposals/ [1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p118...

    Comment linking /2018/10/spaceship-proposals/

    on “Changes Between C++17 and C++20”
  24. Submitted Malloc() and free() are a bad API as a story · 4 points

    HN discussion
  25. That's what everybody originally believes (me included)! constexpr is_right_answer(int x) { if (x==42) return true; else { std::cout <<"try again \n"; return false; } A function can be constexpr as long as at least one possible invocation can be compile time evaluated. In fact compilers can't generally prove that a function can't be constexpr. I believe constinit has the semantics you want but I've yet to study it i…

    Comment linking /2020/10/constexpr-platform/

    on “Const vs. constexpr vs. consteval vs. constinit in C++20”
  26. Submitted Naming Things: Implementer vs. User Names as a story · 4 points

    HN discussion
  27. Submitted Malloc() and free() are a bad API (2022) as a story · 3 points

    HN discussion
  28. Submitted New integer types I’d like to see as a story · 3 points

    HN discussion
  29. Submitted I accidentally wrote a Turing-complete parsing library as a story · 3 points

    HN discussion
  30. Submitted Operator Precedence Is Broken as a story · 3 points

    HN discussion

Search all of HN for foonathan.net

Linked by the same people?