/images/p1.jpg

Hi, I'm Tomasz

I'm a professional C++ software engineer with over a decade of hands on development experience with variety of technologies (mostly Linux & embedded systems). This is my blog.

Find me on social media

#1 WebAssembly and C++: Baby steps

This post is part of a WebAssembly series focused on WASM and C++. The goal is to gain a thorough understanding of how WebAssembly works, how to use it as a compilation target for C++ code and hopefully have fun along the way. So, stick with me for this exciting journey. Wherever mentioned, working WASM examples will be embedded directly on the page. If your browser supports it, you should be able to see them running.

Generative AI can code! What are you going to do about it?

I’m sharing my thoughts on generative AI and how it potentially affects lives of software engineers. This one is gonna be a bit different. I hesitated to write this post. This blog is rather small with a narrow scope of topics and I definitely don’t dabble in non-technical writing. I also don’t like to follow the click-baity fad - which is definitely happening around AI now. Recently, approximately 1/3 of hacker news topics is related to AI and ChatGPT in one way or another.

Is 'rope' data structure still any relevant in modern applications?

Ropes are an alternative approach to representing strings within memory but do they still hold any strong hand nowadays and if so, why aren’t they as widely adopted as classical character strings? This is something I’m gonna try to explore using a simple C++ implementation and a couple of benchmarks. What are ropes? Rope represents a string in a tree-like fashion. Leaf nodes store the actual characters, while internal tree nodes store weights (mostly).

How to deal with variadic templates and default function arguments?

I’ve recently started to write my own logging library which I encourage you to check out. It’s called libsl. I’ve decided to use fmt::format for log message formatting and expose the most basic interface for logging messages: 1 2 3 void log(const Logger::Level& level, const std::string& msg, std::source_location sl = std::source_location::current()); The premise here is that the user is responsible for providing a pre-formatted message. Additionally, the log function call collects the source location of where it was called so, this information can be used in the log message as well.

How I fell into a CTAD trap

CTAD (class template argument deduction) is a new c++17 feature that similarly to template functions, allows to automatically deduce class template arguments. It allows to simplify some of the meta programming code, since templates instantiation doesn’t have to be done with explicit types but it comes with a bit of caveats as well. Copying vs wrapping Considering a class template like i.e. 1 2 std::optional<int> x{123}; std::optional y{x}; What should the type of second std::optional be?

New C++23 features I'm excited about

Work on c++23 standardisation is well in progress and we already have a couple of new features to play with. Toolchain support varies but some early testing is already possible. I’ve prepared a list of features that I, personally appreciate a lot and which most definitely will improve my code. Let’s go through them. CppCon overview There’s a set of great CppCon talks regarding new additions coming with c++23. Amongst others, a nice, concise and to the point overview is probably best presented by Marc Gregoire.

Introduction to meson build system

Intro I started using meson exclusively for any new C or C++ project I create. It’s much more convenient and less cumbersome than CMake. In this post, I’ll try to give a short introduction to meson and the reasons I like it. My typical meson project layout My projects usually contain small libraries with a set of tests or executables relying on a bunch of libraries. For the purpose of presentation, I’ll start with a demo project, let’s call it libmagick.