Really, really wrong. But it works, and FAST.
[mccallister@knight mccallister]$ cat tcc-test
#!/usr/local/bin/tcc -run
#include
int main()
{
printf("Hello World\n");
return 0;
}
[mccallister@knight mccallister]$ time ./tcc-test
Hello World
real 0m0.019s
user 0m0.020s
sys 0m0.000s
[mccallister@knight mccallister]$
Check out the compile and execution time! on a p2-450
1 writebacks [/src/c] permanent link
Lots of One-Shot Code Generation
The last few days I have been doing a lot of sql, sql*loader, and pl/sql work; and have been trying out TextMate. It hasn't replaced vim for me, but is nice for projects, and nice for handling short one-shot scripts. I keep trying to use IDEA key bindings. D'oh.
The point isn't TextMate though, it is the pattern of behavior I found myself in. As going from doc -> sql -> control file ( cycle back to doc ) is very repetitive I found myself finally just pulling out info and firing off ruby scripts to generate lots of java, sql, and control files. This isn't anything new, not by a long shot. The interesting part was the frequency I was firing off code generation scripts for one-shot c&p, and how little time it took. Ruby and erb kick butt, and combined with an editor built around playing with scripts, it was really efficient.
In the past most of my code generation has been regenerate-at-build-time style, not one-shot c&p into existing files. Was interesting. Ah well, off to chug through more fun stuff =)