/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

golang's defer in C (kind of)

Quite often I find myself landing on gcc’s attributes documentation page. Not sure how that happens but this is always a gold mine. I’ve recently discovered __attribute__((cleanup(func))), which allows attaching functions to variables. These functions are executed when the variable goes out of scope. Sounds familiar?

Nix is to C++ what uv/poetry is to Python

The topic of dependencies management is coming back and again. nix and nixpkgs being a rich repository, provides a convenient way to manage both project dependencies and related tooling in a reproducible way. This is something I’m finding more and more useful as a fundamental development tool. nix is quite complex and some exploration is needed to wrap your head around it. In this post, I’m going through most basic use cases as well as describe some basics of nix language itself - mainly for my own reference but hopefully useful to others as well.

Using lua as configuration parser

The more opportunity I have to work with lua, the bigger fan of it I become. It’s a great, well designed language which is very easy to embed.

I’ve been recently working on a small utility for myself. There’s always a problem of handling configuration in such projects. Usually, I’m going for a simple json or yaml or toml file which acts purely as key-value store but this time around I wanted to try something different.