« first day (2917 days earlier)      last day (2022 days later) » 

12:07 AM
@StackedCrooked With it stopping working for no particularly good reason, then starting again with even less reason, you'd almost think it was on the web or something.
 
12:58 AM
@sehe sea
 
 
11 hours later…
nwp
11:47 AM
Visual Studio: Your license has gone stale and must be updated. Please remember the password for your trash account from a couple of years ago. -.-
Apparently "lolmicrosoft" is not a strong enough password.
 
nwp
12:40 PM
Qt finally packaged MinGW 7.3.0. Yay current standard.
 
Isn't it amazing when the compiler is packaged together with a library instead of vice versa
It says... something about C++
 
nwp
Meh. May just as well blame windows for not providing a repository or Qt for being massively intrusive.
Then again I don't like repositories. They tend to invite politics.
 
1:20 PM
Or that widget kits are compiler specific like WPF or C++Builder's
 
nwp
If that is the case I would blame C++ for failing to standardize properly. Compiler-specific widget kits should not exist.
I am partially to blame for not "simply" installing a modern compiler by downloading it from some website.
 
Well, widget kits typically need meta compilation, which needs to interact with the build system.
So we'd need to standardize cmake/qmake
 
nwp
That doesn't stop people from simply using whichever compiler they feel like.
And arguably meta-classes targeting C++23 might make meta compilers unnecessary.
 
@Mikhail if meta programming was good enough then it wouldn't need an extra step
 
nwp
1:35 PM
Not that Qt will use those. They don't even support move-semantics. But in theory they could.
 
they have copy on write instead, which if managed carefully will let you avoid all copies
 
nwp
It's not caused by COW being incompatible with move-semantics. I don't understand why QVector<std::unique_ptr<int>> doesn't compile. Apparently they want to support C++03 and can't be arsed to add #ifdefs.
 
@nwp I think it's unrealistic to expect changes in C++ standardization to stop vendors from being greedy.
 
@nwp because all QVectors are copyable with the semantics that they copy their elements on copy
 
nwp
@JerryCoffin Why greedy? Qt doesn't have uic and moc to sell more, they have it because C++ is not powerful enough to express GUIs.
 
1:40 PM
bad design decision to be sure but that was made before movesemantics
 
@nwp Because at least some compiler specific widget kits exist because vendors decided to make them compiler specific, not for any technical reason.
 
nwp
@ratchetfreak std::vector has the same semantics and it solves itself by template instantiations not instantiating copy constructors when unused. I guess they have some potential copy code in their detach which always gets compiled because the destructor uses it or something. I'm sure they could fix that if they cared.
@JerryCoffin Well, Qt is not one of them. They even have a standalone designer so you don't have to use Qt Creator.
 
or a committee decided that all QVectors are copyable is a golden unbreakable rule and screw non-copyable elements
 
@nwp There are (at least) two groups of people who've shown that while moc may have some advantages under some circumstances, it's not strictly necessary any more.
So yes, C++ apparently does provide what's necessary to express GUIs.
 
nwp
Well, I do hope someone comes around and makes a proper GUI framework for C++. Might be Qt fixing their stuff or someone else. Unfortunately copperspice seems to not get much traction. I will give Verdigris a try.
By simply not using moc they should automatically support stuff like templates and typedefs which would be some improvement.
If someone replaced raw owning pointers with std::unique_ptr I'd almost consider it passable.
 
1:53 PM
technically raw pointers to QObjects are not owning pointers, instead the owner is the parent of the QObject
But that does create issues when you have QObject residing in other threads that you want to own
 
@nwp Are you talking about raw pointers in qt? I think they are pretty reasonable as the parent is responsible for deleting children. I wouldnt call them owning .
 
nwp
The interface expects raw owning pointers to be passed and then takes ownership of them. Should be easy to fix, but they don't care enough.
@Mikhail There is nothing reasonable. It's a non-standard memory model. At the very least use proper types.
 
@nwp looks like a scene graph or a linked list?
 
there is also the setParent which changes the owner of a QObject...
 
