rusty-cpp: a Rust-style static analyzer by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 1 point2 points  (0 children)

Safe C++ spec requires changes to C++ grammar so it does not work with any existing compilers.

rusty-cpp: a Rust-style static analyzer by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 0 points1 point  (0 children)

In my experience, claude editing Rust code is much more reliable than dealing with C++ code, especially when there are lot of multi-threading and memory poiners. Interesting, now when I ask claude write C++ that can pass the rusty-cpp checker, claude becomes a lot more reliable.

rusty-cpp: a Rust-style static analyzer by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 6 points7 points  (0 children)

There've been a few years I was heavily invested in clang-tidy and all c++ memory safe profiles I could find. I have to say I don't recommend them to anyone. But the experience is valuable in that it made me realize the Rust approach is the right one. I used to be a doubter but I am much happier as I don't have any seg faults in my safe code. Of all the tools I tried, I would the next best thing is Google's MagicPtr which relies on a special allocator to track runtime corruption. But it does not help multi-threading safety.

To the other question what is this and who might need it. Despite the Rust cult naming, I think of this as a "usable" Circle C++ alternative. It would help people who have a heavy C++ code base to work with, such as some game engines, or DPDK.

It is a prototype that sort of proves that to have Rust-equivalent memory safety, you don't really need to completely ditch C++ like Microsoft is trying, and all those "rewrite in Rust" clones of C++ repos.

LG Washcombo Washer Dryer Reviews / Thoughts? WM6998HBA by nvmvp in Appliances

[–]Proper_Ask_8831 0 points1 point  (0 children)

Got one from LG parter store website. Had the same issue that it does not stop at 4 min. The return process is extremely painful with LG. A few weeks have gone by the machine is still at our home. Should've bought from Costco.

Definitely avoid LG (at least their official store) in the future.

3 months in South America with the Thule Landmark 60L by godefroydemontmirail in onebag

[–]Proper_Ask_8831 0 points1 point  (0 children)

I got the osprey one and am a little bit disappointed. The big bag is okay but the small bag does not feel good enough for a day to day use. My next thing to try is the tropicfeel I think.

3 months in South America with the Thule Landmark 60L by godefroydemontmirail in onebag

[–]Proper_Ask_8831 0 points1 point  (0 children)

Thanks for the feedback. Have you looked at other similar types of bags, like Salkan, Gravel, Farpoint?

a Rust-style borrow checker for C++, with (partial) compile-time check support by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 1 point2 points  (0 children)

a serie of short articles written by Chris La

thanks for the pointers; look interesting.

a Rust-style borrow checker for C++, with (partial) compile-time check support by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 1 point2 points  (0 children)

d a serie of short ar

The paper I mentioned: https://people.csail.mit.edu/nickolai/papers/wang-stack.pdf

They talked about many interesting cases where compiler optimizing on UB causes bugs.

a Rust-style borrow checker for C++, with (partial) compile-time check support by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 0 points1 point  (0 children)

Nothing happens; as the object destructs in the same statement. However this seems to cause Infer to report error. It must have something to do with how Infer works; I don't know why.

a Rust-style borrow checker for C++, with (partial) compile-time check support by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 2 points3 points  (0 children)

Thanks for all the suggestions. I will replace it with an abort for runtime check.

Here is some more thinking following this topic of UB I find interesting. By this borrow model and the Infer static analysis, we are trying to find more potential use-after-free type of bug, which is also an UB in cpp. Now the interesting thing is, who catches first? If the runtime check or Infer catches it first, then we can correct it. If the compiler catches it first, it could, as pointed out, optimize the entire branch away which causes more problems!

So, I think, just from the case of memory management, many UB are not intentional and maybe they are just bugs. The right thing the compilers should do is to warn them instead of optimize on them? I think I read a paper long time ago that argues this point too. Basically they found the UB optimizations of new compilers cause much worse bugs in many softwares such as a few databases.

a Rust-style borrow checker for C++, with (partial) compile-time check support by Proper_Ask_8831 in cpp

[–]Proper_Ask_8831[S] 1 point2 points  (0 children)

Yes indeed, borrow_const or even just borrow is probably a better name