Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: std Clear Filter

Adjacency Matrix and std:mdspan, C++23

In graph theory, an adjacency matrix is a square matrix used to represent a finite (and usually dense) graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not, and in weighted graphs, they store the edge weights. In many beginner-level tutorials, adjacency matrices are implemented using vector of vectors (nested dynamic arrays), but this approach has inefficiencies due to multiple memory allocations. C++23 introduces std::mdspan , which provides a more efficient

C++20 Modules: Practical Insights, Status and TODOs

The post was written in Chinese and translated by LLM. Feel free to contact me if any phrasing seems unnatural. 25-08-22 update for Modules Wrapper,[One big thirdparty module], [suggested filename suffix], [mix include and import] C++20 Modules are beneficial for improving code modularity, enhancing program encapsulation, boosting compilation speed, and reducing the size of library code. Consequently, C++20 Modules have been highly anticipated since their inception. However, it is unsatisfacto

Show HN: C++ library for reading MacBook lid angle sensor data

MacBook Lid Angle Sensor C++ Library A C++ library for reading MacBook lid angle sensor data, based on reverse engineering of HID device specifications. Features 🔍 Direct access to MacBook's built-in lid angle sensor 📏 Real-time precise angle measurements (0-360 degree range) ⚡ High-performance C++ implementation with modern C++14 standard support 🛡️ Comprehensive exception handling mechanism 🔧 Clean and easy-to-use API interface 📦 CMake build system support Device Compatibility Suppor

Anonymous structavaganza in Zig

Mon Aug 25 2025 When statements disappear, what remains of good semantics? Let’s see what side effects have been introduced! To start, observe this truly primordial ‘C code; struct A {}; struct B {}; void example ( struct A e ); int main (){ example (( struct B){}); } clang output: error: passing 'struct B' to parameter of incompatible type 'struct A' example((struct B ){}); ^~~~~~~~~~~~ THE TYPES ARE UNIQUE. THEY HAVE DIFFERENT NAMES! THE ARE NOMINALLY DIFFERENT. And such it is for all

In-Memory Filesystems in Rust

In-memory Filesystems in Rust I’ve been working on a CLI tool recently, and one of the things it does is manage files on disk. I have written a lot of file management tests for Bundler, and the two biggest reasons that the Bundler test suite is slow are exec and fstat . Knowing that, I thought I would try to get out ahead of the slow file stat problem by using an in-memory filesystem for testing. A collaborator mentioned being happy with the Go package named Afero for this purpose, and so I se

Stepanov's biggest blunder? The curious case of adjacent difference

The curious case of adjacent difference If you have ever tried using the std::adjacent_difference algorithm in c++, I’m sure it left you puzzled. As the name suggests, this algorithm computes differences between adjacent elements of the input sequence, but it does one more thing: it copies the first element of the input sequence into the output sequence unmodified. The following example demonstrates how to apply the algorithm to delta-compress a postings list of document identifiers that contain

Ergonomic errors in Rust: write fast, debug with ease, handle precisely

Ergonomic errors in Rust: write fast, debug with ease, handle precisely Errors show up in three distinct contexts: when you’re writing code, when you’re debugging code, and at runtime when the program needs to handle recoverable errors. And errors are consumed by two distinct consumers with different needs: the developer debugging an application, and the caller making error handling decisions at runtime. In this post, we’ll explore how stackerror is designed to make working in all three contex

I'm too dumb for Zig's new IO interface

I'm too dumb for Zig's new IO interface You might have heard that Zig 0.15 introduces a new IO interface, with the focus for this release being the new std.Io.Reader and std.Io.Writer types. The old "interfaces" had problems. Like this performance issue that I opened. And it relied on a mix of types, which always confused me, and a lot of anytype - which is generally great, but a poor foundation to build an interface on. I've been slowly upgrading my libraries, and I ran into changes to the tl

The Maker of Ozempic Is in Such Deep Trouble That It’s Going on Hiring Lockdown

Image by Sergei Gapon / AFP via Getty / Futurism Rx/Medicines Novo Nordisk, the Denmark-based pharmaceutical company that makes Ozempic and Wegovy, looks like it's being toppled off its GLP-1 throne. In a statement to Reuters, the Danish conglomerate admitted that it "currently [has] a hiring freeze in non-business critical areas." Though Novo offered no additional explanation, the writing has been on the wall for months that the once-dominant drug manufacturer is in big financial trouble. D

SIMD Binary Heap Operations

