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

Re: how small is lightweight?



ISO C99 is a lightweight language. (OK, I'm not being serious.)

  $ wc -l src/tcc-0.9.18/*.c
*   879 src/tcc-0.9.18/bcheck.c
*   214 src/tcc-0.9.18/boundtest.c
*     8 src/tcc-0.9.18/ex1.c
*    97 src/tcc-0.9.18/ex2.c
*    23 src/tcc-0.9.18/ex3.c
*    24 src/tcc-0.9.18/ex4.c
*     8 src/tcc-0.9.18/ex5.c
   1102 src/tcc-0.9.18/i386-asm.c
    954 src/tcc-0.9.18/i386-gen.c
*   563 src/tcc-0.9.18/libtcc1.c
*    63 src/tcc-0.9.18/libtcc_test.c
    749 src/tcc-0.9.18/tccasm.c
   9760 src/tcc-0.9.18/tcc.c
   1962 src/tcc-0.9.18/tccelf.c
*  1899 src/tcc-0.9.18/tcctest.c
  18305 total

[Files marked with an asterisk could legitimately be excluded, bring the
total to less than 15KLOC.]

Scripting is possible:

   #!/usr/local/bin/tcc -run
   int main(void) {printf("hello, world\n");return 0;}

A sample execution:

   $ time tmp/helloworld.c
   hello, world

   real 0m0.005s
   user 0m0.002s
   sys  0m0.002s

The Tiny C Compiler's home page: http://fabrice.bellard.free.fr/tcc/

--- Vladimir

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