4 ms·
What a crazy metaphor! You're equating using zero terminated strings in C to doing drugs.
by parasti 3y ago
What a crazy metaphor! You're equating using zero terminated strings in C to doing drugs.
- saagarjha 3y agoI feel like the success rate of getting someone off of null terminated strings is probably lower than most rehabilitation programs.
- IshKebab 3y agoWe can't entirely because of the C ABI but apart from that it's as simple as not using C which is not too difficult. C is not a popular language these days.
- masklinn 3y ago“Apart from that” does a lot of work here: FFI layers generally talk nul-terminated string unless otherwise specified, so do syscalls.
- IshKebab 3y agoYes that's what I said. You can generally wrap those layers so you aren't actually manipulating null terminated strings; just converting to/from them which is not too bad.
- chasil 3y agoWell, you will need to give up SQLite if you really feel this way, and reimplement it in a safe language. It will also be some time before Rust has substantial penetration into Linux; you might need to find a kernel that implements the POSIX interfaces safely. These will not be easy problems to solve.
- saagarjha 3y agoYeah, no…
- torstenvl 3y agoI don't know what you're relying on for the idea that C is not a popular language, but it is extremely popular.
- masklinn 3y agoI mean it’s a wash, on the one hand zero terminated strings have done untold amounts of damage[0] and are impossible to extirpate once they’re in, on the other hand the nazis were methed (and coked later on) up their eyeballs. [0] and not just in C itself, unexpected truncation through FFI is an issue which regularly pops up
- GoblinSlayer 3y agoodbc defines multilingual interface that can accept both null terminated and length bounded strings by using NTS sentinel value for null terminated string length.
- mort96 3y agoWhat's up with people seeing an analogy and going "you can't equate those two things"? Analogies aren't equating things
- rtpg 3y agoAnalogies are great since they talk about how things are the same, and just as terrible because they talk about things that are different. But seriously it’s sometimes hard to slice out what level of similarity is implied. Obvious things are somewhat less obvious to others sometimes