Is there a REPL for C programming?

CRead Eval-Print-Loop

C Problem Overview


I am on osx. I found this http://neugierig.org/software/c-repl/ but the links on that page for code seem to be broken.

C Solutions


Solution 1 - C

Just found the IGCC (Interactive GCC) REPL. I like it.

Example:

./igcc

g++> int a = 1, b = 2;
g++> printf("%d\n", a + b);
3
g++> 

And it gives you compile errors like this:

g++> c = 3;
[Compile error - type .e to see it.]
g++> .e
<stdin>:14:1: error: use of undeclared identifier 'c'
c = 3;
^

(SF download: http://sourceforge.net/projects/igcc/files/)

Solution 2 - C

gdb makes a pretty good REPL. You can't define new functions there, but you can evaluate expressions (including those with side effects).

Solution 3 - C

Seems like the code of c-repl can now be found at a Github repository. It seems to be a dead project, though (last commit was 3 years ago), so I'd suggest looking into alternatives as well:

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSuryaView Question on Stackoverflow
Solution 1 - CsndView Answer on Stackoverflow
Solution 2 - CgcbenisonView Answer on Stackoverflow
Solution 3 - CNiklas B.View Answer on Stackoverflow