• 1 Post
  • 66 Comments
Joined 2 years ago
cake
Cake day: August 18th, 2023

help-circle



  • For interactive use, tab-completion essentially makes this a non-issue, because shells add escaping in the appropriate places.

    For scripting, where spaces are harder to deal with, unfortunately there’s just not much you can do; your two options are basically to learn all of your particular shell’s patterns for dealing with whitespace in filenames, or only write scripts in something other than a POSIX shell.



  • “Garbage collection” is ambiguous, actually; reference counting is traditionally considered a kind of “garbage collection”. The type you’re thinking of is called “tracing garbage collection,” but the term “garbage collection” is often used to specifically mean “tracing garbage collection.”










  • For what it’s worth, I agree with you about branches, and there are various ongoing discussions about how to make working with branches more convenient. I use an experimental feature called “advance branches” that makes it mostly fit my workflows, and the other benefits of jj are sufficient that I haven’t switched back to git.

    I create log files of runs, temporary helper scripts, build output, etc. in my working copy all the time.

    The solution to this is to just have a more aggressive .gitignore. But also, note that the “working copy commit” isn’t generally something you want to push or keep; think of it more like a combination of the git staging index and an automatic stash.



  • You didn’t say “programmers should be aware that rust doesn’t automatically mean safe”. You said:

    People just think that applying arbitrary rules somehow makes software magically more secure…

    You then went on to mention unsafe, conflating “security” and “safety”; Rust’s guarantees are around safety, not security, so it sounds like you really mean “more safe” here. But Rust does make software more safe than C++: it prohibits memory safety issues that are permitted by C++.

    You then acknowledged:

    I understand that rust forces things to be more secure

    …which seems to be the opposite of your original statement that Rust doesn’t make software “more secure”. But in the same comment:

    It’s not not like there’s some guarantee that rust is automatically safe…

    …well, no, there IS a guarantee that Rust is “automatically” (memory) safe, and to violate that safety, your program must either explicitly opt out of that “automatic” guarantee (using unsafe) or exploit (intentionally or not) a compiler bug.

    …and C++ is automatically unsafe.

    This is also true! “Safety” is a property of proofs: it means that a specific undesirable thing cannot happen. The C++ compiler doesn’t provide safety properties[1]. The opposite of “safety” is “liveness”, meaning that some desirable thing does happen, and C++ does arguably provide certain liveness properties, in particular RAII, which guarantees that destructors will be called when leaving a call-stack frame.

    [1] This is probably over-broad, but I can’t think of any safety properties C++ the language does provide. You can enforce your own safety properties in library code, and the standard library provides some; for instance, mutexes have safety guarantees.



  • Rust doesn’t have a formal specification other than “whatever the fuck our team hallucinated in this compiler version”

    That’s simply not true. The Reference, while not an ISO-style formal spec, does actually specify most of the intended language behavior, and incrementally approaches completion over time. But even if you insist on an ISO-style formal spec, there’s Ferrocene: https://ferrous-systems.com/blog/the-ferrocene-language-specification-is-here/

    it fucks your day because you’re not careful

    The cve-rs vulnerability is actually not really something you’d ever write by accident. Also note that the bug report has multiple versions because, even though a “full” solution is pending some deeper compiler changes, the first two three versions of the exploit are now caught by the compiler. So, like I said, the compiler bugs do get fixed over time.