[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Jiang Wu
block any other
thread from calling "queueEvent()" because the two methods are synchronized
on the Notifier instance object.  The "vwait" command will cause the main
thread to wait inside TclBlend native code.  As a result, it does not
relinquish the lock on the Notifier instance object.  The fix is to remove
the use of the "synchronized" keyword.  Instead, use a private local mutex
object to protect the access to the event list inside the Nofier object.
When the code synchronizes on the local mutex object, never calls another
other methods that may block or uses other mutex.  This prevents deadlock.

4. In the class Notifier, the method "deleteEvents()" has a bug that it does
not properly set the "lastEvent" and "markerEvent" pointers when an event
from the middle of the event list is removed.  The fix is to move the event
deletion code from "serviceEvent()" into "deleteEvents()".  "serviceEvent()"
now uses "deleteEvents()" to delete processed event.  This reduces the
chances of error by removing redundant codes.



-- Jennifer Hom on March 17, 2000 10:50 PM


Type Defect 
State New 
Severity Critical: Major defect, no workaround 
Priority Unknown - Not yet prioritized 
Category Other 
OS Windows NT Windows NT 4 Dell Pentium II 450 Mhz 
Found in Version 1.2.6 
Fixed Date 2000-03-17 00:00:00 



-Original Message-
From: W. John Guineau [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 24, 2000 5:49 PM
To: Mo DeJong
Cc: Jiang Wu; [EMAIL PROTECTED]
Subject: RE: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

Hmm, this patch wouldn't happen to fix the following odd error I'm currently
chasing (below), would it?

=
C:\JTCCSRoot\ui\Automation>set bld=debug

C:\JTCCSRoot\ui\Automation>set
path=c:\jdk1.3\jre\bin;c:\jdk1.3\jre\bin\classic;C:\tcl\tcl8.3.1\win\debug;c
:\tcl\tcl8.3.1\lib\tclblend;.;C:\WINNT\system32;C:\WINNT;

C:\JTCCSRoot\ui\Automation>set
cp=C:\jdk1.3\jre\lib\rt.jar;.\classes;c:\tcl\tcl8.3.1\lib\tcljava.jar;c:\tcl
\tcl8.3.1\lib\tclblend.jar

C:\JTCCSRoot\ui\Automation>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

C:\JTCCSRoot\ui\Automation>java -classpath
C:\jdk1.3\jre\lib\rt.jar;.\classes;c:
\tcl\tcl8.3.1\lib\tcljava.jar;c:\tcl\tcl8.3.1\lib\tclblend.jar
scriptmanager.Scr
iptManager
Exception in thread "main" java.lang.NullPointerException
at tcl.lang.Interp.create(Native Method)
at tcl.lang.Interp.(Interp.java:130)
at scriptmanager.ScriptManager.main(ScriptManager.java:24)
EXP: tcl.lang.TclRuntimeError: could not find class java/lang/Object.
Check that your path includes the directory where tclblend.dll resides.
Try looking in the directories under the value of tcl_library,
currently: Currently, the CLASSPATH environment variable is not set.
=



 tclblend.patch


[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Mo DeJong

> Hmm, this patch wouldn't happen to fix the following odd error I'm currently
> chasing (below), would it?
> 
> Exception in thread "main" java.lang.NullPointerException
> at tcl.lang.Interp.create(Native Method)
> at tcl.lang.Interp.(Interp.java:130)
> at scriptmanager.ScriptManager.main(ScriptManager.java:24)

That looks like one of them. Jiang could speak to that better than I.

http://www.mail-archive.com/tcljava@scriptics.com/

> > I think you will find that in time, you
> > will toss out all your other JNI code and just use Tcl Blend
> > to do the "nasty JNI work". It is much easier to use Tcl or
> > IncrTcl to interface with C or C++ code.
> 
> Well, I doub't I'll toss the existing JNI code (read: I doub't I would get
> *paid* to!) but certainly sounds like a plan for any future JNI territory.
> Pulling one's own teeth would be more enjoyable than JNI ;) (well, maybe not
> quite that bad)

Thats funny, I was thinking that it would be more fun to poke myself in 
the eye with a pointy stick than write JNI code.

> But can the Java-based Tcl extensions "turn around" and call methods and
> access data of classes resident in the original Java VM instance (i.e. from
> where the Tcl interpreter was started via Tcl Blend/JNI)?

Yup, you can pass Java object handles around inside Tcl Objects. You
can wrap and unwrap them in Java code, and then call any Java methods 
you want. See the ReflectObject docs for info on how to do this.

http://dev.scriptics.com/man/java1.2/TclJavaLib/ReflectObject.htm

Mo DeJong
Red Hat Inc
 
> In other words: I want a Java application to create a Tcl interpreter and
> then have the Java extensions in that Tcl interpreter access objects/data in
> the "parent" Java application.
> 
> >From what I've read so far, I believe the answer is yes, but a sanity check
> is always good insurance.
> 
> john


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread W. John Guineau

Wow, same day response, and no noise! (oops ;) Great email list.

> -Original Message-
> From: Mo DeJong [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 24, 2000 5:13 PM
> To: W. John Guineau
> Cc: Jiang Wu; [EMAIL PROTECTED]
> Subject: Re: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL
>
>
> There are a bunch of posts on this Jacl vs Tcl Blend
> thread so I will try to respond to points from each.
>
>
> W. John Guineau Wrote:
>
> > We have a medium sized system (~250K lines of C++ and Java) that
> > we  want to graft Tcl scripting into.
> >



> >
> > Am I asking for trouble by "going against the grain" on this?
>
>
> The only problem you are going to run into is that Tcl Blend
> currently needs a patch before it can be loaded directly into
> Java. This patch will be merged into the CVS verison of
> Tcl Blend very soon. There is some ongoing discussion about
> how to do this best, so feel free to jump in with any
> thought you might have on JAVA_LOCK or any other Tcl Blend
> related issues.

Hmm, this patch wouldn't happen to fix the following odd error I'm currently
chasing (below), would it?

=
C:\JTCCSRoot\ui\Automation>set bld=debug

C:\JTCCSRoot\ui\Automation>set
path=c:\jdk1.3\jre\bin;c:\jdk1.3\jre\bin\classic;C:\tcl\tcl8.3.1\win\debug;c
:\tcl\tcl8.3.1\lib\tclblend;.;C:\WINNT\system32;C:\WINNT;

C:\JTCCSRoot\ui\Automation>set
cp=C:\jdk1.3\jre\lib\rt.jar;.\classes;c:\tcl\tcl8.3.1\lib\tcljava.jar;c:\tcl
\tcl8.3.1\lib\tclblend.jar

C:\JTCCSRoot\ui\Automation>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

C:\JTCCSRoot\ui\Automation>java -classpath
C:\jdk1.3\jre\lib\rt.jar;.\classes;c:
\tcl\tcl8.3.1\lib\tcljava.jar;c:\tcl\tcl8.3.1\lib\tclblend.jar
scriptmanager.Scr
iptManager
Exception in thread "main" java.lang.NullPointerException
at tcl.lang.Interp.create(Native Method)
at tcl.lang.Interp.(Interp.java:130)
at scriptmanager.ScriptManager.main(ScriptManager.java:24)
EXP: tcl.lang.TclRuntimeError: could not find class java/lang/Object.
Check that your path includes the directory where tclblend.dll resides.
Try looking in the directories under the value of tcl_library,
currently: Currently, the CLASSPATH environment variable is not set.
=

> I think you will find that in time, you
> will toss out all your other JNI code and just use Tcl Blend
> to do the "nasty JNI work". It is much easier to use Tcl or
> IncrTcl to interface with C or C++ code.

Well, I doub't I'll toss the existing JNI code (read: I doub't I would get
*paid* to!) but certainly sounds like a plan for any future JNI territory.
Pulling one's own teeth would be more enjoyable than JNI ;) (well, maybe not
quite that bad)

>
> Jeff Sturm Wrote:
>
> > You can certainly write extensions this way, but why not use the java
> > package, which is reflection based, instead?  I find it easier to just
> > invoke my methods directly from Tcl than to try to write a custom
> > extension.
>
> W. John Guineau Wrote:
>
> > Well, if I use the Java package, then the Tcl code would not
> > have access to
> > the same run-time instance of the JVM that our code is running in,
> right?
> > (starting our Java code from Tcl is, unfortunetly, not an option.)
> > Or am I missing something here?
>
> The java package is simply a library of utility commands that wrap
> the java.lang.reflect package. You can use the java package in both
> Jacl and Tcl Blend. Think of it this way, the java package is an API
> that gives you the ability to dynamically invoke Java methods and
> create Java objects from inside Tcl code. Both Jacl and Tcl Blend
> provide an implementation of the Java package, but the code is
> actually shared and does not "require" anything other than a JVM.
>
> So the answer is, you are both right. One could write all code
> that interacts with the JVM using the java::* Tcl commands, or
> you could write a Java extension that does the interaction.

But can the Java-based Tcl extensions "turn around" and call methods and
access data of classes resident in the original Java VM instance (i.e. from
where the Tcl interpreter was started via Tcl Blend/JNI)?

In other words: I want a Java application to create a Tcl interpreter and
then have the Java extensions in that Tcl interpreter access objects/data in
the "parent" Java application.

>From what I've read so far, I believe the answer is yes, but a sanity check
is always good insurance.

john

--

[Tcl Java] Re: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Mo DeJong

There are a bunch of posts on this Jacl vs Tcl Blend
thread so I will try to respond to points from each.


W. John Guineau Wrote:

> We have a medium sized system (~250K lines of C++ and Java) that
> we  want to graft Tcl scripting into.
>
> The place where we would integrate scripting is all Java code.
>
> I see the recommended solution in this case is to use JACL, but for
> performance reasons (and other factors) I would prefer to use Tcl 
> Blend. We already have a fairly significant JNI interface to
> common C++ code, so I'm
> quite familiar with JNI at this point (I see Tcl Blend also uses JNI.)
> 
> My plan is to load the Tcl interpreter from within Java, and
> then interact
> with it from Java. We would then write Tcl extensions that
> essentially wind
> thier way back into our Java code, and therefore have access to all the
> functionality we already have. We will also need to single step the
> interpreter and view/modify variables from within the Java code.
>
> Am I asking for trouble by "going against the grain" on this?


The only problem you are going to run into is that Tcl Blend
currently needs a patch before it can be loaded directly into
Java. This patch will be merged into the CVS verison of
Tcl Blend very soon. There is some ongoing discussion about
how to do this best, so feel free to jump in with any
thought you might have on JAVA_LOCK or any other Tcl Blend
related issues. I think you will find that in time, you
will toss out all your other JNI code and just use Tcl Blend
to do the "nasty JNI work". It is much easier to use Tcl or
IncrTcl to interface with C or C++ code.

Jeff Sturm Wrote:

> You can certainly write extensions this way, but why not use the java
> package, which is reflection based, instead?  I find it easier to just
> invoke my methods directly from Tcl than to try to write a custom
> extension.

W. John Guineau Wrote:

> Well, if I use the Java package, then the Tcl code would not
> have access to
> the same run-time instance of the JVM that our code is running in, 
right?
> (starting our Java code from Tcl is, unfortunetly, not an option.)
> Or am I missing something here?

The java package is simply a library of utility commands that wrap
the java.lang.reflect package. You can use the java package in both
Jacl and Tcl Blend. Think of it this way, the java package is an API
that gives you the ability to dynamically invoke Java methods and
create Java objects from inside Tcl code. Both Jacl and Tcl Blend
provide an implementation of the Java package, but the code is
actually shared and does not "require" anything other than a JVM.

So the answer is, you are both right. One could write all code
that interacts with the JVM using the java::* Tcl commands, or
you could write a Java extension that does the interaction.
There is a lot of flexibility, so the way you solve the problem
is really up to you. I would suggest that using the java::*
commands will be easier, as you can always prototype with the
java::* commands and then move to a Java implementation of
that prototype later.


W. John Guineau wrote:

> Ah, thank you for the document pointer! This looks to be the
> motherload  of Tcl Blend/JACL info!

If there is any part of the current documentation that seems confusing
or in need of a rewrite, please feel free to submit patches for the
existing documentation. Docs are easier to patch than code :)

Mo Dejong
Red Hat Inc.


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread W. John Guineau

Jeff, sounds like your experience confirms my initial analysis - It's a safe
bet to go the Java -> Tcl Blend direction.

BTW - this work is for JPL (Jet Propulsion Laboratory) - so you can add JPL
to the list of "large corporate/gov't users of Tcl and Tcl Blend ;) We will
be using Tcl to script our ground command and control system for a new
satellite due to launch in a few months. We will be doing the first ever
"lights out" (no humans) automation of a satellite!

john


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff
> Sturm
> Sent: Wednesday, May 24, 2000 3:29 PM
> To: W. John Guineau
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Tcl Java] Tcl Blend vs JACL
>
>
> "W. John Guineau" wrote:
> > Well, if I use the Java package, then the Tcl code would not
> have access to
> > the same run-time instance of the JVM that our code is running
> in, right?
>
> I don't see why not.  There is only one JVM per process anyway.  (That
> is a limitation of the Sun JVM.)  I'm not familiar with the code, but by
> executing AttachThread the Tcl interpreter can easily get a handle to
> the existing JNI environment.
>
> > (starting our Java code from Tcl is, unfortunetly, not an option.)
>
> Understood.  I am doing what you describe, except I haven't attempted to
> single-step the interpreter and I'm currently using Jacl, not TclBlend.
>
> I have a Java servlet that creates a pool of interpreters, each running
> in its own thread.  Each interpreter uses the java package and calls
> back to Java methods.  I haven't yet needed to write any custom
> commands, the java package is a "swiss army knife" that way.
>
>
> --
> Jeff Sturm
> [EMAIL PROTECTED]
>


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread W. John Guineau