nwp
At the very least functions that take ownership of at pointer should take a QSharedPointer or something.
 
1:56 PM
I think it works pretty well, with the exception of non transparent object lifetimes
@nwp why? There should only be one parent...
 
nwp
@Mikhail Then use a std::unique_ptr or whatever Qt's reimplementation of it is. But taking a raw owning pointer is not acceptable.
 
Sounds like a cargo cult position. You don't get anything with the smart pointers.
You'd also get messed up if you tried to delete a child with a parent.
 
nwp
You get to see when you pass ownership. That alone is huge. And you may even avoid some leaks and bugs.
 
but the contrast between Qt and modern C++ is confusing
@Mikhail no they account for that
you should be using deleteLater to ensure no events are queued but straight delete works
 
Yeah, but if you directly used unique_ptr with a normal deleter you might get in trouble. The underlying mistake is holding pointers in qt instead of traversing the layout or container on each access...
 
2:04 PM
did someone just say… profunctor optics?!
 
holding unique_ptr to QObject held by a parent does create the danger of double delete
 
^ Yes
 
nwp
The other part is teaching. I like to say "Don't worry about memory management in C++. Simply don't use new. It solves most problems." Which works great until Qt comes along and requires passing raw owning pointers.
 
"Don't worry about memory management in C++. Simply don't use new. It solves most problems outside of bad frameworks."
 
But they aren't owning pointers... You should never call delete on them.
They are more like handles...
 
nwp
2:07 PM
You must call delete or pass ownership to some Qt Widget or to std::unique_ptr or someone else who does it for you.
 
Framework owns them :-)
 
nwp
I've seen plenty of people who did auto w = new MyWidget(); w.show(); and then got confused that their widget leaks. There is no ownership here.
 
when you new it without a parent you own them. If you new them and pass a parent the parent owns them
 
nwp
The proper solution is to use std::make_unique and have QWidget::addWidget take a std::unique_ptr.
Today I learned not is not a keyword in C.
 
2:59 PM
@nwp yeeep, to support IBM mainframes
 
3:36 PM
@BartekBanachewicz Doesn't matter; what matters is time budget available and complexity of the scenes
You can easily have issues keeping 60FPS when rendering a bunch of 2D tiles or untextured cubes if you do it badly
And you will have random unpredictable and annoying stutter if your main logic just does whatever with GC memory
 
even without GC it can go to crap if you do whatever with allocations, especially when the allocator is crap
 
4:16 PM
Finally! 32GB desktop DIMMs: anandtech.com/show/13458/…
Doesn't look like I can run them in my systems though. :(
/cc @Mikhail
Will probably cost $500+ a stick though.
 
4:39 PM
The only innovation is the rgb. My workstations in office use 128gb server ram.
 
Why do the desktop 32GB sticks require a non-standard pin-out?
Is there something about the ECC stuff that lets it go above 16 GB?
Realistically we're probably not getting 32GB desktop DIMMs until DDR5.
 
Market interest :-)
What is the rank of consumer ram?
 
dual is the highest I've seen
 
What is the rank of consumer ram? The big 128 gb modules are octal rank.
 
I don't know if it's possible to go higher.
 
4:50 PM
Well. The mobo might not be able to handle anything above dual rank.
 
What about the LRDIMMs?
Is the rank thing a pinout thing? a controller thing?
I honestly don't really know how it works.
 
source/Main.hs:1:1: error:
    solveWanteds: too many iterations (limit = 4)
the compiler constraint solver fails even though my own code has no hole, how fun and interesting
looks like this happens a lot
 
I don't know either but consumer ram is starting to cost more per GB compared to server RAM.
 
5:25 PM
0
Q: Calculating class' pointer from a pointer to one of its class members

ZeroZ30o&I've been told that a class' memory always has the same structure: So if I have the pointer to a member of a class, can I somehow calculate the pointer to that class? class num { public: num() {} int a; int b; }; int* ptr; // we have the pointer to num.b num* number; // we want th...

I'm not sure why that is so illegal.
 
