i don't want to open this whole thing up again, but I think what really bothers me about the whole rust reaction to fil-c is that rust users have spent years arguing that the only important property is memory safety.
I think you’re confused about what Rust programmers actually value (so are they, for what it’s worth). Rust meets their require by achieving memory safety *without runtime cost or making every deref a partial function.* That’s not what approaches like fil c accomplish.
They accept things like safe leaks and unsafe code and bounds checks that’s foundational to everything because no one has developed a static analysis that brings more of the program into the memory safety subset. But the requirement is not met by interpreting the code in a memory safe runtime.
I think any rust user arguing this is being very silly. Rust was not designed with only memory safety as a priority. Performance was also a realllly big consideration for instance. If memory safety was all that mattered, we’d probably just use a linearly typed language w/ GC.
rust being able to leak memory and not guaranteeing that destructors run is fine™ because it doesn't violate memory safety. unwrap being used everywhere is fine™ because it's memory safe.
but now another language comes around and takes that exact same reasoning a step further and suddenly it's terrible because it doesn't guarantee any of the properties that rust also doesn't guarantee
I think it’s a false dichotomy. I vaguely dislike rust. I’ve written c code for years whose practice is “if you detect inconsistency, panic”. So I understand the Fil-C pitch, but that behavior is not actually what anyone except people writing filesystems are seeking.
Also, is anyone actually saying "Fil-C is terrible?" What I hear people saying is "The thing Fil-C does is different from the thing Rust does", which is unquestionably true.
I think Rust, the language, does more than the Rust fans praise it for. There is a subset of the community that understands unsafe and uses it for great results, ensuring pre-conditions for unsafe code are documented etc. Performance is a huge focus on the language side but neglected by many users.
(dunno if i really wanna wade into this ...) fil-c seems really impressive, and I don't think I would have thought what it did was possible before it was done.
but i also don't really wanna use it myself, I dislike C for reasons that go beyond UB, and I like rust for reasons that go beyond "safety"
i also don't really see them as competitors? I mean, I'm not actually sure how fil-c positions itself, exactly, but I'd think the use case would be "I have some legacy C code and I really need to run it with some kind of assurance about its security"
i like rust 'cause its type system makes it easy to reason about in a hard-to-pin-down-similar-but-not-quite-the-same-way as pure functional code is easy to reason about. and C isn't. the memory safety thing is just one of the more salient consequences
Tl;Dr creator of Zig announced they were gonna add memory safety by adopting the Fli-C approach as an optional ABI, and in that announcement they specifically said it would be "actually safe (unlike Rust)". With the further context being Bun's rewrite in Rust kicking off the whole "Zig vs Rust"...
Zig has some cool ideas, Fil-C too, but I really like the specific niche Rust has carved for itself as being aimed at library authors more than just application developers. An OK language with amazing libraries will always beat a great language with bad libs.
e.g. see very common loops with periodic (rare) flush or opaque call that the compiler doesn't unswitch in C++; you're required to reload the values of class fields, while in Rust you get single ownership (=> values don't change under your feet) for free. Great for performance.