Ah, thank you for the document pointer! This looks to be the motherload of
Tcl Blend/JACL info!

john

> -Original Message-
> From: Jiang Wu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 24, 2000 2:24 PM
> To: 'W. John Guineau'; [EMAIL PROTECTED]
> Subject: RE: [Tcl Java] Tcl Blend vs JACL
>
>
> You are certainly "going against the grain" right now :)  But I am hoping
> more people will use TclBlend this way.
>
> We are doing something similar right now with TclBlend (1.3 +
> some patches)
> with JDK 1.2.  I am not sure what you mean by "single step the
> interpreter".
> You can certainly set/get/call Tcl variables and commands within the Java
> code.  We also have a socket connection for the embedded Tcl interpreter.
> We use telnet to access the interpreter interactively for
> debugging.  We can
> also use Visual Cafe to single step through any Java portion of
> the program.
>
> There are some potential threading problems.  You also need to patch the
> existing TclBlend.  You may want to take a look at:
>
>   http://www-cs-students.stanford.edu/~jwu/Using_Tcl_in_Java.html
>
> which discuss how to embed Tcl in Java.
>
> -- Jiang Wu
>[EMAIL PROTECTED]
>
> -Original Message-
> From: W. John Guineau [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 24, 2000 2:09 PM
> To: [EMAIL PROTECTED]
> Subject: [Tcl Java] Tcl Blend vs JACL
>
>
>
> We have a medium sized system (~250K lines of C++ and Java) that
> we want to
> graft Tcl scripting into.
>
> The place where we would integrate scripting is all Java code.
>
> I see the recommended solution in this case is to use JACL, but for
> performance reasons (and other factors) I would prefer to use Tcl
> Blend. We
> already have a fairly significant JNI interface to common C++ code, so I'm
> quite familiar with JNI at this point (I see Tcl Blend also uses JNI.)
>
> My plan is to load the Tcl interpreter from within Java, and then interact
> with it from Java. We would then write Tcl extensions that
> essentially wind
> thier way back into our Java code, and therefore have access to all the
> functionality we already have. We will also need to single step the
> interpreter and view/modify variables from within the Java code.
>
> Am I asking for trouble by "going against the grain" on this?
>
> john
>
> 
> The TclJava mailing list is sponsored by Scriptics Corporation.
> To subscribe:send mail to [EMAIL PROTECTED]
>  with the word SUBSCRIBE as the subject.
> To unsubscribe:  send mail to [EMAIL PROTECTED]
>  with the word UNSUBSCRIBE as the subject.
> To send to the list, send email to '[EMAIL PROTECTED]'.
> An archive is available at
http://www.mail-archive.com/tcljava@scriptics.com


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] Re: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Jeff Sturm

