IGCC is a small python wrapper around GCC. https://git.cafkafk.com/cafkafk/igcc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Christina ab7799808a Update 'README.org' 5 months ago
libigcc Fixed license in REPL and version bumped to 0.3 5 months ago
test Allow specifying lib directories and libs to link against on the command line. 14 years ago
.gitignore Ehh, this works lol 6 months ago
LICENSE Initial commit 6 months ago
Makefile Ehh, this works lol 6 months ago
README.org Update 'README.org' 5 months ago
igcc.py Ehh, this works lol 6 months ago
test-igcc Removed debugging output 5 months ago
test-igcc-slow Passes test-igcc 5 months ago


Interactive GCC

Interactive GCC (igcc) is a read-eval-print loop (REPL) for C/C++ programmers.

It can be used like this:

$ ./igcc
g++> int a = 5;
g++> a += 2;
g++> cout << a << endl;
g++> --a;
g++> cout << a << endl;

It is possible to include header files you need like this:

$ ./igcc
g++> #include <vector>
g++> vector<int> myvec;
g++> myvec.push_back( 17 );
g++> printf( "%d\n", myvec.size() );
g++> myvec.push_back( 21 );
g++> printf( "%d\n", myvec.size() );

Compile errors can be tolerated until the code works:

$ ./igcc
g++> #include <map>
g++> map<string,int> hits;
g++> hits["foo"] = 12;
g++> hits["bar"] = 15;
g++> for( map<string,int>::iterator it = hits.begin(); it != hits.end(); ++it )
[Compile error - type .e to see it.]
g++> {
[Compile error - type .e to see it.]
g++> 	cout << it->first << " " << it->second << endl;
[Compile error - type .e to see it.]
g++> }
bar 15
foo 12

Extra include directories can be supplied:

$ ./igcc -Itest/cpp -Itest/cpp2
g++> #include "hello.h"
g++> hello();
g++> #include "world.h"
g++> world();

Libs can be linked:

$ ./igcc -lm
g++> #include "math.h"
g++> cout << pow( 3, 3 ) << endl; // Actually a bad example since libm.a is already linked in C++

Your own libs can be linked too:

$ ./igcc -Itest/cpp -Ltest/cpp -lmylib
g++> #include "mylib.h"
g++> defined_in_cpp();
defined_in_cpp saying hello.

The cstdio, iostream and string headers are automatically included, and the std namespace is automatically in scope.

Downloading and installing

Clone the repository over either https or ssh.


git clone https://git.cafkafk.com/cafkafk/igcc.git


git clone git@ssh.cafkafk.com:cafkafk/igcc.git


Navigate to the repository you cloned.

cd igcc

From here, use the makefile to install the program.

make install

This will install the program into ~/.local/bin/, you can change that with the PREFIX env variable to the make install command.

After installing, if the installation folder is in your path, you can run the program like you would run any other program on your system.


Then type the C++ code you want to execute. It will be compiled with GCC and the results (if any) will be displayed.

Type .h to see some (minimal) help.


IGCC is a small python wrapper around GCC.

Check out the code here:

git clone git@ssh.cafkafk.com:cafkafk/igcc

Or browse the source here:



IGCC home page: https://git.cafkafk.com/cafkafk/igcc

Old IGCC home page: http://www.artificialworlds.net/wiki/IGCC/IGCC

Andy Balaam's home page (original author of igcc): http://www.artificialworlds.net

Andy Balaam's blog (original author of igcc): http://www.artificialworlds.net/blog


The current maintainer for this fork is cafkafk, contact through https://cafakfk.com


This software is redistributed under the AGPLv3, forked from the original source.

The original IGCC is Copyright (C) 2009 Andy Balaam

IGCC is Free Software released under the terms of the GNU Affero General Public License version 3 or later.

IGCC comes with NO WARRANTY.

See the file LICENSE for more information.