Forum OpenACS Development: CriTCL, compile C code on the fly within TCL - any experience?

I have been reading up on CriTCL, which uses the local system compiler to create and load a C-compiled extension from within TCL.

See: http://mini.net/tcl/2523

I know that there are certain parts of OACS that might benefit from this, but before I start playing with it I was wondering if anyone had any experience with this code at all; let alone playing with it inside AOLserver.

I think the C function is limited to one argument, I hope I'm wrong, but I think that is when I stopped reading. :(

not sure where you saw that... one of the examples (after following a couple links) says
  cproc add {int x int y} int {
    return x + y;
  }
I played with it some but got stuck.

basically how critcl works is the cproc method (as well as ccommand) sets up some global stuff, then calls the "define" proc, which adds an entry to ::auto_index telling the interpreter it can get the method by calling critcl::cbuild.

this works great from the commandline, but nsd ignores the ::auto_index and errors with "invalid command name" when you try to invoke anything.  cbuild never gets called.  I can invoke it manually so it's not a problem with cbuild.  (If it were, there should be an "error while autoloading..."  message.)

auto_index has zero documentation (unless you call "Used by auto_load to save the index information read from disk." documentation) so it's hard to debug...  for fun I ran "grep -ri auto_index" in the nsd source tree but came up with nothing.

nsd 3.5.1, tcl 8.4.1, btw.

In February I asked about critcl in the aolserver weekly chat. Nobody had a guess what was wrong except that "the tcl model in nsd4 is much better." I tabled the idea until I had time to try the latest beta, which was today. Googling for "aolserver critcl" came up with

http://www.mail-archive.com/aolserver@listserv.aol.com/msg05034.html

where Zoran Vasiljevic mailed the aolserver list his findings with nsd4 after my question. It does seem to work fine; i'll be trying more tests as soon as I can figure out why ns_db is erroring out. :0