Skip to content

itcodehery/Borcom-Tool-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caw Banner

Caw: Borrow Checker for C

Caw is a project aimed at bringing Rust's powerful memory safety guarantees—specifically the Borrow Checker—to the C programming language.

The Vision

Modern C development is plagued by memory safety issues such as use-after-free, double-free, and data races. Rust solved these problems through ownership and borrowing. Caw aims to replicate this functionality for C, providing a static analysis tool that can verify ownership semantics and enforce safety rules without the overhead of a garbage collector.

Watch the Video

Watch the making of this project on YouTube: YouTube

Caw Development Video

Current Status

The project is in its early stages. Currently, it features:

  • C Parser: A custom-built recursive descent parser (implemented in Rust) capable of tokenizing and parsing C structures including functions, control flow (if, while, for), and expressions.
  • Static Analysis Engine: Enforces ownership rules and detects unused variables to prevent memory safety issues and clean up code.
  • CLI Interface: A user-friendly command-line interface (powered by clap) to validate .c files.

Roadmap

  • Initial C Lexer and Parser implementation.
  • Support for more complex C syntax (structs, pointers, etc.).
  • Static analysis engine for tracking ownership.
  • Lifetime inference for C variables.
  • Integration with build systems.

Quick Start

To parse a C file:

cargo run -- --file your_file.c

Contributing

I am in the early stages of development and I'm open to contributions from those interested in compilers, static analysis, and systems safety.

About

Attempt to bring the Borrow Checker to C

Topics

Resources

Stars

Watchers

Forks