<div dir="ltr"><div>Hello everyone!<br><br>I have finally written and uploaded the first version of Alien::TinyCC and the second version of C::TinyCompiler. I am spamming all of you because either (1) it seems appropriate for the list or (2) I think that you might be interested based on personal conversations we've had.<br>
<br></div><div><u>The Tiny C Compiler</u> is a small, fast, nearly C99 compliant C compiler written for Linux and Windows, which can also compile object code on Mac (but cannot produce Mach-O executables or dylibs). It targets 32- and 64-bit Intel instruction sets as well as ARM architectures. The compiler is very fast, but what you get in compile-time speed you lose in non-optimized machine code. However, it's still machine code, and it offers a library that includes functionality for compiling arbitrary strings of C code at runtime! For development, see <a href="http://savannah.nongnu.org/projects/tinycc">http://savannah.nongnu.org/projects/tinycc</a>.<br>
<br><u>C::TinyCompiler</u> provides an interface to using that just-in-time compilation capability, as well as a framework for building reusable components in the system. If you are using one of the major platforms and have to generate code at runtime, this will probably be a better tool for you than Inline::C. If your C code is static, the one-time hit for compilation will pay for itself with the caching mechanism, and the code will execute faster, so you're better off sticking with Inline::C in that case. For development, see <a href="https://github.com/run4flat/perl-TCC">https://github.com/run4flat/perl-TCC</a>.<br>
</div><div><br><u>Alien::TinyCC</u> installs  the Tiny C Compiler to a non-invasive location which is almost certainly not in the user's path, but the module itself fiddles with $ENV{PATH} and, possibly, $ENV{LD_LIBRARY_PATH} to ensure that the compiler and its main library are available within the Perl environment that invokes the module. Note that this module does not pay any attention to a local install of tinycc, it *always* installs tcc under the distribution sharedir for Alien::TinyCC. For development, see <a href="https://github.com/run4flat/Alien-TinyCC">https://github.com/run4flat/Alien-TinyCC</a>.<br>
<br><u>New as of this morning</u> is the Alien module, and the modification to C::TinyCompiler to use it. Now C::TinyCompiler has a decent chance of building and operating on the most popular systems. I expect to hit a few bumps, of course, so I am writing to solicit <u>testing and feedback</u>.<br>
<br></div><div>Please spread the word to any and all who might be interested. Also, there is plenty of room for improving C::TinyCompiler, especially fleshing out C::TinyCompiler::Perl as well as making C::TinyCompiler::Callable more efficient.  I would also be happy to see modules that provide C::TinyCompiler interfaces to C libraries.<br>
<br></div><div>Thanks!<br>David<br clear="all"></div><div><div><div><br>-- <br> "Debugging is twice as hard as writing the code in the first place.<br>
   Therefore, if you write the code as cleverly as possible, you are,<br>
   by definition, not smart enough to debug it." -- Brian Kernighan<br>
</div></div></div></div>