On Fri, Jul 01, 2005 at 01:26:09PM -0700, Fred Cox wrote: > > You could always simply call the Tcl APIs from C. > > Is there any documentation on how to do that?
It's in the Tcl docs, e.g.: http://tcl.activestate.com/man/tcl8.4/TclLib/Eval.htm Basically you want Tcl_EvalObjEx(). In the old Tcl 7.x (and earlier) style, you'd build up Tcl code in a string and then call Tcl_EvalEx() on it. That still works, and is slightly easier to understand (so you might want to try it), but it and all the other string-based Tcl C APIs have been deprectated for a long time now in favor the Tcl_Obj APIs introduced with Tcl 8.x. So now you'd use one of the Tcl_EvalObj*() commands instead. > > > I would prefer to use C, since I don't currently know Tcl, and > > > I am developing for a fairly low end machine. Btw, how low end is this machine exactly? And what is your application doign? > > IMNSHO that is an incredibly bad reason to use C, especially with > > AOLserver, and especially if you plan to write code using > > AOLserver on an ongoing basis. > > Is this because you have a bad impression of C, or because it > AOLserver doesn't work well with C? Neither. Writing new C code for AOLserver works quite well, in large part because of all the existing nice C APIs. (Indeed, I'd hate to do multi-threaded C programming solely with the POSIX thread APIs. What AOLserver gives you is built on POSIX threads underneath, but much nicer.) But there's a reason Jim D. and the other AOLserver guys integrated a high level, powerful, simple, and easy to learn scripting language very early on in AOLserver. Tcl is there in AOLserver because it's makes development vastly more productive than coding in C alone. There are many good reasons to use C with AOLserver, but "I don't want to bother to learn any Tcl at all." is not one of them. No doubt other higher-level languages (Python, Scheme, Ruby, etc.) could also work well in AOLserver, but (for largely historical reasons) Tcl is by far the best supported, and also happens to be very easy to learn, so unless you have strong pre-existing committment to some other scripting language, and are also willing to devote some time to fixing up or improving that languages integration with AOLserver, I recommend just learning Tcl. Now, don't let this stop you! If you insist on coding solely in C you won't be any worse off using AOLserver for that than in any OTHER server environment, and from what I've heard you might well be significantly BETTER off with AOLserver. (I can't say for sure, as I lack hands-on experience writing C for Apache or any other app server other than AOLserver. I know some others here have done so though, so perhaps they will chime in.) And you're certainly you're not hurting any of US by doing all your coding in C! Indeed, you might help us out by brushing the cobwebs off a few of the little-used corners of the AOLserver C API - as you've already done already. I merely want to point out that, "I will develop with AOLserver using only C, no Tcl, no other higher level languages of any kind.", although certainly doable, is unlikely to be the OPTIMAL development path for almost any project. So, now that you've actually read through my bordering-on-language-war screed above, what is it exactly that you most want to do with AOLserver? That's probably more interesting to you. :) -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
