For the inpatient:
Here is the Jupyter notebook output,
and you can grab the code with
git clone https://www.famsik.de/prime_c++/prime_c++.git
(I had planned to push this to Github (and probably will one day), but on first try, I happened to run into one of their rare outages.)
The ingredients are:
I have liked C++ when I used it. And that use has been extensive. I was the C++ “evangelist” for my department back then.
But it has been a while. (Actually, I did teach an Arduino course to a few ham radio amateur friends recently. While Arduino actually is C++, it’s not on the same level, somehow.)
So I was curious how the language had evolved since I last used it. To sum up the results: I don’t feel it has left me behind further than what a few days of research can make up. And I rather like the modern C++. If you pardon the contradiction: Over the years, the language has become considerably younger.
I also have a long-standing tradition writing prime number generating programs. I have done this in more languages than I care to remember. One can devise simple algorithms that fit into a few lines of code, or performance-optimize these beasts to no end.
Python and Jupyter
I rather enjoy Python. There’s a bit of glue code in Python used to exercise the prime number algorithms, and some more Python code that catches and evaluates performance measurement results. The fabulous Jupyter notebook made it easy to include performance graphics.