Programming Leftovers
-
Domain-Specific Error Macros
When I write custom errors in a project, I also like to write a few small error macros to accompany them. In my opinion this can make error handling just a little nicer to use. In this post I briefly want to talk about domain-specific error macros such as ensure!, what they're useful for, and the io-ensure prototype crate I've written which I'm propose for inclusion in the stdlib next time I get the chance.
-
Why We Need to Know LR and Recursive Descent Parsing Techniques
A couple of people have asked me for my thoughts on part an article from Tiark Rompf called (roughly) "Just Write the Parser" which advocates the use of recursive descent parsing over more "formal" approaches to parsing, at least in the context of teaching compilers. I'm fairly sure I read this article a couple of years ago, but it may have been updated, or simply have been discovered anew. Either way, since I admire both Tiark and his work a great deal, it was useful for me to engage with his ideas and compare them to my own.
In this post, I'm going to summarise Tiark's argument as I see it, and try to explain where I agree and disagree with that summary. I will inevitably rehash many of the arguments from my 2020 "Which Parsing Approach?" post, but I'm going to try to focus on some factors which I now realise were at best buried, and at worst inadequately explained, in that previous post.
-
C++ vs Rust: which is faster?
I ported some Advent of Code solutions from C/C++ to Rust, and used the opportunity to compare performance. When I couldn't explain why they performed differently, I had no choice but to disassemble both and look at what the codegen was like!
-
Trading Functionality For Time
Software development projects contain a lot of tradeoffs, where we exchange one thing for another. Some of these are not obvious; this is one of those.
-
Type Checking If Expressions
To make a language that fits in your head (or at least my head, whose working space seems to get smaller every year), I needed to jettison as many feature as I could. My experience across a range of hobby and not-so-hobby languages is that static types add roughly an order of magnitude of complexity, so types were one of the first things to go. Like most scripting languages, I made mine dynamically typed.
-
Things they didn’t teach you about Software Engineering
Domain knowledge is more important than your coding skills
-
[Old] How setting the TZ environment variable avoids thousands of system calls
To avoid extra system calls on server processes where you won’t be updating the timezone (or can restart processes when you do) simply set the TZ environment variable to :/etc/localtime (or some other timezone file of your choice) for a process. This will cause glibc to avoid making extra (and unnecessary) system calls.
To understand why this is and how to test if your processes can benefit, read on!
-
Arnaud Rebillout: Build container images in GitLab CI (iptables-legacy at the rescue)
It's 2023 and these days, building a container image in a CI pipeline should be straightforward. So let's try.
For this blog post we'll focus on GitLab SaaS only, that is, gitlab.com, as it's what I use for work and for personal projects.
-
Adding Linux BlueZ DBus peripheral role support
Broadly speaking the Qt’s Bluetooth Low Energy (“BT LE") support consists of two complementing use cases: the central/client and the peripheral/server roles. For more details about the two roles please consult the Qt Bluetooth documentation.
-
C++ Is The Programming Language of the Year 2022
C++ has been awarded the Programming Language of the Year 2022 title by Tiobe, a leading Quality Assurance service provider. C++ won the award because it has the fastest growth among the top 20 languages. We at Qt welcome this selection as it confirms our long-term commitment to C++ as the underlying programming language for the Qt framework and Qt development platform.
-
Qt for MCUs 2.3.1 Released
Qt for MCUs 2.3.1 has been released and is available for download. As a patch release, Qt for MCUs 2.3.1 provides bug fixes and other improvements, and maintains source compatibility with Qt for MCUs 2.3.x. It does not add any new functionality.