Home > Archive > Tcl > September 2006 > Porting Tcl/Tk to Java
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Porting Tcl/Tk to Java
|
|
|
| Hi, everyone,
I just got this question e-mailed to me. I don't know the answer
(excepf for "Don't port to Java - keep it in Tcl/Tk!"). Does anyone
else?
"I searched around the web, but cannot find any definitive answer. My
question is ... I have alot of tcl/tkl code which was used in
developing a GUI some time ago. ...and my tcl/tkl is very rusty...
about 10 years or so. My customer is looking to port this code over to
Java ... do you know of any automated tools that can help do the
translation???"
Thanks!
Eric
| |
| Cameron Laird 2006-09-25, 7:02 pm |
| In article <1159208832.047770.299190@d34g2000cwd.googlegroups.com>,
EKB <eric@kb-creative.net> wrote:
>Hi, everyone,
>
>I just got this question e-mailed to me. I don't know the answer
>(excepf for "Don't port to Java - keep it in Tcl/Tk!"). Does anyone
>else?
>
>"I searched around the web, but cannot find any definitive answer. My
>question is ... I have alot of tcl/tkl code which was used in
>developing a GUI some time ago. ...and my tcl/tkl is very rusty...
>about 10 years or so. My customer is looking to port this code over to
>Java ... do you know of any automated tools that can help do the
>translation???"
| |
| nyllet 2006-09-26, 8:40 am |
| EKB wrote:
> Hi, everyone,
>
> I just got this question e-mailed to me. I don't know the answer
> (excepf for "Don't port to Java - keep it in Tcl/Tk!"). Does anyone
> else?
>
> "I searched around the web, but cannot find any definitive answer. My
> question is ... I have alot of tcl/tkl code which was used in
> developing a GUI some time ago. ...and my tcl/tkl is very rusty...
> about 10 years or so. My customer is looking to port this code over to
> Java ... do you know of any automated tools that can help do the
> translation???"
Hi
I'm actually doing my thesis work in this area: a compile time
translator of Tcl code to Java. It will be released under GPL later
this year. However, I'm afraid it has some limitations that may make it
inapplicable for your purpose. It supports Tcl only, ie no Tk. Tcl
commands that would require threads or reflection in Java are not
implemented. Dynamical scoping, that is upvar and uplevel, are not
supported. Tcl scripts that exploits the weak typing of Tcl look clumsy
in Java, especially with generics. It targets Tcl 8.5. Furthermore, the
more the Tcl scripts rely on runtime properties, the harder it gets to
generate high quality Java code.
Still the forthcoming tool, named laugh, is useful as a translation aid
for many Tcl scripts, at least IMHO. If you want to become a beta
tester, please send me a mail
Regards
Martin
| |
| Neil Madden 2006-09-26, 8:40 am |
| EKB wrote:
> Hi, everyone,
>
> I just got this question e-mailed to me. I don't know the answer
> (excepf for "Don't port to Java - keep it in Tcl/Tk!"). Does anyone
> else?
>
> "I searched around the web, but cannot find any definitive answer. My
> question is ... I have alot of tcl/tkl code which was used in
> developing a GUI some time ago. ...and my tcl/tkl is very rusty...
> about 10 years or so. My customer is looking to port this code over to
> Java ... do you know of any automated tools that can help do the
> translation???"
In addition what others have mentioned (e.g., use of Jacl), I would also
point you at Swank (http://www.onemoonscientific.com/swank/index.html)
which is a port of Tk for Jacl/Java, which uses Swing. It may also be
worth looking at the TJC compiler that is part of the same project as
Jacl (http://tcljava.sf.net). This is a Tcl (Jacl) -> Java bytecode
compiler. IIRC, it may use Java sourcecode as an intermediate language.
While the generated source may be quite ugly, it may serve as a starting
point.
(Note for Tcl-URL! authors: TJC surely deserves to be product of the
w at some point, if it hasn't already been...)
-- Neil
| |
|
| Thanks, everybody! I passed all of these comments along to the person
who had sent me the e-mail, and also let her know about comp.lang.tcl.
Eric
|
|
|
|
|