Re: [tcljava-dev] JACL - Urgent help to make a design decision!
Brought to you by:
mdejong
From: Georgios P. <pet...@ya...> - 2004-12-14 21:32:56
|
Why not loading a Tcl interp inside Java? I suppose you can write a small C extension that does basic stuff (like creating an interp & evaluating a string as code) and use swig to generate a JNI wrapper? George ----- Original Message -----=20 From: "Neil Madden" <ne...@cs...> To: <tcl...@li...> Cc: "TclJavaUsers SourceForge" <tcl...@li...> Sent: Tuesday, December 14, 2004 10:00 PM Subject: Re: [tcljava-dev] JACL - Urgent help to make a design decision! Hello, Some answers below On 14 Dec 2004, at 19:34, Fernando M. Dagostini wrote: [...] > Needless to say that our first thought was to port the GUI > part of the application to the Java Client and reuse the > backend part entirely, with little adjustments, in the > Server. To accomplish this we would like to implement a > collection of simple Java/RMI classes =96 basically to map > remote client calls directly into Tcl procedures - and glue > them to via Jacl. > > So, Jacl would be extremely useful in the sense that: > > - Would save a lot of effort w/o having to port the backend > code. > - Clean design. > - Would fit as a glove into the new Server system. > > --- Questions/Problems: > > 1 =96 Is this really an approach that Jacl can support. > > 2 =96 I=92ve noticed that the =93package=94 command =93=85completely > implemented in Jacl.=94 as stated in the DIFFS.TXT file so, I > am assuming that I can load the Expect extension by issuing > the command =93package require Expect=94, is this correct? I'm afraid not. Expect is a compiled extension for C-based Tcl. It won't work with the pure-Java Jacl. You could use C Tcl/Expect as before and use the TclBlend extension (part of the same project as Jacl) which will allow you to load extensions written in Java into a normal Tcl shell. This is essentially the reverse of the situation you describe - instead of embedding Jacl into your application, structure the Java parts of your application into packages which can be loaded into Tcl via TclBlend. Another alternative is to try and port the parts of your app that use Expect to use Java or pure-Tcl/Jacl scripts. Depending on what you use Expect for this could range from trivial to insanely difficult/impossible. I don't know of any attempt to port Expect to Java/Jacl, and I doubt it is even possible. From what I gather, Expect does some very low-level magic, and it is quite likely that this sort of control isn't available in Java. |