Programming Leftovers
-
C++
-
Advent of Code in C++ Template Metaprogramming
This December, the imp of the perverse struck me, and I decided to see how many days of Advent of Code I could do purely in compile-time C++ metaprogramming.
As of this writing, I’ve done two days, and I’m not sure I’ll make it any further. However, that’s one more day than I planned to do as of yesterday, which is in turn further than I thought I’d make it after my first attempt. So we’ll see how it goes.
-
-
Python
-
Use “pip install” safely
Last year I wrote a post about “boring” dependency management in Python, where I advocated a setup based entirely around standard Python packaging tools, in that case the pip package installer and the venv module for creating virtual environments (the only non-standard thing I recommended there was pip-tools, and specifically its pip-compile script, and the only reason I’m willing to recommend it at all is that you can replace it by writing your own script that strings together the equivalent pip commands; it’s just a convenience to save you having to do that yourself).
-
Compile your Python
The most visible difference is that in those other languages, compilation is almost always an explicit step: you invoke a compiler, or press a button in your editor or IDE which will invoke a compiler, to explicitly build your project. But in Python, compilation almost always happens implicitly.
-