"W. John Guineau" wrote:
> Well, if I use the Java package, then the Tcl code would not have access to
> the same run-time instance of the JVM that our code is running in, right?

I don't see why not.  There is only one JVM per process anyway.  (That
is a limitation of the Sun JVM.)  I'm not familiar with the code, but by
executing AttachThread the Tcl interpreter can easily get a handle to
the existing JNI environment.

> (starting our Java code from Tcl is, unfortunetly, not an option.)

Understood.  I am doing what you describe, except I haven't attempted to
single-step the interpreter and I'm currently using Jacl, not TclBlend.

I have a Java servlet that creates a pool of interpreters, each running
in its own thread.  Each interpreter uses the java package and calls
back to Java methods.  I haven't yet needed to write any custom
commands, the java package is a "swiss army knife" that way.


--
Jeff Sturm
[EMAIL PROTECTED]


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread W. John Guineau


Well, if I use the Java package, then the Tcl code would not have access to
the same run-time instance of the JVM that our code is running in, right?
(starting our Java code from Tcl is, unfortunetly, not an option.) Or am I
missing something here?

My assumption was that starting a Tcl interpreter from within a given JVM
would cause the Tcl Blend package on the Tcl side to use the existing JVM
and not create a new one. My goal is to:

1. start n number of Tcl interpreters from a Java application (n usually 1
or 2)
2. load and execute a Tcl script from within Java
3. load and *debug* a Tcl script from within Java (i.e. "single step" the
interpreter in trace mode, so the user can click a UI button (from a Java
client running across a TCP/IP link to the JAVA server code mentioned above)
to step through a Tcl script, examining variables along the way.
4. Write Tcl extensions in Java (or C/C++,) which can then access the JVM,
and hence all the Java Server code.

I suspect for 3. I will need to extend Tcl Blend's JNI implementation to
provide Java side access to Tcl_CreateTrace et al.

john


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff
> Sturm
> Sent: Wednesday, May 24, 2000 2:45 PM
> To: W. John Guineau
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Tcl Java] Tcl Blend vs JACL
>
>
> "W. John Guineau" wrote:
> > My plan is to load the Tcl interpreter from within Java,
> > and then interact with it from Java. We would then write
> > Tcl extensions that essentially wind thier way back into
> > our Java code, and therefore have access to all the
> > functionality we already have. We will also need to single
> > step the interpreter and view/modify variables from within
> > the Java code.
>
> You can certainly write extensions this way, but why not use the java
> package, which is reflection based, instead?  I find it easier to just
> invoke my methods directly from Tcl than to try to write a custom
> extension.
>
> --
> Jeff Sturm
> [EMAIL PROTECTED]
>


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] Re: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Jeff Sturm

