All Projects → alexandru-dinu → igcc

alexandru-dinu / igcc

Licence: GPL-3.0 license
Interactive GCC - C/C++ REPL.

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Labels

Projects that are alternatives of or similar to igcc

Codi.vim
📔 The interactive scratchpad for hackers.
Stars: ✭ 2,464 (+6384.21%)
Mutual labels:  repl
Ipython
Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
Stars: ✭ 15,107 (+39655.26%)
Mutual labels:  repl
crosis
A JavaScript client that speaks Replit's container protocol
Stars: ✭ 85 (+123.68%)
Mutual labels:  repl
Unrepl
A common ground for better Clojure REPLs
Stars: ✭ 222 (+484.21%)
Mutual labels:  repl
Tslab
Interactive JavaScript and TypeScript programming with Jupyter
Stars: ✭ 240 (+531.58%)
Mutual labels:  repl
sliver
REPL for SilverStripe, powered by Psysh. Interactively debug and tinker with a sliver of your code.
Stars: ✭ 17 (-55.26%)
Mutual labels:  repl
Gluon
A static, type inferred and embeddable language written in Rust.
Stars: ✭ 2,457 (+6365.79%)
Mutual labels:  repl
moleculer-repl
REPL module for Moleculer framework
Stars: ✭ 24 (-36.84%)
Mutual labels:  repl
Go Pry
An interactive REPL for Go that allows you to drop into your code at any point.
Stars: ✭ 2,747 (+7128.95%)
Mutual labels:  repl
fundot
The Fundot programming language.
Stars: ✭ 15 (-60.53%)
Mutual labels:  repl
Lfortran
Official mirror of https://gitlab.com/lfortran/lfortran. Please submit pull requests (PR) there. Any PR sent here will be closed automatically.
Stars: ✭ 220 (+478.95%)
Mutual labels:  repl
Mond
A scripting language for .NET Core
Stars: ✭ 237 (+523.68%)
Mutual labels:  repl
dotnet-repl
A polyglot REPL built on .NET Interactive
Stars: ✭ 522 (+1273.68%)
Mutual labels:  repl
Vsh
vsh - HashiCorp Vault interactive shell and cli tool
Stars: ✭ 209 (+450%)
Mutual labels:  repl
gorilla-repl
A fork of Jony Epsilon's rich REPL for Clojure in the notebook style.
Stars: ✭ 22 (-42.11%)
Mutual labels:  repl
Ldb
A C++ REPL / CLI for LevelDB
Stars: ✭ 201 (+428.95%)
Mutual labels:  repl
swiftreplmadness
Example of using your own packages in the Swift REPL
Stars: ✭ 18 (-52.63%)
Mutual labels:  repl
go-notebook
Go-Notebook is inspired by Jupyter Project (link) in order to document Golang code.
Stars: ✭ 33 (-13.16%)
Mutual labels:  repl
blac
bitFlyer Lightning API Console
Stars: ✭ 16 (-57.89%)
Mutual labels:  repl
elasticsearch-cli
Provides a REPL console-like interface to interact with Elasticsearch
Stars: ✭ 15 (-60.53%)
Mutual labels:  repl

Interactive GCC

workflow contrib gitpod Code style: black

NOTE: This is forked from https://sourceforge.net/projects/igcc/. I have done some refactoring and ported it to Python 3.7. I am currently maintaining it.

  • Interactive GCC (igcc) is a read-eval-print loop (REPL) for C/C++
  • A default libigcc/boilerplate.h header is included, with <bits/stdc++.h>, using namespace std;, and some helper functions
  • For configuration (mainly related to compiling) see config.yaml

Running

git clone https://github.com/alexandru-dinu/igcc.git
cd igcc
pip install -r requirements.txt
./igcc -I libigcc

The code will be compiled with GCC and the results (if any) will be displayed. Type .h for help:

[  1] igcc> .h
.L List the whole program as given to the compiler
.e Show the last compile errors/warnings
.h Show this help message
.l List the code you have entered
.q Quit
.r Redo undone command
.u Undo previous command

Usage

Simple usage:

$ ./igcc -I libigcc
[  1] igcc> int a = 5;
[  2] igcc> a += 2;
[  3] igcc> cout << a << endl;
7
[  4] igcc> --a;
[  5] igcc> cout << a << endl;
6

Include header files:

$ ./igcc -I libigcc
[  1] igcc> #include <vector>
[  2] igcc> vector<int> xs = {1,2,3};
[  3] igcc> xs.push_back(17);
[  4] igcc> xs.pop_back();
[  5] igcc> printf("%u", xs.size());
3

Compile errors can be tolerated until the code works:

$ ./igcc
[  1] igcc> for (int i = 0; i < 10; i++) {
Compile error - type .e to see it OR disregard if multi-line statement(s)

[  2] igcc> cout << i << " ";
Compile error - type .e to see it OR disregard if multi-line statement(s)

[  3] igcc> }
0 1 2 3 4 5 6 7 8 9

Libs can be linked:

$ ./igcc -I libigcc -lpthread
[  1] igcc> #include <pthread.h>
[  2] igcc> pthread_t thr;
[  3] igcc> const char* msg = "Hello, World!";
[  4] igcc> // assuming print_msg is defined somewhere
[  5] igcc> int ret = pthread_create(&thr, NULL, print_msg, (void*) msg); pthread_join(thr, NULL);
Hello, World!

Links

Credits

  • Andy Balaam may be contacted on axis3x3 at users dot sourceforge dot net
  • IGCC is Copyright (C) 2009 Andy Balaam
  • IGCC is Free Software released under the terms of the GNU General Public License version 3
  • IGCC comes with NO WARRANTY
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].