Does the StringView/Span implementation here seem lacking? If the underlying data goes away, wouldn't the pointer now point to an invalid freed location, because it doesn't track the underlying data in any way?
That's what std::string_view and std::span are, though. They're views / borrows over the underlying data, minus the kind of protections something like Rust has about lifetimes of the underlying data vs the borrow.
The benefit of these types is that they're a pair of pointer+size, instead of just a bare pointer without a known size.
True, I guess I was expecting if you were reimplementing these with additional protections, why not add the protection using the custom pointer reimplementations to ensure no use after frees. Seems like a missed opportunity.
I don’t think there is a way to do this generally without GC, and that leads to significant pitfalls anyway (eg in Java you can accidentally end up holding multi-GB strings in memory because a few references to short substrings exist).
I think because it's called `safe_c.h` and is "designed to give C some safety and convenience features from ... Rust", and says "The Memory Management Beast: Slain", you expected to see some level of memory safety, Rust's headline selling point. I did too when I opened the article. But it doesn't at all. Those phrases are all clickbait and slop.
In fact I don't see anything here from Rust that isn't also in C++. They talk about Result and say "Inspired by Rust, Result forces you to handle errors explicitly by returning a type that is either a success value or an error value", but actually, unlike Rust, nothing enforces that you don't just incorrectly use value without checking status first.
It's just some macros the author likes. And strangely presented—why are the LIKELY/UNLIKELY macros thrown in with the CLEANUP one in that first code snippet? That non sequitur is part of what gives me an LLM-written vibe.
No, not really, because the parent comment is freaking out about a problem that doesn't exist.
It's not going to be possible to grow a thing that looks like a piece of salmon but is secretly riddled with viruses and bacteria.
Either the lab gets their sterile technique right and they wind up with something that looks like salmon, or they get it wrong and you wind up with bacteria slop. Things that look like salmon can only become so if no bacteria and viruses are present.
In the real world I don't think you'll find salmon that don't have bacteria and viruses (https://www.nature.com/articles/s41598-023-43345-x shows both "good" and "bad" bacteria and certainly many salmon are infected with a range of viruses (not sure if there are any "good" viral infections, but some are not fatal).
A fair point, but wouldn't it only become unrecognizable at levels that mean you're effectively eating pus instead of salmon? My understanding is that the effective innoculation needed to give botulism to a human baby (who has an immune system, just less of one than we do) is <100 spores, which is picograms.
There's just such a gulf between the prices at which this is feasible for food use, and the prices at which existing large bioreactors can culture animal tissue.
If we can't even get plant slop ("algal biodiesel") culture consistent and cheap enough to burn in an engine, or get plant slop ("tilapia feedstock algae") cheap enough to industrialize to outcompete chickens... I don't know that I'm comfortable eating bioreactor meat that can only survive in the FDA danger zone.
Living animals with immune systems are the only types of organisms which can effectively host pathogens such that they can be communicated. Even your example belies the problem: pus is produced by the immune system destroying bacteria, it isn't a bacterial colony itself.
In an a bioreactor where no immune system exists, there can't be a latent infection: there's no immune system! If it can infect and destroy what's growing, then it'll infect and destroy all of it. It isn't going to look like tuna meat after that.
Isn't it possible for the pathogen to be limited by accumulation of its own waste products or depletion of specific nutrients before it destroys the whole sample, or for the meat to be harvested before the pathogen has finished propagating?
Fully agreed. FOSS maintainers don't owe you anything. You can ask for whatever you want, politely, but accept no or "maybe when I have the spoons, which may be never" as an answer, and don't push.
i'd go with "go fork it yourself". more correct, and less direct. makes it more like a creative insult where the recipient has to think whether they have actually been insulted or not.
I've enjoyed using "Looking forward to your fork/PR!" for a long time now. Caveat: I dont have any big projects nor anything that brings me money or fame. It is possible my slightly snarky responses have limited the projects' potential so consider what you're trying to get out of your open source before following any advice.
I don’t regret open-sourcing this project but god as your project becomes popular bad apples start joining and ruining the party for everyone. Fortunately it’s only a tiny minority, but it’s what stays the most on your mind.
Just submit a PR that removes the action so it doesn't run on the branch before the merge! If devs aren't reviewing the code anyways, will they even catch that kind of change?
Maybe it's just me, but I'd rather teach how to use a knife safely? And a cut from a blade is a lesson to be learned, hopefully only once.
Edit: Oh and if anyone's looking for the tool name, it's called a nibbler. This one is just table-mounted, there are power tool and unpowered versions ofc.
There are other tools you can safely use as a young kid and young kids can use knives etc they just need a lot of supervision and instruction. Hand saws are relatively safe compared to box cutters for example, they're unlikely to cut super deep but working with wood is a lot harder and more expensive. The cardboard hand tools mentioned elsewhere in the comments here are neat though they look like they work pretty well without having any sharp edges.
I agree, I'd do the Makedo style tools before this thing. But, I think the other part is this is an indoor activity with these tools. Handsaws would be outside for me (I don't want my house/furniture getting nicked during play).
The other part is, I simply don't want to heavily supervise their creative play. Everything kids do these days is planned and supervised, building a fort in your house shouldn't be.
Yeah do the hand tools and if they get into it in a big way this is a neat improvement, looks super easy to cut out complex shapes very quickly compared to the Makedo version.
I got some of their connectors in an Adabox I think a few years back and they were neat.
> And a cut from a blade is a lesson to be learned, hopefully only once.
A cut from a simple blade (that can't chop your finger off) can be anything from easily healed to going through just the right part to limit the dexterity for life if you're unlucky. There's lots of time to learn using a sharp knife when they have great fine motor skills already.
AFAIK there isn't a wizardly joke programming language yet--perhaps that was considered redundant--but you can use "giving" and "taking" if you're a rock-star programmer. :P
let's use conjure for method interactions and reify as a special case when that method is a constructor. the more this sounds like medieval alchemy the more I can get behind it, and I've already got misbehaving daemons
reply