"W. John Guineau" wrote:
> My plan is to load the Tcl interpreter from within Java, 
> and then interact with it from Java. We would then write 
> Tcl extensions that essentially wind thier way back into 
> our Java code, and therefore have access to all the 
> functionality we already have. We will also need to single 
> step the interpreter and view/modify variables from within 
> the Java code.

You can certainly write extensions this way, but why not use the java
package, which is reflection based, instead?  I find it easier to just
invoke my methods directly from Tcl than to try to write a custom
extension.

--
Jeff Sturm
[EMAIL PROTECTED]


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Jiang Wu

You are certainly "going against the grain" right now :)  But I am hoping
more people will use TclBlend this way.

We are doing something similar right now with TclBlend (1.3 + some patches)
with JDK 1.2.  I am not sure what you mean by "single step the interpreter".
You can certainly set/get/call Tcl variables and commands within the Java
code.  We also have a socket connection for the embedded Tcl interpreter.
We use telnet to access the interpreter interactively for debugging.  We can
also use Visual Cafe to single step through any Java portion of the program.

There are some potential threading problems.  You also need to patch the
existing TclBlend.  You may want to take a look at:

http://www-cs-students.stanford.edu/~jwu/Using_Tcl_in_Java.html

which discuss how to embed Tcl in Java.

-- Jiang Wu
   [EMAIL PROTECTED]

-Original Message-
From: W. John Guineau [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 24, 2000 2:09 PM
To: [EMAIL PROTECTED]
Subject: [Tcl Java] Tcl Blend vs JACL



We have a medium sized system (~250K lines of C++ and Java) that we want to
graft Tcl scripting into.

The place where we would integrate scripting is all Java code.

I see the recommended solution in this case is to use JACL, but for
performance reasons (and other factors) I would prefer to use Tcl Blend. We
already have a fairly significant JNI interface to common C++ code, so I'm
quite familiar with JNI at this point (I see Tcl Blend also uses JNI.)

My plan is to load the Tcl interpreter from within Java, and then interact
with it from Java. We would then write Tcl extensions that essentially wind
thier way back into our Java code, and therefore have access to all the
functionality we already have. We will also need to single step the
interpreter and view/modify variables from within the Java code.

Am I asking for trouble by "going against the grain" on this?

john


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com