@Mikhail I'd love to see 1tb workstations with RGB ram at current densities
it'd be hilarious
 
Mobile internet used to be super-slow compared to wifi. Intuitively that made sense for me because the distance to the cell tower is much larger and the tower is used by many people at the same time. However, these days I reach 100 Mbit/s on an internet speed test using my phone. How is this possible?
 
@Mysticial I think it's mostly because JEDEC simply hasn't defined what the pinout for a 32+ GB desktop DIMM should be. To make things work, those are logically laid out as two entirely separate 16 GB DIMMs that happen to physically connect to a single DIMM slot.
@StackedCrooked WiFi and 4G use similar techniques. Cell towers are licensed, so they can use extra power to make up some of the loss due to greater distance. Mostly, however, it's just hidden. Theoretical max for 4G is something like 400 Mbit/s, and for 802.11ac is a little over 1 Gbit/s. Most people's Internet connection is capped lower than that though, so usually your limit is imposed by the cap, not the theoretical bandwidth the technology could provide.
 
5:43 PM
and how polluted the frequency band is
I believe cellphone have a pretty clear band compared to the wifi band
 
@JerryCoffin Thanks. So power is they key to higher speeds?
 
@StackedCrooked also perfect reception... and complete lack of loss
which is impossible in most radio environments
 
it increases signal to noise ratio so you can transfer more bits per waveform
 
How come there's no loss?
 
@StackedCrooked I think "the key" overstates it. But yeah, doubling power gives you 3 dB more s/n ratio, which definitely improves bandwidth.
 
5:46 PM
Directional antennas can help... because of r^2 issues as well
 
But this only applies to downloads (transmissions from tower to my phone) right? Since phones aren't legally allowed to send at high power.
 
but a better directional antenna can still improve reception
compared to the omni directional of typical wifi
 
Can directional antenna's reach my phone if I'm inside a building?
 
@StackedCrooked Yes--a phone's speed is highly asymmetrical (much higher download than upload speed).
 
I see.
Cool stuff.
Especially if the company pays for the plan.
I wonder what the maximum possible throughput is when using the full electromagnetic spectrum.
 
5:53 PM
@StackedCrooked Yes--in fact it helps. A cell tower uses an array of small antennas, and the directionality is controlled by changing the phases of signals sent to those antenna elements. The phone and tower are constantly (every few milliseconds) re-training to steer the signals in the right directions.
 
@JerryCoffin You mean being in a building causes me to not move so direction remains?
*remains the same
 
@JerryCoffin IOW, desktop and ECC ram have different pinouts. Otherwise, you can just rebrand a server 32gb stick and call it a new desktop part and it would work.
 
If cellular keeps improving like this it almost seems as if we won't need wifi anymore.
 
@StackedCrooked Yes you do, unless you want to sell your kidney to pay for the cellular charges.
 
I might consider that.. :)
 
5:59 PM
They're almost as bad as US ISPs. But I'll cut them a bit of slack since I'm less informed on this area and I assume that wireless is more costly/bit than wired.
 
Yeah. It definitely is.
Also a typical plan is limited to 1-5 GB per month.
 
@StackedCrooked Of the 5 GB you'll spend on data, approximately 10 GB of it will on fucking webpage ads.
 
Yeah...
 
Another 4 GB of it will be spyware and telemetry from your phone itself.
And the remaining 20 GB of it will be from forced updates.
 
@StackedCrooked Point is, it doesn't matter much. Even when you're outdoors, it's entirely possible the main signal you're getting was (for example) reflected off some building, or (for a few milliseconds) off the roof of a nearby car or something.
@Mysticial Yeah, I think they do (more specifically, ECC and/or registered RAM has a different pinout).
 
6:05 PM
@JerryCoffin Ah, didn't think of that.
 
6:35 PM
I've come across a situation several times where I've wanted to call std algorithms but instead of being passed the value at each location I want the iterator at that point. Do such APIs exist in core? I couldn't find them if they do.
 
6:53 PM
@LeviMorrison Sorry, but I'm pretty sure they don't do that.
 
