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
Here’s a quick overview of my repo setup for any new C++ projects that I create. I’m gonna start with an empty repo and bring it up to an initial stage where all my preferred tooling is available and ready.
Empty repo scaffolding Here’s the link to the repo, if you’re not interested in the walk through.
Build system Starting with an empty git repo, first thing I like to do is just to create main.
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.
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.
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.
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).
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.
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?