NAME

C::TinyCompiler - Full C JIT compiling using the Tiny C Compiler

These are Perl bindings to the Tiny C Compiler (TCC). TCC is a very fast, very small, and nearly compliant C-99 compiler. Some benchmarks claim that TCC compiles 7x faster than GCC. TCC does not apply the same sorts of optimizations as GCC, mind you, but it still compiles to machine code. Another important feature of TCC is that it can compile a string of C code to machine code without writing to file. In other words, it can be used as a Just In Time C compiler!

If you do not yet see my point, then consider this: Perl has excellent string manipulation facilities. By combining Perl's ability to manipulate strings and TCC's ability to quickly compile C code, we have an easy, fast way to dynamically generate machine code. Perl's bytecode is fast, of course, but for certain numerical work, this can lead to operations that are orders of magnitude faster.

(Though, admitedly, I don't yet have the benchmarks to prove my point.)

INSTALLATION

This module depends on Alien::TinyCC, so you must install that first with something like:

cpan Alien::TinyCC
cpanm Alien::TinyCC

Once you have those installed, simply download the contents of this distribution from the Github repo (http://github.com/run4flat/perl-TCC) or download and unpack the latest tarball from the Download link on the left of the distributions page at http://https://metacpan.org/module/C::TinyCompiler. Once you have the code, run:

perl Build.PL
./Build
./Build test
./Build install

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the perldoc command.

perldoc C::TinyCompiler

You can also look for information at:

AUTHOR

Written by David Mertens, <dcmertens.perl at gmail.com>

LICENSE AND COPYRIGHT

Portions of this code are copyright 2011-2013 Northwestern University. Portions of this code are copyright 2013 Dickinson College. Documentation copyright 2011-2013 David Mertens.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.