slcc
slcc is a fork of Fabrice Bellard's Tiny C Compiler (tcc) in which semicolons are optional and Python-style indentation can be used instead of braces. Normal C with semicolons still works and both styles can be mixed; it keeps -run and shebang support, can compile itself, and includes auto semicolon insertion implemented by replacing tcc's skip(';') calls. Built by the submitter mostly as a joke/experiment.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
slcc
slcc is a fork of Fabrice Bellard's Tiny C Compiler (tcc) in which semicolons are optional and Python-style indentation can be used instead of braces. Normal C with semicolons still works and both styles can be mixed; it keeps -run and shebang support, can compile itself, and includes auto semicolon insertion implemented by replacing tcc's skip(';') calls. Built by the submitter mostly as a joke/experiment.
Posted by @itzmetanjim · Original source ↗
Story title · @itzmetanjim · · Source ↗
Show HN: slcc, a C compiler that doesn't need semicolons or braces
Submitted URL · @itzmetanjim · · Source ↗
https://github.com/itzmetanjim/slcc
Source text · @itzmetanjim · · Source ↗
hi, i made this mostly as a joke. it started when i found that replacing (almost) all skip(';') in tcc with if(tok==';') skip(';') essentially adds some highly basic auto semicolon insertion.
Source text · @itzmetanjim · · Source ↗
so now it's a fork of tcc (fabrice bellard's tiny c compiler) where semicolons are optional and you can use indentation instead of braces
Source text · @itzmetanjim · · Source ↗
normal c with semicolons still works and you can mix both. -run and shebangs work like in tcc. it can compile itself
Source text · @itzmetanjim · · Source ↗
demo page with a few examples: https://tanjim.org/slcc/demo.html