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
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?
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.
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.
Functional parsing and parser combinators Recently, on my routine round through YouTube and social media, I’ve came across a video from Ashley Jeffs regarding a message broker he’s the author of called Benthos. Benthos itself is very interesting and I recommend to learn more about it, but what especially caught my interest was a different video from Ashley, regarding bloblang - a configuration language for Benthos written using parser combinators. Frankly, this was the first time I’ve heard that term and, intriguing as it sounds, I wanted to learn all about it.