usually with good reason
 
It makes composing algorithms difficult because I have to rewrite them to use iterators :/
 
7:16 PM
Ah, for this specific case I can use inner_product.
 
7:50 PM
How would you name a class that's like string_view but for binary data?
buffer_view seems not specific enough
 
nwp
8:13 PM
I believe gls::span does that.
 
Ah, yes. I could use span<uint8_t>.
Oh, wow, just learned that std::byte is a strongly typed enum.
enum class byte : unsigned char {} ;
IIRC this means it doesn't alias everything like uint8_t* does.
 
yes, it needs extra wording in the standard (that it does have) that permit aliasing
 
However, not sure if I can legally cast incoming data (i.e from a network socket) to std::byte*.
 
nwp
Why not? That's the main reason for std::byte to exist.
 
2
A: How to use interfaces that expect `const char*` if I'm working with `std::byte`s

milleniumbugGiven a contiguous buffer of std::bytes, a reinterpretation of a std::byte* to a char* is legal by design and doesn't violate the strict aliasing rule: (wording from the most recent revision of the std::byte proposal) Lvalues and rvalues [basic.lval] If a program attempts to access t...

 
8:20 PM
That's really not about c++, but as there seem to be a few hardware-aware people around here I'll take a chance: how do I start understanding better what actually makes a good gpu over a normal one? I think I'm starting to understand that total memory is not everything, that bandwith is important, and that higher bit count is better, but I'm unsure how this translates into a good gpu.
For instance, I think that some gpus will have better support for physics intensive games (totally speaking out of my ass here)?
Where do I start looking to understand what gpu technology supports what kind of gaming feature (and how to value those)?
 
My answer doesn't explicitly answer that question, but the quote in there does
 
@StackedCrooked Funny, in my own code, I just use void* for generic typeless data.
 
Sorry. I can't seem to think clear.
 
You can also see the linked proposal pdf in the answer
Lots of wording related to having cv unsigned char and cv char "special" now also got std::byte introduced to them
So even if they skipped some, the overall intent is pretty clear
 
@FélixGagnon-Grenier your right about the bandwidth, and other recent advance is in the way threads talk to each other, but it's hard to characterize applications by bandwidth usage. Newer gpu have more loose thread launch rules which helped with tasks such as fluid dynamics.
 
8:29 PM
I mean. If I have an object and passes it's address as a void* to a function. Inside that function I the void* cast to std::byte*. Then I do auto x = byte[0]. Then I overwrite the first member of the original object. After that I do auto y = byte[0]. Will x be equal to y (according to the compiler)?
 
I'm going to assume if you do that with void* to char*, x won't be equal to y
the section on cppreference related to type aliasing also got updated to include std::byte there
So I'm assuming that the answer to your question is "it will behave the same as if you had casted from void* to char*"
 
9:06 PM
@milleniumbug Link?
 
It aliases everything. While a user-defined enum class doesn't.
@milleniumbug Thanks.
 
nwp
50 mins ago, by milleniumbug
yes, it needs extra wording in the standard (that it does have) that permit aliasing
 
Yeah. I was just checking if it can be reproduced.
 
nwp
How do you reproduce wording in the standard?
 
9:09 PM
Erm. Never mind.
@milleniumbug Oh. I now I can finally parse what you're saying.
 
 
2 hours later…
11:08 PM
Code I submitted as part of a contract crashes coverity, you guys proud of me?
 
I've heard about Coverity being very expensive.
Is it good?
 
Never worked on a team with it, I was secretly trolling for somebody to send me a license.
My experience with static analysis tools has been positive in the sense they catch a percentage of errors I would not have caught otherwise. But I assume that nobody in the lounge still uses C++ at work :-)
 
11:32 PM
I ordered Da Bomb.
So scared. Since I'm not really that good with hot sauces.
But fun :P
> We just put a toothpick in it when it arrived and tasted it. Our mouths were on fire for 15 minutes before the pain was gone.
Tasting with a toothpick is a good idea.
 

« first day (2917 days earlier)      last day (2022 days later) »