Details
-
AboutAngry, opinionated. (js stinks). Touched almost everything CS. Master of none. Always on the learn.
Joined devRant on 11/9/2020
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
And that is why, despite other languages doing a good job so far, everything performance critical will still be done in C/C++.
-
@Demolishun
"struct" in C++ is just syntactic sugar for "public class" with default public accessibility. There's no functional difference, and of course, no runtime penalty either from
struct A { int i; };
To
public class A {
public:
int i;
};
They are the same and compile to the same.
Zero cost abstractions are what they are.
For example, smart pointers. An abstraction for reference counted pointers, which could be used for say, garbage collection.
In C#, java, or JS, you pay for this always. Every reference is reference counted and thus you pay the price, even if seemingly negligible.
C++ doesn't impose this penalty. You have smart pointers. You don't want to use them? Fine. They will cost you no runtime performance.
Yes, you will be on your own and might have memory leaks, but believe me, when you have to deal with very hot loops with allocations, those negligible penalties, will amount to non negligible penalties. -
@Lensflare
Well, I don't use cancer 11, still 10, might have something to do.
When I type for search, I do get bing results, but that's it. -
Also I don't even know what they are talking about. My start menu doesn't have ads...
-
@12bitfloat
Well, that's not really the definition, at least the way the c++ committee enforces them.
By their own admission, it means that anything that gets added to the language (and everything at this point is abstractions really) must not impose runtime penalties on compatible code from previous versions if you are not *using* said abstractions, without need to configure or change anything in the code. -
@12bitfloat
Thing is, RVO and move semantics are zero cost abstractions in that sense.
The whole point of a zero cost abstraction is don't pay for it if you ain't using it.
That's why forced bounds checking, and similar runtime stuff is not a zero cost abstraction (you pay for it even if you don't need it).
move semantics, if you use them explicitly, and wrongly, will cost you performance, but they don't otherwise impose a runtime cost if not used, or if you let the compiler do its magic. -
Mac os. Beautiful. Content dismissed, next!
-
@bosslogic
By all means, if you wanna learn the math, do so, but it's usually enough knowing the main properties of activation functions and the tradeoffs of having more or less layers.
Common ML frameworks will hide the math from you. -
@12bitfloat
It has to copy if you create a const string inside the function body and then you return it.
Having const as return type and returning an auto non const object won't invalidate RVO.
Problem is, again, people not understanding the mechanism and just sprinkling const everywhere because they read it in some trend blog, just like sprinkling std::move around. -
@retoor
The use case is really making sure you get a rvalue reference to whatever you will be requesting to move (really std::move should have been called std::rvalue_ref_cast), because you intend to pass it to (possibly external) other code that might optimize based on copy or move semantics.
However, except very few and far corner cases, good library implementors will either
- explicitly delete copy or move semantics where they don't make sense, resulting in an error if you try to use them.
- just take a const lvalue reference, and let compiler do its magic (99% of the time better than what you intend to do)
- do perfect forwarding if it's just forwarding to other code, delegating to problem to the callee.
Only in the second case, if for whatever reason a const T& would violate const correctness and you'd need to take a T& or T&& explicitly, would a manual std::move make sense.
I have seen it only once in app (as in, not library) code. -
Also, while not really being an example of zero cost abstractions, I love that c++'s *runtime* safety is opt-in.
Shit like iterator/range checking is done by pretty much all major c++ runtimes... When using their debug version.
Not a fan of paying for that shit in release mode. -
@lorentz
C++ does have "third party" implementations, in the sense that the committee only defines the language, it doesn't implement anything. And oh boy shit will happen if you try and mix different g++, msvc++ and clang.
However I think the "competition" results in better implementations.
@12bitfloat
Compilers nowadays are smart enough to prevent those footguns, since it's easy to statically determine when something acts as a rvalue, and will always perform RVO when possible even if you do retarded shit.
std::move is just a lexicographically fancy static_cast<T&&>(), which doesn't really have any implications for auto variables.
The problem, as always, is people wanting to write fancy code and not knowing what they are doing.
Cppreference explicitly states that manually using std::move is, 99% of the time, a mistake, and hence compilers try to protect you from it. -
@retoor
Comment said German and metal.
Billie eilish didn't qualify for either. -
@Demolishun
I'm not German, and I have them...
Edguy, Avantasia, Rammstein, Helloween, Gamma Ray, Masterplan, Doro, Warlock, Rage, Freedom Call... -
There was this c++ lib I used way more than 10 years ago named rocket which essentially let you use a subset of html and css to build UIs.
You can do it easily nowadays with chromium embedded framework and off screen buffers.
Most game engines already use CEF in some capacity. -
@retoor
Nah, it's not that I care about judgment. It's just that if I start with beers at 9 am, by now I'd be terribly wasted XD.
Which wouldn't be a good thing since we lost power right now for the third time! -
@retoor
That includes party too, but beer at 9 am seemed early even for me.
Still, that includes having some food, being able to use my laptop, play the guitar, or whatever.
The kitchen stove is electrical, the water heater is electrical, the heating is electrical (and we're below zero), so staying home ain't an option.
It seemed to affect all the blocks of the right bank of the river. On the second one I actually heard a loud bang so I hope it ain't anything serious. -
@D-4got10-01
Just gonna say it now.
Google translate ain't so good at Japanese as people think.
It only covers textbook Japanese which is really really uncommon when speaking or writing.
For example, kure is the informal form of kudasai, and you'll never see it in textbooks, but it's quite common in informal speech. -
@cafecortado
Wait what?
Last time I checked none of the major ISPs in Spain have CG-NAT.
In any case, in Spain in rolling Orange and I have a regular IPv4 that hasn't changed in 7 years, without me even asking. -
You are the maintainer right?
So they can complain all they want. If I'm the maintainer of a repo good knows I fucking straight push into master and if anyone wants to complain they can queue to blow me.
Those aren't devs, they are *bad* project managers posing as devs. -
@D-4got10-01
You need to learn katakana, yes, but kanji should be part of your learning schedule really. Like, most teaching books have a companion workbook that teaches kanji as you learn words, and it's much easier when you learn the word with the kanji than if you do so after the fact.
But anyway,
Nihongo benkyosuru koto de ganbatte kure! -
@D-4got10-01
They do indeed.
As a Japanese speaker, it's because the kanji for "shi/yon" is derived from Chinese characters for death (root for shinu, death in Japanese), so it's very much like triskaidekaphobia. -
@retoor
Not saying you did wrong, many people would have panicked.
Just telling you the better methods for dealing with them :).
I've been a security guard for 11 years in rural settings. I've dealt with wasps more times than I've had to with robbers XD. -
@retoor
Well, funny to hear from a dutch, when I was there I clearly remember the hotel explicitly not having a 13th floor XD, and I liked teasing the receptionists because I was in the actual thirteenth (14th) floor XD.
I can take a look at your ORM off you want (and I find myself bored, which is likely given the upcoming subzero temperatures) -
Yep, those are definitely wasps.
Shaving foam won't do a thing. You need either polypropylene foam (the same that is used as insulation), because it expands fast to fill every nook and cranny, hardens, and will block oxygen, making them all suffocate.
Another alternative is to cover the nest with some recipient (like a microwave lid) with some gasoline in it. The gasoline evaporating will daze them and make them either flee (and since wasps never nest twice in the same spot, you're set), or come out and fall into the gasoline and drown. The con is you'll get some gasoline smell in the house, tho not sure that's a con XD -
In any case, let's see how edge handles the whole V3 manifesto thing.
They could win over a lot of users just based on that. -
At this point, with edge being chromium too, functionally they are the same, so I no longer know which one is worse in terms of spyware. Google ain't exactly a saint in that aspect either.
-
@jestdotty
I'd rather say, blame the suits.
Normies on the internet can only do the most basic shit they are force fed through their cellphones.
Of course, having shit like navigation and what have you is a great advancement, but I miss the old days of having your PGP keyring, having your little website, IRC, or mailing list in your own computer, and relying on hearsay rather than fucking SEO. (I fucking hate that). -
Well, I'm gonna play devil's advocate here and say that if all it took was a really simple solution, the problem wasn't complex to begin with...
-
@typosaurus, @retoor
Dunno who the real you is anymore XD
Dunno if this is just me, as in, account discrepancies in algo or what, or maybe timing related, or maybe you are being out-botnetted, but your bots seem to have lost their downvote power (happens when you downvote often).