Is there an interpreter for C? [closed] Is there an interpreter for C? [closed] c c

Is there an interpreter for C? [closed]


There are many - if you narrow down the scope of your question we might be able to suggest some specific to your needs.

A notable interpreter is "Ch: A C/C++ Interpreter for Script Computing" detailed in Dr. Dobbs:

Ch is a complete C interpreter thatsupports all language features andstandard libraries of the ISO C90Standard, but extends C with manyhigh-level features such as stringtype and computational arrays asfirst-class objects.

Ch standard is freeware but not open source. Only Ch professional has the plotting capabilities and other features one might want.

I've never looked at this before, but having a c interpreter on hand sounds very useful, and something I will likely add to my toolset. Thanks for the question!


Edit:

Just found out that one of my favorite compilers, TCC, will execute C scripts:

It also handles C script files (justadd the shebang line"#!/usr/local/bin/tcc -run" to thefirst line of your C source code fileon Linux to have it executed directly.

TCC can read C source code fromstandard input when '-' is used inplace of 'infile'. Example:

echo 'main(){puts("hello");}' | tcc -run -


picoc - A very small C interpreter

PicoC is a very small C interpreter for scripting. It was originally written as the script language for a UAV's on-board flight system. It's also very suitable for other robotic, embedded and non-embedded applications.


the ROOT project provides a very functional C and C++ interpreter called Cint. I'm quite fond of it. It takes a little getting used to interpretively, though.

TCC is a very good choice as well, but i'm not able to vouch for its REPL