Cex.C - Comprehensively Extended C Language

No dependency, cross-platform, single header C language extension. Making old C cexy again!

Features

Single header C file

Still C source code, clang or gcc is all you need. No other dependencies.

Integrated build system

Write build logic in C, cross-platform build system. No more CMake pain.

Better C experience

Type safe and generic data structures, better strings, better IO, new memory management.

Developer Friendly

Easy to start, easy to debug, LSP friendly. Tools for making your project cexy.

Code quality tools

Unit test engine, sanitizers and fuzzer support out of the box.

New way of doing C

Introducing modern practices: error handling, namespaces, type system, memory allocators, and more...

C vs Cex.C

C

  • Bare-bone language with DIY nature
  • Bug prone manual memory management
  • Overcomplicated 3rd party build systems
  • Loose error handling and no tracebacks
  • Opt-in code quality tools

Cex.C

  • Type safe data structures, strings, IO
  • Allocator driven memory management with scoping
  • Builds itself, no dependencies, cross-platform builds
  • Convenient error handling with tracebacks
  • Unit tests, sanitizers and fuzzer included

Cex.C Philosophy

  • Never depends

    Dependencies is a curse for a long-term longevity of a project. With Cex all is you need to start is a modern C compiler (gcc/clang) and cex.h file.

  • Simplicity is a virtue

    Cex tries to make old C better, but without reinventing new compiler and tool chain.

  • Developer experience first

    Cex maintains tool-set which helping you in building, testing and maintaining your project seamlessly.

  • Long-term conservatism

    Projects built with Cex should be compilable out of the box after 10 years they were released.

  • 80/20 Principle

    Cex is focusing on smooth coding experience with solving 80% of generic problems. If you need something too fast, too small, too specialized - do it yourself, tailor other 20% for your specific needs.

Install Cex.C

Quick new CEX project

# 1. Make new project directory

mkdir myproj && cd myproj

# 2. Run automatic project initialization

curl -fsSL https://cex-c.org/install.sh | bash

# or

wget https://cex-c.org/install.sh -O - | bash

Manual Installation

# 1. Make new project directory

mkdir myproj && cd myproj

# 2. Download CEX

curl -O https://cex-c.org/cex.h

# or

wget https://cex-c.org/cex.h

# 3. Prime build system

gcc -D CEX_NEW -x c ./cex.h -o cex

# or

clang -D CEX_NEW -x c ./cex.h -o cex

# 4. Create boilerplate project

./cex