[tcljava-dev] Re: tjc runtime compiler
Brought to you by:
mdejong
From: Martti T. <ma...@da...> - 2006-02-16 06:50:13
|
> From: Mo DeJong <md...@un...> > > The attached patch should fix these issues. The janino.jar file should > not actually appear on the CLASSPATH as it is loaded via the > TclClassLoader off of the env(TCL_CLASSPATH). Trouble was, the code > was >not looking in the right place. The attached patch should fix > that too. Thanks Mo. The patch fixed up all the reported problems. I am now able to compile jacl commands on the fly in a server app that we are developing. The server runs a jacl interpreter for every client that logs in and each interpreter sources the individual jacl commands via the "unknown" command whenever they are required. Compiling each command as required inside the "unknown" command seems to work well. Because the "unknown" command also eval's the requested command immediately after starting compilation the first eval uses source interpretation. After a few seconds when the command is accessed again it executes up to 10 times faster with some crude "time script" measurements. Since we are using 100's of jacl commands to provide user modifiable functionality it is fabulous that we can have them compiled, unloaded and recompiled dynamically without restarting the server. The only minor problem so far is that the "-readyvar" option on TJC::compile never returns a result in the server. It does return correctly in jaclsh. We are running jacl in a beanshell environment and the interpreters are started by the beanshell manager. We also have some difficulty getting jacl exceptions back via the beanshell environment so we will investigate this area. Cheers -- Martti Tienhaara (ma...@da...) DASH Software Ltd. |