Advanced Programming Course Project | Systems programming models, safety, and performance.
This repository accompanies the C12 project for the Advanced Programming course. The project presents a comprehensive comparative study of C, C++, and Rust.
A structured comparison documented in the report covering memory models, type systems, and safety guarantees.
Minimal examples demonstrating how the same low-level problems are handled across languages.
code/
βββ π¦ c/ # Manual allocation (malloc/free), pointers, return codes
βββ πͺ cpp/ # RAII, templates, smart pointers, exceptions
βββ π¦ rust/ # Ownership, borrowing, lifetimes, Result/Option| Feature | C | C++ | Rust |
|---|---|---|---|
| Abstraction | Minimal (Macros/Structs) | High (Classes/Templates) | Strict (Traits/Generics) |
| Error Handling | Return Codes | Exceptions (Try/Catch) | Algebraic (Result/Option) |
| Pointers | Raw Pointers (Unsafe) | Smart Pointers (Safer) | References (Borrowing) |
| Memory | Manual (malloc/free) |
RAII (Destructors) | Ownership & Lifetimes |
The full technical report, including detailed analysis and discussion of design trade-offs, is available here:
π Download Project Report (PDF)
Developed as part of the Advanced Programming curriculum.
The practical examples highlight key language-level trade-offs:
- Abstractions: How macros compare to templates and traits in systems programming.
- Error Handling: Traditional return codes vs. exception handling vs. robust type-safe Results.
- Memory Management: Manual allocation (C) vs. automatic cleanup via RAII (C++) vs. compile-time ownership (Rust).
- Pointer Usage: Raw pointer arithmetic vs. safer smart pointers vs. strict borrowing rules.