SIMD binary heap operations Author: Wojciech Muła Added on: 2025-01-18 Introduction Binary heap is a binary tree data structure having some interesting properties. One of them is an array-friendly memory layout, achieved by building (almost) complete binary tree. A binary heap keeps at index 0 the maximum value, or the minimum one depending on convention — let's stick to maximum heaps. There is exactly one invariant: a child node, if exist, keep a value less than the parent node. For compariso

Under the Hood of AFD.sys Part 1: Investigating Undocumented Interfaces

A quick look at how I used WinDbg and NtCreateFile to craft a raw TCP socket via AFD.sys on Windows 11, completely skipping Winsock. Under the Hood of AFD.sys Part 1: Investigating Undocumented Interfaces Introduction This is the first post in a series about my deep-dive into the AFD.sys driver on Windows 11. The idea is that both this write-up and the library that comes out of it will be a one-stop doc set - and a launchpad - for poking at other drivers that don’t ship with an official spec.

Topics: 00 0x00 afd socket std

C++26 Reflections adventures and compile-time UML

The first thing I do every time I need to learn a new codebase is to start drawing the UML diagram of its classes, and usually give up soon after I started. The process of doing it manually is certainly useful, but now with reflections I figure it would be fun to try generate it instead. With C++26 reflections[1] the general consensus is that the magnitude of language change is comparable to what happened with C++11. After my little experiment with it, I would cautiously agree. So how does one

Topics: info int meta std string

QuestDB (YC S20) Is Hiring a Technical Content Lead

About QuestDB As a specialized database, QuestDB stores, processes and analyzes time series data in real-time, with a focus on reliability, extreme performance and simplicity. It provides best-in-class hardware efficiency and robust features, saving costs and accelerating time-to-value. Our open source repository has gathered 16k stars and QuestDB is the fastest growing database in the time-series category, according to DB-Engines . We are a product-first company with a large community of

Stdio(3) change: FILE is now opaque

Contributed by rueda on 2025-07-17 from the more-opacity,-igor dept. In -current , the struct underlying stdio(3) 's FILE type has been made opaque, with library versions bumps across the board: CVSROOT: /cvs Module name: src Changes by: [email protected] 2025/07/16 09:33:05 Modified files: lib/libc : Symbols.list shlib_version lib/libc/hidden: stdio.h wchar.h lib/libc/stdio : Makefile.inc fclose.3 fclose.c findfp.c lib/libcrypto : shlib_version lib/libcurses : shlib_version lib/libedit

Stdio(3) change: FILE is now opaque (OpenBSD)

Contributed by rueda on 2025-07-17 from the more-opacity,-igor dept. In -current , the struct underlying stdio(3) 's FILE type has been made opaque, with library versions bumps across the board: CVSROOT: /cvs Module name: src Changes by: [email protected] 2025/07/16 09:33:05 Modified files: lib/libc : Symbols.list shlib_version lib/libc/hidden: stdio.h wchar.h lib/libc/stdio : Makefile.inc fclose.3 fclose.c findfp.c lib/libcrypto : shlib_version lib/libcurses : shlib_version lib/libedit

Zig's New Writer

Zig's new Writer As you might have heard, Zig's Io namespace is being reworked. Eventually, this will mean the re-introduction of async. As a first step though, the Writer and Reader interfaces and some of the related code have been revamped. This post is written based on a mid-July 2025 development release of Zig. It doesn't apply to Zig 0.14.x (or any previous version) and is likely to be outdated as more of the Io namespace is reworked. Not long ago, I wrote a blog post which tried to expl

Topics: drain file io std writer

cppyy: Automatic Python-C++ Bindings

cppyy: Automatic Python-C++ bindings cppyy is an automatic, run-time, Python-C++ bindings generator, for calling C++ from Python and Python from C++. Run-time generation enables detailed specialization for higher performance, lazy loading for reduced memory use in large scale projects, Python-side cross-inheritance and callbacks for working with C++ frameworks, run-time template instantiation, automatic object downcasting, exception mapping, and interactive exploration of C++ libraries. cppyy

C++ Coroutines Advanced: Converting std:future to asio:awaitable

July 15, 2025 · 696 words · 4 min In modern C++ development, coroutines have brought revolutionary changes to asynchronous programming. However, when using boost::asio or standalone asio, we often encounter scenarios where we need to convert traditional std::future<T> to asio::awaitable<T> . This article will detail an efficient, thread-safe conversion method. Problem Background When using asio coroutines, we often encounter scenarios like: Need to call third-party libraries that return std:

Jank is C++

jank is C++ If you've wondered how much a solo dev can build for seamless C++ interop on a quarter, you're about to find out. In April, jank was unable to reach into C++ at all. Toward the end of this post, I'll show some real world examples of what works today. Before that, though, I want to say thank you for the sponsorship this quarter, not only by all of my individual Github sponsors, but also by Clojurists Together. I also want to say thank you to Vassil Vassilev and Lang Hames for buildin

