Compile C++ to TCL

S

ScratchMonkey

I'm working on a system which exposes TCL scripting but looks to be
difficult to extend with a native binary. I need to build a "front end" for
it that has lots of complicated data structures and can benefit from strong
typing, so C++ is a more natural choice for implementation. Does there
exist a C++ compiler that generates TCL as its output?
 
M

Mike Wahler

ScratchMonkey said:
I'm working on a system which exposes TCL scripting but looks to be
difficult to extend with a native binary. I need to build a "front end" for
it that has lots of complicated data structures and can benefit from strong
typing, so C++ is a more natural choice for implementation. Does there
exist a C++ compiler that generates TCL as its output?

I don't know of any offhand, but afaik, Comeau
Computing ( www.comeaucomputing.com )
does custom compilers. You might want to write to Greg:
http://www.comeaucomputing.com/faqs/contacts.html

-Mike
 
B

Bob Techentin

ScratchMonkey said:
I'm working on a system which exposes TCL scripting but looks to be
difficult to extend with a native binary. I need to build a "front end" for
it that has lots of complicated data structures and can benefit from strong
typing, so C++ is a more natural choice for implementation. Does there
exist a C++ compiler that generates TCL as its output?

I have never heard of a C++ compiler that emits any scripting
language.

If you want some of the data structures of C++, look at the Incr Tcl
extension. It provides classes and objects with a distinctly C++
flavor. Other OO systems, such as Xotcl or Snit might be better
suited if you can't link the Itcl shared library to your existing
binary.

Bob
 
G

Georgios Petasis

Perhaps you are looking for swig?
(http://www.swig.org).
Swig can parse most of your C/C++ headers
and create automatically wrappers for scripting
languages that expose your C/C++ code in that language.
It does not "compile" your C/C++ into another language,
it just wraps your code and exposes it into the scripting
language...

George
 
I

Ira Baxter

ScratchMonkey said:
I'm working on a system which exposes TCL scripting but looks to be
difficult to extend with a native binary. I need to build a "front end" for
it that has lots of complicated data structures and can benefit from strong
typing, so C++ is a more natural choice for implementation. Does there
exist a C++ compiler that generates TCL as its output?

Not that I know of. C++ is very complex, it is difficult to
belive that TCL would be a friendly target for all that complexity,
and I can't see the economic value of compiling into TCL.
I suspect some would argue you should compile the other way.

What you could consider doing is to define you own "dialect" of
TCL which requires strong typing, checks the types, and
then translates that to vanilla TCL.

If you wanted to do that, you might consider using the DMS
Software Reengineering Toolkit, generalized compiler technology
that handles many langauges. It doesn't presently
have a TCL front end, but given its track record of
"absorbing" other languages (like C++), that isn't
an issue. Using a TCL front end, you could define
the type checker and run it on user input.

See http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html.
 
D

David Gravereaux

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top