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

Re: how small is lightweight?



>>>>> "SD" == Steve Dekorte <steve@dekorte.com> writes:

  > That's impressive. Is there any way to use Tcc in library form?
  > Something like:

  > functionPointer =  tccCompileFunction(tccContext, cCode);

There is a tcc library for runtime code generation. From the docs:

   The libtcc library enables you to use TCC as a backend for dynamic
   code generation.

   Read the `libtcc.h' to have an overview of the API. Read
   `libtcc_test.c' to have a very simple example.

   The idea consists in giving a C string containing the program you
   want to compile directly to libtcc. Then you can access to any global
   symbol (function or variable) defined.

--- Vladimir

------------------------------------------------------------------------
Vladimir G. Ivanovic                        http://leonora.org/~vladimir
2770 Cowper St.                                         vladimir@acm.org
Palo Alto, CA 94306-2447                                 +1 650 678 8014