the c2 programming language
Please see C2Lang.org for more info about C2!
The C2 project attempts to create a new language, strongly based on C. In a nutshell, the main differences with C are:
Below are the instructions for building and using the C2Compiler.
Have fun! (and code..)
C2 is based on LLVM 7.0 and some parts of Clang 7.0. The design of C2C's Parser and ASTBuilder classes are heavily based on clang's Parser and Sema class, so hereby my thanks to the Clang folks!
A short list of open items (the full list would probably fill-up GitHub) with their priority:
Read the installation document for installation on Linux or OSX. For Windows installation, see windows installation document.
By default, c2c will only parse and analyse the targets. Generating C-code should work on all examples, but generating LLVM's IR code is work in progress. In the examples directory: (or add -d examples/)
c2c multi
c2c hello
c2c puzzle
c2c -I working_ir
It's also possible to manually compile a single .c2 file without a recipe file with:
c2c -f <file.c2>
To generate ANSI-C code, use:
c2c -C <target>
The C2 compiler is able to generate a package dependency file in dot format. This file can be converted into a png as follows:
c2c --deps <target>
dot -T png output/target/deps.dot > image.png
To see all available options, run:
c2c -h
c2tags is C2's version of ctags. This tool is used by vim (e.a.) to "jump to definition". See the installation document on how to install.
How it works is as follows:
Just like c2c itself, c2tags can be called from any (sub)directory in the project tree.