Hacker News with Generative AI: C++

Understanding Memory Management, Part 4: Rust Ownership and Borrowing (educatedguesswork.org)
This is the fourth post in my planned multipart series on memory management. Part I covers the basics of memory allocation and how it works in C, and parts II and III covered the basics of C++ memory management, including RAII and smart pointers.
How to Secure Existing C and C++ Software Without Memory Safety [pdf] (arxiv.org)
The most important security benefit of software memory safety is easy to state: for C and C++ software, attackers can exploit most bugs and vulnerabilities to gain full, unfettered control of software behavior, whereas this is not true for most bugs in memory-safe software.
Taming the UB Monsters in C++ (herbsutter.com)
The C++ community broadly has a lot of hardening work well underway.
Msgpack23 – A modern, header-only C++ library for MessagePack (de)serialization (github.com/rwindegger)
msgpack23 is a lightweight library that provides a straightforward approach to serializing and deserializing C++ data structures into the MessagePack format.
C and C++ prioritize performance over correctness (2023) (swtch.com)
The original ANSI C standard, C89, introduced the concept of “undefined behavior,” which was used both to describe the effect of outright bugs like accessing memory in a freed object and also to capture the fact that existing implementations differed about handling certain aspects of the language, including use of uninitialized values, signed integer overflow, and null pointer handling.
Show HN: Hexi – Modern header-only network binary serialisation for C++ (github.com/EmberEmu)
Hexi is a lightweight, header-only C++23 library for safely handling binary data from arbitrary sources (but primarily network data). It sits somewhere between manually memcpying bytes from network buffers and full-blown serialisation libraries.
My Favorite C++ Pattern: X Macros (2023) (danilafe.com)
When I first joined the Chapel team, one pattern used in its C++-based compiler made a strong impression on me.
Building Node.js on Windows with Clang-cl (joyeecheung.github.io)
Recently Node.js started to support building with clang-cl on Windows.
Writing your own C++ standard library from scratch (blogspot.com)
The C++ standard library (also know as the STL) is, without a doubt, an astounding piece of work. Its scope, performance and incredible backwards compatibility have taken decades of work by many of the world's best programmers. My hat's off to all those people who have contributed to it.
Shift-to-Middle Array: A Faster Alternative to Std:Deque? (github.com/attilatorda)
The Shift-To-Middle Array is a dynamic array designed to optimize insertions and deletions at both ends, offering a high-performance alternative to std::deque, std::vector, and linked lists.
Reversing C++ Virtual Functions (alschwalm.com)
There are a few posts in various parts of the internet discussing reverse engineering C++, and these often address virtual functions to a large or small extent. However, I wanted to take some time to write about dealing with virtual functions in large, ‘enterprisy’ code-bases.
High-Performance PNG Decoding (blend2d.com)
It's been some time I have written about a High-Performance QOI Codec, which joined other codecs offered by Blend2D library in 2024. The development of image codecs continued and now I would like to announce a new high-performance PNG codec, which is much faster than other available codecs written in C, C++, and other programming languages.
C++26 Expansion Tricks (pydong.org)
P1306 gives us compile time repetition of a statement for each element of a range - what if we instead want the elements as a pack without introducing a new function scope?
C++26 Expansion Tricks (pydong.org)
P1306 gives us compile time repetition of a statement for each element of a range - what if we instead want the elements as a pack without introducing a new function scope?
TLS Handshake on Sockets (C++) (medium.com)
There are numerous articles on the internet about the TLS handshake algorithm. However, many of them only provide a superficial description. In this article, we will explore a C++ implementation of a specific cipher. This source code relies solely on sockets for networking and utilizes the OpenSSL library exclusively for encryption (RSA, AES, SHA).
C++26: Deprecating or removing library features (sandordargo.com)
In the previous article, we discussed what language features are removed from C++26. In this one, we are going to cover both language features that are finally removed after a few years of deprecation, and also those that are getting deprecated by C++26.
ALP Rust is faster than C++ (spiraldb.com)
A recent HackerNews post titled Zlib-rs is faster than C was discussed in the usual way that HackerNews posts are, with one highly upvoted comment asking:
Speeding up C++ code with template lambdas (lemire.me)
Let us consider a simple C++ function which divides all values in a range of integers:
Show HN: Cppmatch – Rust-Like Pattern Matching and Error Handling for C++ (github.com/Rucadi)
A lightweight header-only Clang/GCC compatible C++ library for expressive pattern matching and error handling.
Speeding up C++ code with template lambdas (lemire.me)
Let us consider a simple C++ function which divides all values in a range of integers:
I Recreated Photoshop in C++ (f055.net)
As I’m getting older I look back on all the things I’ve done as a creative developer, and I see so many cool projects! But I never wrote down any development stories, and most of these projects, even as successful when released, got lost in time as years go by. That’s why I’m starting my new posts series „That time I” where I look back on my most interesting projects.
A Guide to Undefined Behavior in C and C++ (2010) (regehr.org)
Programming languages typically make a distinction between normal program actions and erroneous actions. For Turing-complete languages we cannot reliably decide offline whether a program has the potential to execute an error; we have to just run it and see.
Show HN: VSC – An open source 3D Rendering Engine in C++ (github.com/WW92030-STORAGE)
"VSC (VOUGA-SHREINER-CANTH) Verified is A real-time 3D rendering engine written entirely using software with the intention of being portable."
Understanding Memory Management, Part 3: C++ Smart Pointers (educatedguesswork.org)
This is the third post in my planned multipart series on memory management. In part I we covered the basics of memory allocation and how it works in C, and in part II we covered the basics of C++ memory management, including the RAII idiom for memory management. In this post, we'll be looking at a powerful technique called "smart pointers" that lets you use RAII-style idioms but for pointers rather than objects.
How std::any Works (fluentcpp.com)
In the previous post we’ve seen a very nice technique to use value semantics with inheritance and virtual methods, which was made possible by std::any.
C++ creator calls for help to defend programming language from 'serious attacks' (theregister.com)
Bjarne Stroustrup, creator of C++, has issued a call for the C++ community to defend the programming language, which has been shunned by cybersecurity agencies and technical experts in recent years for its memory safety shortcomings.
Compiling C++ with the Clang API (maskray.me)
This post describes how to compile a single C++ source file to an object file with the Clang API.
Understanding Memory Management, Part 2: C++ and RAII (educatedguesswork.org)
This is the second post in my planned multipart[1] series on memory management. In part I we covered the basics of memory allocation and how it works in C, where the programmer is responsible for manually allocating and freeing memory. In this post, we'll start looking at memory management in C++, which provides a number of much fancier affordances.
Improving on std:count_if()'s auto-vectorization (nicula.xyz)
Investigating an argument-dependent lookup issue and working around it (microsoft.com)
C++/WinRT pull request 1225 fixed a problem with a call to invoke. What’s the problem, why did it show up all of a sudden, and what can you do if you are stuck on an older version of C++/WinRT?