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
-
@qwwerty
It does have news and stuff like that, but never ads. And even if it did you could still hosts the fuck off their ad servers. -
With enough voltage everything is a wire.
-
@kiki
Well, grayscale would be if you had actual photons of *every* visible wavelength mixed (since that's gray).
Things under 400 nm (which is the start of ultraviolet spectrum) do have colour, but our retinas don't have receivers for them. Some animals do, though.
Still, colours are a tricky thing.
You could ask 100 people to order a colour gradient, and you'd get 100 different results.
Even grayscale is tricky, because the way we perceive intensity is actually logarithmic, not linear. Screens do actually play math tricks on us to make us perceive it as linear by running linear RGB values to the power of (usually) 2.2. (this is the fabled gamma correction).
Also, the sun isn't yellow. It's white (and its peak of emissive power is actually green, not yellow, which is why our vision is sharpest on green wavelengths). -
@Lensflare
Well, sounds exactly like std::shared_ptr baked in, but that's still runtime. -
@Lensflare
Oh, I do not underestimate compilers at all. I say here all the time that the compiler does better than any of us.
My gripe is that what you described isn't really automatic, in the sense that having the compiler insert the calls to init and release is just like GCC will add a call to your constructor/destructor. You don't call them manually. You can then do ARC in them (like std::shared_ptr) or not, and while not free, it's nearly free, but doesn't dismiss you from actually having to properly destruct objects (release resources, etc).
My other gripe about compile time ARC is that the compiler can't possibly know when an object will be constructed or copied if there's no topologically unique code path through the program.
It just takes shit like reacting to a key press to invalidate that. If you create an object on each key press, the compiler can't know how many times the key will get pressed in runtime. -
Like in every internet community, there's users and there's lurkers.
I know that I myself was a lurker for almost two years before engaging at all.
Platform being abandoned certainly does not help, but also, in some ways, keeps it authentic kinda like the old IRC days. -
@Lensflare
To be fair I don't really know swift, but it's still an example of what I said. It doesn't matter what it is used for. Reference counting has overhead that you have to pay for.
C++ does not impose that on you, at your own risk.
And even then, I'm not at all sold at "compile time reference counting". A compiler has no idea when or why a piece of code with explicit malloc can be called.
RAII is the closest you can get to that, and it still relies on developer discipline to properly implement destructors. -
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.