Hasty Briefsbeta

Bilingual

Fil-C: A memory-safe C implementation

6 months ago
  • #memory-safety
  • #compiler
  • #C-programming
  • Fil-C is a memory-safe implementation of C and C++ that allows existing C code to run safely without modification.
  • It is fanatically compatible with existing C code, making it suitable for retrofitting memory safety into applications.
  • Fil-C can compile an entire memory-safe Linux user space, with some modifications needed for complex programs.
  • The project is a fork of Clang, licensed under Apache v2.0 with LLVM exceptions, and is based on Clang version 20.1.8.
  • Fil-C uses 'InvisiCaps' for pointer handling, separating pointers into a trusted 'capability' piece and an untrusted 'address' piece.
  • It features a concurrent and parallel garbage collector, with minimal pauses for threads during collection.
  • Fil-C has been used to create a memory-safe version of Linux From Scratch (LFS), though some components still require a non-Fil-C compiler.
  • Performance overhead is notable but manageable, with some programs running only a few times slower than with Clang.
  • Fil-C does not support inter-language linking, such as with Rust, and requires all code to be recompiled with Fil-C.
  • The project is still relatively immature, with a single active contributor, but shows promise for making C programs memory-safe.