101 karma · joined Jul 22, 2009 (17y ago) · 44 submissions
comment 5y ago · link · parent
Yes, our federal government absolutely failed when it comes to vaccine supply. It is our state governments that have instituted lockdowns, because of this failure on behalf of the federal government, to squash cases and stop our hospital system from reaching breaking point.
Yes, our federal government screwed up, and I don't know anyone who doesn't agree with that point, but given that, and given the outcomes America experienced before vaccination was prevalent, it is the height of hubris and arrogance to suggest that you and the rest of the Western world (this "data" being pulled from where, exactly?) is "horrified at us".
comment 5y ago · link · parent
But please, continue looking on in horror at us from (I'm assuming) America. Your post is a wonderful mix of condescending tone and factual inaccuracy, with the added cherry-on-top that you have absolutely moronic states like Florida "fighting for their freedoms" by banning mask mandates. This would be infuriating if it wasn't so painfully stupid.
comment 5y ago · link · parent
Yes, it only applies if you don't make any API (and ABI) changes, but that's what major, minor, patch versioning is for, and stable projects can go a long way on minor and patch versions...
comment 6y ago · link · parent
Honestly, sorted vectors can often be a good replacement, depending on the workload, if you must have ordered data (this is what boost flat_map uses). All 3 (map, unordered_map, sorted vector) can have their uses, depending on what you are doing with the data.
If you need a better performing hash map, there's always Abseil as well.
comment 7y ago · link · parent
Anyway, anecdotal story, take with (many) grains of salt.
comment 7y ago · link · parent
Writing it yourself for the first time, or just copying some code off the internet, is going to have a vanishingly small chance of being actually secure.
comment 7y ago · link · parent
comment 8y ago · link · parent
That's already an extremely niche set of processors. Further, the number of bits of code you're likely to care about this kind of extremely precise timing for, you'll either examine the emitted assembly, or just hand-write the ASM yourself.
It seems like a huge amount of effort for an extremely niche scenario. Remember, the ISA is still just an abstraction, after all.
comment 8y ago · link · parent
Intrinsics are directly callable from C++.
> likely/unlikely branches
Most compilers have extensions that will allow you to do this (__builtin_expect and so on).
> in-lining can't be forced when you know it gives better performance
Again, most compilers have this, not just GCC, e.g. __forceinline.
> the compiler has a lot of trouble knowing when lines of code are independent and can be done in parallel (b/c const =/= immutable)
This is true, as aliasing is a real issue. The hardware itself has some say over this anyway, dependent on its instruction scheduling and OOE capabilities.
What you don't mention, however, is the fact that almost no other languages offer any of these, let alone all of them. Rust may be the exception here, although some of this is still in the words (SIMD, I'm not sure about the status of likely/unlikely intrinsics).
For GPU programming, if you're using CUDA, you're almost certainly using C or C++, or calling something that wraps C/C++ code. Not everything is suited to GPU processing anyway, there's still a lot of code that's not moving off the CPU any time soon that needs to be performant.
comment 8y ago · link · parent
The first can be a legitimate complaint, although I find it's rarely an issue in practice.
comment 13y ago · link · parent
1) Stack allocation 2) std::unique_ptr 3) std::shared_ptr
You should be properly thinking about onwership semantics, and unique_ptr should be the default, not shared_ptr.
comment 13y ago · link · parent
To me, it just seems ugly. I like a type system where I know what a type is at each point, and there isn't some ugly "catch all" type that you can use when you run out of other options, which effectively just throws away all type information (and this is what interface{} does, as everything implements it).
comment 13y ago · link · parent
I'm not sure what it's like in Sydney or Melbourne, however. Perhaps it's better there...
comment 13y ago · link · parent
Frequent usage is more difficult, though. I'd like to think I know C++, Java, C and Python all very well, SQL to a reasonable level. However, add the "dabbling" languages: Racket, Haskell, Scala, C#...where exactly would the time for using these frequently come from?
Arguably, languages are only important to an extent - libraries surrounding languages are the truly important part.