Daniel Lemire's blog

, 7 min read

Science and Technology links (September 1st, 2018)

6 thoughts on “Science and Technology links (September 1st, 2018)”

  1. Jorm says:

    Regarding the C++ point, what are your thoughts on Rust?

  2. Marco says:

    The Torvalds comment you quote is from 2007. Do any of the developments in C++ since then change the picture? For better or for worse?

    1. Travis Downs says:

      In my opinion C++ is much improved with the addition of C++11, C++14, and C++17. After a long period of stagnation and endless standard revisions leading up to C++11, many important things have finally been added and a predictable three-year pace seems to have been adopted. Things that aren’t ready (c.f., concepts) just get moved out of the revision, rather than delaying it.

      The new features make it possible to write in a portable way things that weren’t possible before, often without sacrificing performance, and allow people to stay within the sphere of operations that are provably (or at least probably) safe more of the time (i.e., reducing raw pointer, usage, etc).

      That is said, all of these revisions came with an considerable increase in complexity. New concepts and syntax were added. I was what I would consider an expert C++ programmer prior to C+11, but had not used the language for a while, and fairly recently came back: I was happy with the new additions, but the learning curve was steep, even for someone who was already familiar with the fundamentals. Maybe, it is even harder for someone who was familiar with old C++, since in principle the way to reduce the incredible complexity of C++ is to only learn the “new stuff” or “the good stuff” – the idiomatic ways of doing things using the best available features today, rather than trying to learn everything the language has to offer, much of which is there mostly for backwards compatibility.

      So if your view is that the primary problem with C++ is the complexity, then revisions since 2007 have made that problem worse. People using C++ today, however, are probably doing it because there were few alternatives with much traction as a “more powerful C” – they have already accepted this complexity and probably welcome the improvements. Adding more complexity won’t suddenly tip the balance in favor of another language, since the basic tradeoffs that C++ offers are still the same.

      I see Rust as very promising, and I suspect it is the leading candidate to finally supplant C++ in its primary niche of “zero abstraction cost compiled, non-GC language”. It takes the next step towards safety in many respects: as C++ improved on C by allowing the use of constructs that were safe as long as you used them and followed the rules, Rust effectively requires you to use them, and enforces it at compile time (and is built around it: offers more tools when interacting with the proof-checking part of the compiler). This will lead to safer software.

  3. Christopher Chang says:

    My current preferred approach is to restrict my use of C++ to stuff that has a straightforward (if less performant) C99 fallback that goes in the #else branch of an #ifdef __cplusplus (or #if __cplusplus > 201103L, etc.) block. This is kind of artificial, since the C99-compiled builds are never used outside of automated testing, but I’ve found it to be a good way to balance access to genuine advantages of C++ over C with staying focused on problem-complexity instead of language-complexity. I feel that the things I still miss out on are more than compensated for by the number of irrelevant decisions I no longer have to make and the classes of locally-invisible side-effects I no longer have to worry about.

  4. Stephen says:

    On the Intel / AMD market share figures, this is retail CPU purchases for a retailer in Germany.

  5. Victor says:

    My impression is that many people, being overweight, try to exercise
    more… without necessarily losing weight.
    I would say that the key word is “try to”. Overweight people tend to try a lot of diets, exercises and sports. The problem is, in my opinion, the lack of consistency. I was fat myself for most part of my life and in my family and environment I met a lot of overweight people. The problem was that everyone was looking for easy or simple methods for losing weight.

    Then I realized the problem was that I, and others, were doing all those things for a short period of time. And not enjoying the process or the exercise we were engaging in. So, after a small success (losing a few kg), we started failing. One day I didn’t do the exercises, but I though that “I am on track already, so it’s ok”. Then it was a second, third time… And before I realized, I was not exercising and going back to the habits that made me fat again.

    And I see the same pattern in almost anyone who is overweight and is struggling with it for a long time without improvement. I guess it’s because is difficult to build the routine and to feel the need of doing sport. Because otherwise no matter how many things you try, if you don’t do it regularly.