LWN: Comments on "Fil-C: A memory-safe C implementation" https://lwn.net/Articles/1042938/ This is a special feed containing comments posted to the individual LWN article titled "Fil-C: A memory-safe C implementation". en-us Wed, 29 Oct 2025 01:59:37 +0000 Wed, 29 Oct 2025 01:59:37 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Fil-C for programmers https://lwn.net/Articles/1043895/ https://lwn.net/Articles/1043895/ rahulsundaram <div class="FormattedComment"> Fair point. Reducing friction to adoption could work if the performance impact is universally close enough.<br> </div> Wed, 29 Oct 2025 01:35:14 +0000 How is this different from tools like Valgrind and Address Sanitizer? https://lwn.net/Articles/1043884/ https://lwn.net/Articles/1043884/ cyperpunks <div class="FormattedComment"> So it's kind of small virtual machine with garbage collection that happens to be compatible with C/C++ based source code?<br> <p> </div> Tue, 28 Oct 2025 21:26:50 +0000 How is this different from tools like Valgrind and Address Sanitizer? https://lwn.net/Articles/1043878/ https://lwn.net/Articles/1043878/ excors <div class="FormattedComment"> From the readme:<br> <p> <span class="QuotedText">&gt; Fil-C is engineered to prevent memory safety bugs from being used for exploitation rather than just simply flagging them often enough to find bugs. This makes Fil-C different from AddressSanitizer, HWAsan, or MTE, which can all be bypassed by attackers. The key difference that makes this possible is that Fil-C is capability based (so each pointer knows what range of memory it may access, and how it may access it) rather than tag based (where pointer accesses are allowed if they hit valid memory).</span><br> <p> Clang says "AddressSanitizer's runtime was not developed with security-sensitive constraints in mind and may compromise the security of the resulting executable", so it should not be used in production.<br> <p> Valgrind has much worse performance (the manual claims 10-50x slowdown, plus it's effectively single-threaded), which is probably bad enough to make it unusable in production, and similarly will miss many memory safety bugs.<br> </div> Tue, 28 Oct 2025 20:33:26 +0000 How is this different from tools like Valgrind and Address Sanitizer? https://lwn.net/Articles/1043872/ https://lwn.net/Articles/1043872/ bertschingert <div class="FormattedComment"> Fil-C seems to be more similar to ASAN than Valgrind in that the compiler outputs code with the instrumentation / checking present, rather than running already compiled code in a virtual machine as Valgrind does.<br> <p> But it would seem to be more robust than ASAN; from reading about how ASAN works, it seems that it puts "poisoned" bytes around an allocation, so that memory accesses shortly after the end of a buffer hit those poisoned bytes and are caught. However, ASAN wouldn't catch an invalid access to a non-poisoned address of memory via a particular a pointer, if that address was allocated in a separate allocation. [1]<br> <p> I assume Fil-C's pointer capability model is able to catch "provenance" violations like that.<br> <p> [1] <a href="https://blog.gistre.epita.fr/posts/benjamin.peter-2022-10-28-address_sanitizer_internals/">https://blog.gistre.epita.fr/posts/benjamin.peter-2022-10...</a><br> <p> </div> Tue, 28 Oct 2025 20:28:01 +0000 How is this different from tools like Valgrind and Address Sanitizer? https://lwn.net/Articles/1043870/ https://lwn.net/Articles/1043870/ oldnpastit <div class="FormattedComment"> This seems to be run-time (as opposed to compile-time checking) - i.e. what Valgrind and ASAN do. Or have I misunderstood it?<br> </div> Tue, 28 Oct 2025 19:55:23 +0000 Fil-C for programmers https://lwn.net/Articles/1043856/ https://lwn.net/Articles/1043856/ rweikusat2 <div class="FormattedComment"> If this is just another C implementation, it's distribution packagers who would need to adopt it and possibly other people who routinely compile but not necessarily write code. <br> </div> Tue, 28 Oct 2025 18:34:02 +0000 Fil-C for programmers https://lwn.net/Articles/1043857/ https://lwn.net/Articles/1043857/ daroc <div class="FormattedComment"> I think the point of Fil-C, as a C implementation, is precisely to support the people and projects that are just going to keep using C — in a way that still lets users avoid memory safety issues if they so choose.<br> </div> Tue, 28 Oct 2025 18:32:49 +0000 Fil-C for programmers https://lwn.net/Articles/1043852/ https://lwn.net/Articles/1043852/ rahulsundaram <div class="FormattedComment"> <span class="QuotedText">&gt; I am interested in programmers rather than users because I think that influences whether Fil-C is just an interesting project for our moment or it becomes a "successor" to C in a way that Zig, Odin etc. never could.</span><br> <p> My expectation is that there isn't going to be a single successor to C. For some group of people, that was C++ a long time back. For others it is going to Rust or Zig or something else. For the final group they are going to keep coding in C forever and it will more of a generational change eventually.<br> </div> Tue, 28 Oct 2025 18:15:19 +0000 Fil-C for programmers https://lwn.net/Articles/1043850/ https://lwn.net/Articles/1043850/ tialaramex <div class="FormattedComment"> I'm interested in adoption of Fil-C by C and C++ programmers because for some years my assumption has been that most remaining C programmers in particular want DWIM and so they won't be any happier in Fil-C than in say (safe) Rust since these languages both lack the unconstrained Undefined Behaviour where DWIM thrives, if you write nonsense in Fil-C your program doesn't work and it's your fault which presumably was not what you meant. So widespread enthusiasm for Fil-C from C programmers would indicate that I was completely wrong, which would be a pleasant surprise.<br> <p> For users in a bunch of cases this is a no brainer, Daroc gave their shell as an example but I'm sure most of us run many programs every day where raw perf just isn't a big deal. I am interested in programmers rather than users because I think that influences whether Fil-C is just an interesting project for our moment or it becomes a "successor" to C in a way that Zig, Odin etc. never could.<br> </div> Tue, 28 Oct 2025 17:54:57 +0000