Topics: cpp ftxui jank std type

Show HN: BinaryRPC – Lightweight WebSocket-based RPC framework in modern C++

BinaryRPC 🧭 Motivation While working at my company, I had previously developed a WebSocket server prototype in Java. However, over time, we started to experience performance issues. This led me to turn to C++, a language that offers more speed and low-level system control. Through my research, I discovered that uWebSockets was one of the best options in terms of performance, so I began developing with this library. However, since uWebSockets is a very "core" library, I had to handle many deta

jank is C++

jank is C++ If you've wondered how much a solo dev can build for seamless C++ interop on a quarter, you're about to find out. In April, jank was unable to reach into C++ at all. Toward the end of this post, I'll show some real world examples of what works today. Before that, though, I want to say thank you for the sponsorship this quarter, not only by all of my individual Github sponsors, but also by Clojurists Together. I also want to say thank you to Vassil Vassilev and Lang Hames for buildin

Topics: cpp ftxui jank std type

jank Is C++

jank is C++ If you've wondered how much a solo dev can build for seamless C++ interop on a quarter, you're about to find out. In April, jank was unable to reach into C++ at all. Toward the end of this post, I'll show some real world examples of what works today. Before that, though, I want to say thank you for the sponsorship this quarter, not only by all of my individual Github sponsors, but also by Clojurists Together. I also want to say thank you to Vassil Vassilev and Lang Hames for buildin

Topics: cpp ftxui jank std type

Features of D That I Love

10 features of D that I love This is a beginner-friendly post exploring some of my favourite parts of the D programming language, ranging from smaller quality of life stuff, to more major features. I won’t talk much about D’s metaprogramming in this post as that topic basically requires its own dedicated feature list, but I still want to mention that D’s metaprogramming is world class - allowing a level of flexibility & modelling power that few statically compiled languages are able to rival.

Math.Pow(-1, 2) == -1 in Windows 11 Insider build

Description The following is copied with extra bits from https://aka.ms/AAwwjwl (Feedback Hub) to raise awareness of this issue: Hello, I'm a contributor to osu! (https://github.com/ppy/osu). A user reported a really weird problem with our game that only happens in the current version of Canary (27881.1000) in ppy/osu#33948. I've narrowed it down to ppy/osu#33948 (comment), which is Math.Pow(-1, 2) returning -1 instead of 1 for some odd reason. Used VSCode for C# installation of .NET 8 (what

Topics: https osu pow ppy std

C++ Seeding Surprises (2015)

Properly seeding random number generators doesn't always get the attention it deserves. Quite often, people do a terrible job, supplying low-quality seed data (such as the system time or process id) or combining multiple poor sources in a half-baked way. C++11 provides std::seed_seq as a way to encourage the use of better seeds, but if you haven't thought about what's really going on when you use it, you may be in for a few surprises. In contrast to C++11, some languages, such as popular script

Topics: 32 bit seed seed_seq std

CUDA Ray Tracing 2x Faster Than RTX: My CUDA Ray Tracing Journey

Welcome! This article is a deep dive into how I made a CUDA-based ray tracer that outperforms a Vulkan/RTX implementation—sometimes by more than 3x—on the same hardware. If you're interested in GPU programming, performance optimization, or just want to see how far you can push a path tracer, you're in the right place. The comparison is with RayTracingInVulkan by GPSnoopy, a well-known Vulkan/RTX renderer. My goal wasn't just to port Ray Tracing in One Weekend to CUDA, but to squeeze every last

Topics: cuda float memory ray std

String Interpolation in C++ Using Glaze Stencil/Mustache

Glaze provides string interpolation for C++ structs through the stencil and mustache formats. These provide templating mechanisms for formatting structured data into strings, inspired by the Mustache templating language. This enables the generation of dynamic output by combining predefined templates with C++ structs. Basic Usage¶ struct person { std :: string first_name {}; std :: string last_name {}; uint32_t age {}; bool hungry {}; bool employed {}; }; // Basic interpolation std :: string_vi

Type-based vs. Value-based Reflection

Type-based vs Value-based Reflection Frequently, whenever the topic of Reflection comes up, I see a lot of complains specifically about the new syntax being added to support Reflection in C++26. I’ve always thought of that as being largely driven by unfamiliarity — this syntax is new, unfamiliar, and thus bad. I thought I’d take a different tactic in this post: let’s take a problem that can only be solved with Reflection and compare what the solution would look like between: the C++26 value-ba