Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Searching for a C/C++ Interpreter written in pure Java

681 views
Skip to first unread message

Michael Hielscher

unread,
Jan 20, 2011, 4:41:00 PM1/20/11
to
For an education project we are looking for an interpreter for
different languages to be used inside Java-Applets (unsigned). So we
have the requirement of Java as implementation language and sandbox
restrictions at runtime.

We already found a few interpreters: Java (Beanshell), Scheme (SISC),
SQL (HSQLDB), Pascal (a new project on google code) we are still
looking for C or C++ interpreter that can meet our requirements.

Maybe somebody has already started or done a project in this direction
or has written a C/C++ grammar for a compiler compiler that produces
Java code.

Steven Shaw

unread,
Jan 23, 2011, 4:15:15 PM1/23/11
to
You could use Cint - the only C and C++ interpreter I know.

http://root.cern.ch/drupal/content/cint

To access from your Java applet you'd need JNI and a signed applet.

Alternatively, if you need to stay within safe/managed code, there are one or
two open source projects - who's names escape me unfortunately - that allow
you to compile your native app (usually using a cross compiler) and then load
and interpret the machine object code. Not fast, especially since your native
library is another interpreter, but it might be good enough and a fun hack to
boot!

Colin Paul Gloster

unread,
Feb 1, 2011, 7:55:20 AM2/1/11
to
Michael Hielscher sent:
|----------------------------------------------------------------------|
|"[..] |

| |
|Maybe somebody has already started or done a project in this direction|
|or has written a C/C++ grammar for a compiler compiler that produces |
|Java code." |
|----------------------------------------------------------------------|

Grammars for many languages including an approximation of C++ have
been available for the Java Compiler Compiler (JavaCC, not to be
confused with javac) for many years.

Steven Shaw sent:
|------------------------------------------------------------|


|"You could use Cint - the only C and C++ interpreter I know.|
| |
| http://root.cern.ch/drupal/content/cint |
| |

|[..]" |
|------------------------------------------------------------|

I advise against this. Do you actually use Cint? I use a codebase
by someone who uses ROOT (which officially Cint is not a part of,
though aside from early versions they are packaged together). ROOT is
very buggy.

Yours sincerely,
Colin Paul Gloster

Roberto Waltman

unread,
Feb 5, 2011, 12:37:10 PM2/5/11
to
Steven Shaw wrote:
>You could use Cint - the only C and C++ interpreter I know.
> http://root.cern.ch/drupal/content/cint

There is also UnderC, (not in Java):
http://home.mweb.co.za/sd/sdonovan/faq.htm

Translating it from C++ to Java is left as an exercise for the reader.

--
Roberto Waltman

0 new messages