Thread: [tcljava-dev] Re: tjc runtime compiler
Brought to you by:
mdejong
From: Martti T. <ma...@da...> - 2006-02-15 17:57:17
|
> From: Mo DeJong <md...@un...> > A new runtime Tcl proc compiler API has been added to the CVS version of Jacl. > This runtime compiler will take a Tcl procedure as input and generate Java > byte code that will work the same way as the original Tcl proc. Previously, > the TJC compiler only worked as a separate ahead of time compiler. > Great work. I have come up with a few minor problems running on a Linux system. I carried out the configure-make-install steps. - jaclsh installed in /usr/local/bin requires the MINGW check to be commented out. Also the JACL_CLASSPATH doesn't include the java compiler janino.jar. - jdk.cfg installed in /usr/local/bin uses ":" the linux path separator but only works if you change it to use the Windows path separator ";". Again janino.jar is missing. - running the hello world example doesn't work in jaclsh unless you create a link to the janino.jar file in the current working directory even after adding it to all the CLASSPATH's. It is installed in /usr/local/lib/tcljava1.3.2 by make install. I was unable to get runtime compilation to work in an application because it can't find the janino.jar file. Maybe I am missing some step in the make procedure or some other PATH needs to be fixed up. Cheers -- Martti Tienhaara (ma...@da...) DASH Software Ltd. |
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. |
From: Mo D. <md...@un...> - 2006-03-27 00:04:45
|
On Wed, 15 Feb 2006 22:52:28 -0800 Martti Tienhaara <ma...@da...> wrote: > 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. As far as I know, the only way that would happen is if your interp is not processing events in the Tcl event queue. If that is the case, then you could test this by setting up and after event and then testing to see if it got processed. See the documentation and the Shell.java class for examples of how a thread should grab an event off the Tcl event queue and process it. Mo DeJong |
From: Mo D. <md...@un...> - 2006-02-15 20:34:12
Attachments:
paths.patch
|
On Wed, 15 Feb 2006 09:59:30 -0800 Martti Tienhaara <ma...@da...> wrote: > > From: Mo DeJong <md...@un...> > > > A new runtime Tcl proc compiler API has been added to the CVS version of Jacl. > > This runtime compiler will take a Tcl procedure as input and generate Java > > byte code that will work the same way as the original Tcl proc. Previously, > > the TJC compiler only worked as a separate ahead of time compiler. > > > Great work. Thanks for testing Martti > I have come up with a few minor problems running on a Linux system. I > carried out the configure-make-install steps. > > - jaclsh installed in /usr/local/bin requires the MINGW check to be > commented out. Also the JACL_CLASSPATH doesn't include the java compiler > janino.jar. > > - jdk.cfg installed in /usr/local/bin uses ":" the linux path separator > but only works if you change it to use the Windows path separator ";". > Again janino.jar is missing. > > - running the hello world example doesn't work in jaclsh unless you > create a link to the janino.jar file in the current working directory > even after adding it to all the CLASSPATH's. It is installed in > /usr/local/lib/tcljava1.3.2 by make install. 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. Mo DeJong |