/cqc

C? compiler

Primary LanguageCBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

C? compiler (transpiler)

  • TODO

Roadmap

[ ] v0.1 in lua (for ease of prototyping) [ ] lexer (str -> tokens) [ ] parser (tokens -> ast) [ ] checker (ast -> ast with errors corrected / detected) [ ] transformer (ast -> ast of ANSI C) [ ] writer (ANSI C ast -> ANSI C code) [ ] v0.2 in C?

What is C?

  • A language that aims to be used on system level, but safer than C
  • Compiles to ANSI C, so all the tools you're familiar with should work
  • Introduces niceties from newer languages
  • Avoids ambiguity
  • No hidden control flow
  • Compatibility with C libraries
  • Inspirations from Rust and Zig

Project structure (in v0.2 -- not relevant yet)

  • src/ is where all the source files live
  • obj/ is where the compilation happens
  • The build is managed by redo (I use Leah's redo-c)