Forum OpenACS Q&A: Using [incr Tcl] with AOLserver

Collapse
Posted by Dan Mascenik on
I've been experimenting with [incr Tcl] for a while now, and I'd like to add its functionality to an OpenACS site that I'm running (www.particlewave.net). Whenever I start off a .tcl file with package require Itcl, however, I get this error:

can't find package Itcl
    while executing
"package require Itcl"

Obviously AOLserver's Tcl interpreter is lacking in some of the configuration that tclsh got, but how can I fix that? I thought AOLserver just invoked the local interpreter, but I guess I was wrong.

Any help would be vastly appreciated!

Collapse
Posted by Dan Wickstrom on
Aolserver has its own tcl interpreter compiled in, and there are some well-known problems with using package require in Aolserver/Tcl. See this thread for a work-around. You might also try searching the bboards to see if you can find out if anybody has successfully used [incr tcl] with aolserver. I know that Xotcl has been used successfully with aolserver. See this thread for more details.
Collapse
Posted by Jonathan Ellis on
Has anyone written up steps to drop xotcl, incr tcl, or even just a newer version of vanilla tcl into aolserver?
Collapse
Posted by Dan Mascenik on
Thanks Dan,

I got [incr Tcl] to work using the hack from that first thread - at least part of the time.

As I type, Jonathan's response just came in, and I guess I'm asking the same question.  Is there anyway I could recompile AOLserver to include the [incr Tcl] libraries in its Tcl interpreter?

Collapse
Posted by Dan Wickstrom on
I once saw a cookbook step-by-step guide for using xotcl with aolserver.  The posting might have been here or on the aolserver mailing list.  Try writing Neophytos, as I know he has used xotcl with aolserver.

As far as compiling [incr tcl] with aolserver, I don't know.  I haven't looked at it.  It probably wouldn't be too difficult to turn [incr tcl] into an aolserver module, but somebody would need to look at to make sure that it is designed for multi-threaded operation.

Collapse
Posted by defunct defunct on
The last time we looked at this (approx 18 months ago) [incr TCL] appeared NOT to be thread safe.
Collapse
Posted by Dan Mascenik on
Believe it or not, I'm actually interested in some of the non-thread-safe properties of [incr Tcl] running with AOLserver.  To test thread safety, how did you get the two to work together?  Did you need to call "package require Itcl" in the private Tcl libraries, or were you able to make this one of the default packages available with AOLserver's Tcl interpreter?  Or did you need to call "package require Itcl" on the individual pages where [incr Tcl] was being used?
Collapse
Posted by defunct defunct on
I seem to remember (and its a while ago) that the hack we has to use was essentially sourcing in the IncrTCL stuff as part of thread initiation, to avoid thre issues. The rather crappy penalty with that was that it implied continual resourcing of the entire incr TCL stuff, every time a new thread/interpreter was created...

Other than that I'm afraid its beed wiped from my mind with beer and cigarettes ;)

Peter Harper may remember, he's on these bboards, so will probably respond if he reads this.. (if only to highlight how crap I am at remembering this stuff ;)...

Collapse
Posted by Jonathan Ellis on
I contacted Neophytos as Dan W. suggested after being unable to find xotcl information either here or on the aolserver list. Neophytos replied:
First of all, XOTcl *is* thread safe -- Zoran made sure that it is. All you have to do in order to use xotcl under aolserver is to apply a simple patch on your aolserver source code, replace namespace.tcl with the file provided in the patch, and copy another xotcl-specific file in the patch under your modules/tcl directory. The patch is available on the xotcl website with detailed information.

Zoran has been using XOTcl for his company projects and it is also used by Gustaf Neumann and his students/collaborators at the University of Economics and Business Administration (WU) in Vienna, Austria. I've been using XOTcl for the past few months (since Feb'02) and I plan to use more of XOTcl for the development of a new-system that I've designed this summer.

... You might also want to join the xotcl mailing list (low-traffic) or contact Gustaf and Zoran -- both are very friendly and they have intimate knowledge about systems development.

The patch Neophytos mentions is available at the xotcl download page. Here is the readme.
Collapse
Posted by defunct defunct on
I wouldn't know about xoTCL..... I was referring to incr TCL.... does anyone know if this is thread safe???
Collapse
Posted by Jonathan Ellis on
well, yes; nobody is confusing incr tcl and xotcl :0

fwiw, some googling turned up this wiki and this thread claiming recent incr tcl versions are threadsafe...

Collapse
Posted by Dan Mascenik on
Well, I only ever got [incr Tcl] to work on a single page and even then it was only every other hit or so that it actually worked.  This isn't very useful and I still haven't been able to get [incr Tcl] to load at server startup so that it's available to all the threads.

Hmmm, I haven't seen any posts from Peter Harper on here yet.  If you're out there, Mr. Harper, could you tell me how you hooked up [incr Tcl] to AOLserver?

Collapse
Posted by defunct defunct on
Dan,

He's on customer site. I'll buzz him and try and get him to post up for you ....

Collapse
Posted by Peter Harper on
Hi folks,

Yeh, we have done this before, but it was about 3 years ago. I'll have a look around at some old backups and see what I can dig out. As mentioned in another post a few months back, it involved compiling stuff into Aolserver during installation, and subsequent hacking of its tcl interpretter initialisation routine. I'm pretty sure we've got an old machine here with an original working installation of the Aolserver/[incr]Tcl server. We only ever used it for demo's in the end as we weren't too sure about.

  • Its stability
  • Its thread-safeness
  • Its overall usefulness for the type of development we were doing, particularly its inability to share objects across interpreters (i.e., threads). This being caused by the way Aolserver manages interpreters and threads.
We were pretty new to Aolserver (and [incr] Tcl) at the time, so many of these issues may have been resolved, but I doubt it judging from the lack of concrete answers on the subject. I'll post up more information as and when I find it.
Collapse
Posted by Dan Mascenik on
Hi Peter, thanks for looking that up for me!