Earlier quoted context omitted.
I adore unsafe, appreciate it as a feature... but it is an escape hatch. One that is sometimes necessary, one that is sometimes not necessary but might still be (ab)used for performance, or initial 1:1 porting of C/C++ code. There are a lot of cases where that escape hatch should probably welded shut though. Fortunately, the Rust ecosystem has tools like `cargo geiger`, and straight out of the box I can also write: /…
I feel like this perpetuates a bad mental model. Unsafe is not an escape hatch. Code within unsafe blocks must uphold the same semantics as code outside it but the compiler cannot guarantee that those semantics are upheld. If we're using analogies, `unsafe` is like a "hard hat required" sign. There's nothing intrinsically different about the space inside or outside of it, other than that you can't be sure a brick isn…
How Our Rust-to-Zig Rewrite Is Going
281–290 of 336 posts
Re: How Our Rust-to-Zig Rewrite Is Going
#282Earlier quoted context omitted.
> if rustc emits machine code and then cargo immediately executes it, there's the same opportunity for end user memory being corrupted (due to miscompilation) as if rustc and cargo shared a code base Your tests run in an entirely separate process from the compiler (and from cargo). This makes it very different from memory corruption in the compiler: - The test process can only corrupt its own memory. - You don't need…
> Does roc run tests in the same process as the compiler? We do for tests of pure functions, yes. > Your tests run in an entirely separate process from the compiler (and from cargo). That's a great point and a relevant distinction, although Rust tests can run arbitrary I/O, so it's not like having them be in a separate process means memory corruption is harmless! :)
But all of this is ultimately completely unrelated to the concept of "unsafe". You can delete your home directory just fine in safe Rust/Go/Python/etc. You can write a compiler that emits broken code in the same languages; even in a 100% pure functional language with 0 side effects and a perfect bug-free implementation.
Re: How Our Rust-to-Zig Rewrite Is Going
#283Earlier quoted context omitted.
Considering that you often run the code after you compile it, it might not matter. Anyway, like it or not, most compilers don't consider themselves security sensitive and will not consider malicious code that is able to hijack the compiler a security vulnerability.
Ken Thompson won the award for nothing, yeah.
(And if you ask me, it was indeed overrated, but that's unrelated).
Re: How Our Rust-to-Zig Rewrite Is Going
#284Re: How Our Rust-to-Zig Rewrite Is Going
#285Re: How Our Rust-to-Zig Rewrite Is Going
#286Re: How Our Rust-to-Zig Rewrite Is Going
#287Earlier quoted context omitted.
Real time GC as used by the military in weapons control systems, and on factory automation robots, keeping PTC and Aicas in business, people pay to use them.
TBH, physics limits how latency-sensitive weapons systems need to be and you can largely just disable the GC in these contexts. They use CPUs from the 1990s to do hypersonic terminal guidance. You don’t have to do any performance engineering for many latency-sensitive weapon systems. Could probably write it in Javascript. For throughput-optimized systems, some of which are real-time, you never see a GC. That loss in…
https://www.lmax.com/exchange/technology
No, you could not guide battleship weapons in Javascriptt
https://www.lockheedmartin.com/en-us/products/aegis-combat-s...
https://dl.acm.org/doi/abs/10.1145/2402709.2402699
And no they don't disable the GC, they have real time GC implementations,
Re: How Our Rust-to-Zig Rewrite Is Going
#288[flagged]
Do you think personal attacks affect me? Grow up, I have cut my scars in the bloody discussions from BBS and Usenet days, not the woke friendly discussions of modern Internet.
Re: How Our Rust-to-Zig Rewrite Is Going
#289Earlier quoted context omitted.
There's a material difference on one taking risks for oneself and one taking risks where the brunt of the consequences fall on others.
You mean like driving a car?
Re: How Our Rust-to-Zig Rewrite Is Going
#290Earlier quoted context omitted.
Ken Thompson won the award for nothing, yeah.
Totally unrelated; The trusting trust attack was about downloading a malicious compiler because malicious code was injected into it in some early version. (And if you ask me, it was indeed overrated, but that's unrelated).