
SWE @ meta. Prev aerospace embedded/safety critical. LLVM contributor, clang, lldb. Static analysis proponent. Created Safe-C, pipx, gdbgui, other things.
Joined January 2022
- Tweets594
- Following212
- Followers509
- Likes4.3K
"Rust-level memory safety for C and C++ in Clang " submitted to LLVM's clang discussion board discourse.llvm.org/t/rust-le…
Safe-C just crossed 200 ⭐️s on GitHub!
There is interest in this project because it disrupts the status quo: Rust is no longer the only path to memory safety for systems code, and decades of C and C++ codebases can be evolved rather than rewritten.
The project is early and prioritizes memory safety over ergonomics: a missed memory error is treated as a bug, while some correct code is still rejected (no false negatives, some false positives). User feedback is super helpful to ensure there is enough expressiveness in the rules, and to identify false positives.
Today's releases include fixes from user-reported issues (please file more!):
- Linux: glibc bugs fixed
- Compile time no longer grows with array size
- Correct code that was refused now compiles, with clearer errors
Also new:
- libc calls are now checked on Linux too (glibc, musl, picolibc), not just macOS
- Safe C++ ships with thread safety rules
github.com/safe-c-project/sa…
Safe-C just crossed 100 ⭐'s on GitHub. Thank you for your interest in the project.
Now go try it out and file some issues!
github.com/safe-c-project/sa…
🚨 Calling C devs and security researchers 🚨
safecc is a Clang fork for C: if it compiles your program, it is guaranteed to be memory safe (similar to Rust).
I tried all day yesterday to get it to accept a program that has any kind of unsafe memory access and cannot do it: 8,330 cases, 10,000 programs, and core rules in Lean.
I need people to try to break safecc. If you can get an ASAN violation or non-panic crash under these conditions, please report an issue.
1. Use the `safecc` compiler
2. No __unsafe annotations in your code, no safecc cli flags to turn checks off
github.com/safe-c-project/sa…
Fil-C creator 🤯www.nitter.cf/filpizlo/status/212833…
Super cool
github.com/safe-c-project/sa…
10
1,050
The Fil-C legend himself! 🙏
Super cool
github.com/safe-c-project/sa…
Safe-C just crossed 100 ⭐'s on GitHub. Thank you for your interest in the project.
Now go try it out and file some issues!
github.com/safe-c-project/sa…
🚨 Calling C devs and security researchers 🚨
safecc is a Clang fork for C: if it compiles your program, it is guaranteed to be memory safe (similar to Rust).
I tried all day yesterday to get it to accept a program that has any kind of unsafe memory access and cannot do it: 8,330 cases, 10,000 programs, and core rules in Lean.
I need people to try to break safecc. If you can get an ASAN violation or non-panic crash under these conditions, please report an issue.
1. Use the `safecc` compiler
2. No __unsafe annotations in your code, no safecc cli flags to turn checks off
github.com/safe-c-project/sa…
The project is basically as far as I can get it on my own. I need people to test it, use it, and give feedback on it. If you work on C code are interested in safety guarantees, I would be grateful if you gave it a try and gave any feedback.
Safe C is a new project to make C as safe as Rust. It has a new home at github.com/safe-c-project, and a playground to try it in your browser
It's still C, plus a few compiler-specific macros. Other compilers see plain C while Safe C uses the macros. It catches use after free, double free, leaks, out-of-bounds access, null derefs and uninitialized reads.
The rules are proven in Lean. Code without __unsafe that the compiler accepts has no UB or memory violations.
Playground: safe-c-project.github.io/pla…
C has been getting more memory safety features in clang.
You can now express buffer sizes, lifetimes, and which lock guards which data.
This is a great start, but I believe C, of all languages, can get far closer to Rust-level safety than anyone realizes. 🧵
So can we make C as safe as Rust? Not yet. This proof of concept doesn't cover concurrency, may be unsound, and I probably missed things.
But by leveraging clang features and adding new ones, it gets much closer than standard C, maintains compatibility, and is still just C.
1
9
362
Should this direction be pursued further? Would love to know your thoughts!
github.com/cs01/llvm-project…



