fastc 0.1.0

A safe C-like language that compiles to C11
Documentation

FastC

A safe C-like language that compiles to C11.

FastC is a source-to-source transpiler that emits standard C11 code. It removes common C footguns while keeping the C toolchain, ABI, and performance model intact.

Features

  • Safe by default - Null safety with opt(T), bounds-checked arrays, explicit unsafe blocks
  • C11 output - Works with any C compiler (gcc, clang, MSVC)
  • Zero runtime overhead - No garbage collector, no hidden allocations
  • C interop - Call C functions, expose APIs to C, use existing libraries

Installation

# Build from source
cargo install --path .

# Or build the workspace
cargo build --release

Usage

# Compile FastC to C
fastc compile input.fc -o output.c

# Generate header file
fastc compile input.fc -o output.c --emit-header

# Build and compile to executable
fastc build --cc

# Build and run
fastc run

Example

// hello.fc
fn main() -> i32 {
    return 0;
}
fastc compile hello.fc -o hello.c
cc -I /path/to/fastc/runtime hello.c -o hello
./hello

Documentation

License

This project is licensed under the MIT License.