tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] other applications of TCC


From: Mitchell N Charity
Subject: [Tinycc-devel] other applications of TCC
Date: Tue, 1 Jul 2003 11:52:56 -0400

  If you have interesting ideas on the application of TCC,
  please be kind to let me know! Thank you!

One potential application is using libtcc with "scripting" languages
like Perl, Python, Ruby, Tcl, and Lua.

All of these communities are exploring various ways of using C/C++.
Their motivation is both to use existing C/C++ libraries, and to
allow program hot-spots to be recoded in C/C++ for speed.  All
provide C api's, have a standard mechanism for C extensions (and
projects creating alternate ones), and can be embedded in C programs.
All are supported by SWIG (www.swig.org), and also have their own C
code scanning and glue generation capabilities.  All, except for Lua?,
have some project which provides automagic run-time glue creation,
compilation, and linking for C (though none are "mainstream").

Libtcc may be useful as a new extension tool, also as a new backend
for existing run-time tools, and also, perhaps, because of it's
simplicity (doesn't need to touch the filesystem), as a way of
creating run-time versions of existing non-run-time approaches.

Libtcc improvements which might help with this include support for
non-x86 cpus, stable gcc-like header parsing (it's has been improving,
and is now quite good, but there are still sometimes problems), and
incremental parsing (repeatedly parsing large C api headers sometimes
adds 100x to the compile times for small functions).

I have an unreleased version of perl's Inline::C which uses libtcc,
and also an unreleased multilingual package (currently Perl, Python,
and Ruby, with Tcl and Lua in progress) providing a bare-bones SWIG
wrapping of libtcc.  And Joerg Raedler is apparently working on a,
more thorough, module for Python.

My page http://www.vendian.org/mncharity/dir3/inline/ has some
speculative discussion of one possible use (objects having C apis,
and "conspiring to compile") of this run-time code generation
capability.  And the languages have documentation for their own,
regrettably isolated, approaches.  One place to start might be
http://www.rubygarden.org/ruby?UsingRubyWithOtherLanguages and
the pages for other languages which it links to.

But all this is something one might do with tcc/libtcc in the future,
rather than something one can do a nice demo of today.

Thank you for your work in support of tcc.
Please let me know if you have any questions.

Mitchell Charity




reply via email to

[Prev in Thread] Current Thread [Next in Thread]