the perfect browser
Zacryon @ Zacryon @feddit.org Posts 0Comments 436Joined 1 yr. ago

Another type of plastic though than the ones used for typical drinking bottles. I can imagine they are more robust. But it would be really good to know the microplastic intake through such plastic pipes.
I suppose so. Even though they already melt at typical frying or baking temperatures, they don't evaporate. Even if, the still need to find a way through the food outside and not get trapped inside, where they'll cool down again and therefore return to a solid state.
Take this with a grain of microplastic-free salt, as this is not my field.
I've a very long track record using C++ as well and I can't share the feeling. I don't say it's alyways easy. I'm just saying that it's doable and therefore whether the software is memory safe depends on the expertise of the devs. Modern C++ practises, programming patterns and as well tools from the STL (or even your own implementation) make life a lot easier. If you don't use them, that's not the languages fault. In the end, how you use the language still matters a lot. If you'd like to think less about memory management, go on and use Rust or C# or Java or even Python if performance doesn't matter. That's perfectly fine. This can come with other issues, like more boilerplate in the case of Rust for example, but in the end those languages are tools. Choose the tool which gets your job done.
I think it boils down, how we define "memory safe". C++ is perfectly memory safe, if you know what you're doing. A lot of people don't. Which is why Rust was born. that doesn't make C++ a memory-unsafe language. It just demands more responsibility from the user. A design philosophy that comes with a lot more flexibility than Rust can offer.
Which is fine. Both languages have their perks. But saying C++ isn't memory safe, while Rust is, is in my opinion just plainly wrong. Besides, with "unsafe" Rust inherently already the door for memory issues.
Modern C++ practises and dev patterns can handle most memory issues in C++ pretty easily. Consider smart pointers for example, or RAII.
It's not the language's fault if it is used wrong.
That was not the only aspect, but yes, I mentioned that.
I don't dislike Rust. I find it pretty cool. However, I disagree with the blanket statement "C++ isn't memory safe". C++ provides the tools for writing memory-safe code, but it does not enforce it by default. That’s a design choice: favoring flexibility over strict enforcement.
Yes, you can make mistakes that lead to memory issues. But that's not a problem with the language itself; it with how it's used. Stupid example: if you write code, which divides by zero at some point and you don't make sure to check that, this is not the language's fault, but your own.
Of course a language can accomodate for stuff like that and lift some of that burden from the user. Surely there are plenty of use cases and user groups for that. And that's totally okay. Rust was designed with memory safety in mind to prevent common errors that occur to a lot of devs during the usage of C++, which is fair. But that doesn't make C++ less memory safe. It is intentionally open and flexible on purpose. There are various programming patterns and even functionality within the STL that help to prevent memory issues.
So in other words: C++ is a tool, just like Rust. If you don't know how to use the tool, that's not the tool's fault.
C++ makes that a bit better with the smart pointers at least, but those have some rules that aren't enforced by the compiler but instead by convention.
You can always implement your own smart pointers. Besides that: which conventions do you mean?
Basically I find the phrase "fighting the borrow checker" to be shorthand for "I can't write C or C++ in Rust and I want to".
Nah, although it has its persk, I just think that it also imposes a rigid framework that sometimes forces you into cumbersome workarounds. With C++, you retain full control over memory management and can choose the best tool for the job. You're not boxed into a strict ownership model that may force refactoring or add extra layers of abstraction. Instead, you have a mature ecosystem with decades of evolution that lets you balance safety and control based on context. Sure, mistakes can happen, but with proper practices and modern C++ features you can achieve a level of safety that meets most needs without sacrificing the expressiveness and efficiency you might require in complex systems.
It's not just about runtime performance, but also about coding flexibility, and for example also reduction of boilerplate.
I'm not just talking about performance costs. For example, compared to C++, Rust comes with reduced flexibility and increased complexity in certain cases.
The borrow checker, for example, imposes strict ownership and lifetime rules, which can be difficult to work with, especially in complex data structures or when interfacing with existing systems. Sometimes, you have to significantly refactor your code just to satisfy these constraints, even when you know the code would be safe in practice. This can slow down development, require more boilerplate, and make certain patterns harder to express.
C++ gives developers more freedom but expects them to take responsibility. That tradeoff isn’t just about raw performance; it's also about how much control and convenience the developer has.
If a language prevents you from doing stuff like that, this always comes at a cost, since it has to do the work for you, almost always. This is additional overhead you can get rid of in C++ and therefore gain a lot of performance. But that again comes with more responsibility on the developer's side and you might need to implement appropriate checks yourself where needed.
I don't like that "C++ isn't memory safe". It is. Users of that language are usually just not experienced or educated enough and therefore more mistakes happen.
I agree though, that other languages like Rust or Java can make it easier to prevent such mistakes.
In my experience, using smart pointers alone already solves 90% of memory issues I have to deal with. C++ improved a lot in that regard over the decades.
He believes that food, especially meat, is the primary source of microplastics entering the body, as commercial meat production tends to accumulate plastic particles within the food chain.
“The way we irrigate fields with plastic-contaminated water, we postulate that the plastics build up there,” Campen said. “We feed those crops to our livestock. We take the manure and put it back on the field, so there may be a sort of feed-forward biomagnification.”
Go vegan, I guess?
Attach your brain to a 3D printer. Make some use of all that plastic and print your thoughts. /j
Nope. I'm gaming to have fun, not to work off some backlog. And if I buy a game, barely touch it and never play it again, that's fine. Keep the fun in games and don't treat it as an obligation.
Yupp, and that's sadly a product of capitalism. For example, low load industrial robot arms with a default set of software can be bought extremely cheap nowadays. What the capitalist sees is not a robotic utopia, where people are freed from work and get to enjoy life more, but a labour force which is cheaper and more reliable than humans. They have no interest in making the world a better place. They just want to maximize profits.
Legislation worldwide is missing crucial time to find and enforce solutions for this.
Technology can be so beautiful, magical and immensely helpful to us. If we use it right. But given our current system, this is unfortunately barely the case.
I'm in favour of making it mandatory in the context of fucking Trump, fucking Musk and all other fucking facists or fucking fascist-enablers.
While they hurt countless of lifes and get glorified for who they are, they are trying to silence you for speaking up.
I'm so glad I've quit Reddirt back when those API pricing changes happened. Fucking facists.
Remind me: why do we allow the worst of humanity to get into positions of power?
FTFY: *10 reasons to avoid capitalism
If it's not Amazon, it's another shitty company which exploits everyone and everything to maximize profits without regard to the well-being of humanity and life itself.
We need fundamental, systemic changes which grab those malpractices by their roots and rip them out. Our life will not get better if we continue to allow corporations like Amazon to exist.
Purge them from the face of the earth. Life is too precious to be sacrificed for the sake of greed and corporate dominance. A new paradigm must emerge, one that values people over profits and prioritizes the health of our planet. We need to foster a society built on mutual respect, fairness, and sustainability, where every individual has the opportunity to thrive. Only then can we hope to create a future that benefits all of humanity instead of a few.
Yes, yes. Very well, thank you.
I suppose we need to make definitions clearer. C++ is memory safe in the sense that you can write memory safe code. It doesn't enforce memory safety though. But not doing that is not the language's fault. If someone jumps with a bike from a flying airplane, it's not the bike's fault that they will not land safely. It's the misuse of the bike.
I'd argue those weren't the best developers then. However, I don't want to get ridiculous. I see that there are problems in the common use of C++. Although I can't share that from my experience due to usually proper usage, thorough testing use of additional tools, there is surely a need for aiding C++ devs with writing safe code. I know of the corresponding security concerns as well as probably everyone else in the C++ community.
There are proposals to improve on that. Some of those might already come with C++26. Stroustrup's favourite are Profiles to provide and enforce further guarantees, while others propsed an extension like Safe C++. Whereever the future will take us with C++, I'm confident that this issue will be sufficiently solved one day.
There was a time when C++ wasn't even designed for multi-processor systems, lol. That was redesigned pretty late. Much has changed and it will continue to improve as C++ continues to mature.
Edit: Just saw your convention examples after I've sent my reply. Idk why it wasn't displayed before.
Regarding the double free: It's clear from the documentation that this returns a raw pointer.
Regarding the use after free:
I really don't want to sound arrogant as this is a simple example of course, but that is such an obvious mistake and looks like a topic which is covered in C++ beginner classes. To me, this is almost on the same level as dividing by zero and wondering about resulting bugs.
Yes. Not every language is as user-friendly as python. With more flexibility come more risks but also more rewards if you've mastered it. It depends on what you want to do and how much you're willing to invest. I would at least expect a professional dev to rtfm. Which itself is apparently already a problem. But, in the end of the day we want to use tools, which are effective and easy to use. So sure, point taken. I refer to the section before my edit regarding developments upon improving such aspects in C++.