Note
This project is incubating and is not ready to be used for anything.
"Augmented C" (AC) programming language will be a general purpose language meant to be backward compatible with C.
In this regard, I plan implement a functional C compiler that will be extended afterward. This compiler will emit C code to make it cross-platform.
Using C is very often frustrating so I'm just planning to create new extension/syntax/construct to get rid of this frustration. Other languages addressing this frustration exist however I'm not satified with their direction.
New language rely on FFI or LLVM to import C projects, however I want AC compiler to compiler C files without external dependencies and without need to create thin a wrapper from AC code.
In the long run, I want to be able to use AC as scripting language and the compiler should be several times faster than a standard C compiler. Some design choice as already been made around this (the preprocessor is done during parsing time, no need to run it beforehand) and future design choice will follow,
Since the project is in a very early stage, almost all features (C or AC) are currently missing.
You can check to TODO list to see what has been implemented already.
- Comprehensive preprocessor. GCC, MSVC and clang generate the most correct preprocessor output, but all other compilers I tried were generating incorrect output for some tests. I will create a pages to compare all the well known compilers.
- Basic type alias such as:
i8
i16
i32
i64
i128
for signed integer.u8
u16
u32
u64
u128
for unsigned integer.f32
f64
for floating point numbers.
- Nested procedures and types.
- dot operator as dereference operator.
a->b
should be equivalent toa.b
. ptr(int) a = NULL;
will be an alias forint *a = NULL
.arr(int, 10) a;
will be an alias forint[10] a;
.- All built-in operators or directives will be prefixed with
@
such as:@sizeof
@typeof
struct @align(4) @no_padding vector3 { ... }
Besides standard keywords all compile-time operators will be prefixed with@
(they can still be replaced with C macros).
- Alternative function declaration
- Generic functions
- Generic types
- Conditional access
- Concise if branches
- User-defined for loops. (@TODO)
- Enum bindings
- Declaration in conditions:
if (is_even(v)
{ int a = multiplied(v) } /* This a statement that do no return any boolean values. */
&& is_multiple_of_two(a))
{
/* Do something. */
}
- Underscores in number literals.
- Everything initialized with zero, unless explicit uninitialization.
- Compile-time evaluation via bytecode + VM.
Deprecated (and some optional) features in most recent C versions will likely never be implemented.
Examples:
- No exceptions.
- No package manager.
- No built-in slice type. They will likely be implemented in a standard library.
- No slice operator.
- No compilte-time reflection.
- No run-time reflection.
CB build system which consist of a c library to build c programs.
cl.exe cb.c
./cb.exe
cc cb.c -o cb
./cb