Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Migration to 8.6: What about Itcl/Itk

125 views
Skip to first unread message

Uwe Schmitz

unread,
Mar 22, 2018, 8:48:00 AM3/22/18
to
TCLers,

we are trying to migrate our Tcl applications to 8.6.
Here are some critical dependencies:

- Itcl -- many self written packages/classes
- Itk -- some self developed widgets
- Iwidgets -- use of e.g. canvasprintdialog
- own developed (mingw/msys based) binary 32bit extensions

This in mind I need some clarifications concerning
some questions.

What is the state of Itcl4?
It seems to be stable and first tests seem promising
to me.

What about Itk?
Is there an official Itcl4 based implementation or should
I stay with Itcl3.4/Itk3.4?

For a first test under Windows I've tried the
awesome Bawt distribution. Itcl seems to be ok.
But there is no Itk. Through the wiki I've found
http://chiselapp.com/user/rene/repository/itk.
An "itcl4 only itk replacement". But this gives an
error when the first itk_option command is executed:

wrong # args: should be "protected command ?arg arg...? or wrong command name"
while executing
"protected method itk_configbody body {eval $body}"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list protected method itk_configbody {body} {eval $body}]"
(procedure "itk_option" line 16)
invoked from within
"itk_option define -padx padX Pad 5"
(class "iwidgets::Buttonbox" body line 8)
invoked from within
"itcl::class iwidgets::Buttonbox {
inherit itk::Widget

constructor {args} {}
destructor {}

itk_option define -pady padY Pad 5
<snip>

This is the result of "package require iwidgets 4".
Of course I've used the modified package from
http://chiselapp.com/user/rene/repository/iwidgets/.

Therefore I'm a little bit confused. Should I still
use Itcl3 under 8.6?

Any advice is greatly appreciated.

Thanks in advance
Uwe

Don Porter

unread,
Mar 22, 2018, 3:30:56 PM3/22/18
to
On 03/22/2018 08:47 AM, Uwe Schmitz wrote:
> we are trying to migrate our Tcl applications to 8.6.
> Here are some critical dependencies:
>
> - Itcl -- many self written packages/classes
> - Itk -- some self developed widgets
> - Iwidgets -- use of e.g. canvasprintdialog
> - own developed (mingw/msys based) binary 32bit extensions

For you and for other users of Iwidgets, let me offer a roadmap of advice.

Your target should be to get your applications running with this set of
packages:

Tcl/Tk 8.6.8, Itcl 4.1.1
https://sourceforge.net/projects/tcl/files/Tcl/8.6.8/
Itk 4.1.0
https://sourceforge.net/projects/incrtcl/files/%5Bincr%20Tcl_Tk%5D-4-source/itk%204.1.0/
Iwidgets 4.1.1 (just released)
https://sourceforge.net/projects/incrtcl/files/[Incr%20Widgets]/4.1.1/

If you're feeling lucky and you're really pressed for time, you might
try just installing that collection of software and see how your apps
deal with it. If it all works, then you're done!

However, if you have some time, and in the fairly likely probability
that you will run into some difficulty along the way that we would very
much like to pin down, I would suggest you do the migration a step at a
time so that when the trouble arises the cause can be located more easily.

I'll start from an assumption that you have apps that are working well
for you on top of a combination of dependencies that look like this:

Tcl/Tk 8.4.$something
Itcl/Itk 3.4.$something
Iwidgets of some unknown vintage.

and you want to move from that to my recommended modern foundation.

Step 1: Update to Iwidgets 4.1.1.

This will deliver bug fixes, and coding updates so that Iwidgets can
deal with things like changing [clock] operations in Tcl 8.5 and other
evolutions in Tcl over the years. I expect this to work without trouble.
If this update does not work, report why as best you can determine. If
it does work, move on to...

Step 2: Update to Itcl 3.4.3 and Itk 3.4.2.

Get those here:
https://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-source/Itcl%203.4.3/
https://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-source/Itk%203.4.2/

You may already have these versions, but if you do not, make sure you
get updated to these latest patch releases. You need them before you can
move to Tcl 8.6. I expect this to work without trouble. If this update
does not work, report why as best you can determine. If it does work,
move on to...

Step 3: Update to Tcl/Tk 8.6.8.

If you've done the steps above first, and if your own apps do not
contain rare bits of (ill-advised) code, I expect this to work without
trouble. If this update does not work, report why as best you can
determine. If it does work, move on to...

Step 4: Update to Itcl 4.1.1 and Itk 4.1.0.

This is where I expect the greatest chance of having trouble. And if it
turns out that you have troubles so great you cannot yet make this
update, that would be a decent place to be, since you would at least be
up to date in your Tcl, Tk, Iwidgets pieces, and advanced to the best of
the 3.4.* offerings for Itcl and Itk. Also, if you can determine a
concrete reason why Itcl 4.1.1 and Itk 4.1.0 do not work well enough for
your needs, we can get a ticket in place so there's some hope that later
releases will provide what you need.

Step 5: Try using the post-4.1.1 bug fixes for Itcl.

If you look at the timeline of Itcl 4 development.

http://core.tcl.tk/itcl/timeline

you will see that a number of bug fixes have been made since the Itcl
4.1.1 release. It's possible your apps are harmed by one of those, and
you will find success either fetching those development sources, or
waiting until they are packaged up and released as Itcl 4.1.2, maybe
within a few months.

With that recipe laid out, I'll return to your questions:

> What is the state of Itcl4?

Itcl 4.1 has me as the most active maintainer. I get occasional
assistance from a handful of others. I have never been an Itcl
programmer. I have no experience to tell me what expectations and needs
an Itcl programmer has, and what features and fixes should have priority
over others. My metric of "does Itcl 4 work" is whether it passes the
test suites of Itcl, Itk and Iwidgets. It does. If Itcl 4.1 is not
doing what you need, I need a ticket telling me exactly what, so it can
become a test, so we can know when a fix is right. A ticket is
necessary, but not sufficient. If a quirk of Itcl 3 behavior is too
ill-advised, or too difficult to adapt to the Itcl 4 foundations, I may
refuse to "fix" it, but I will always try to at least assess it, and
largely speaking, the aim is for Itcl 4 to be an Itcl 3 replacement.
Those tickets are best submitted here:

http://core.tcl.tk/itcl/tktnew

You need to sign in to submit a ticket, though you may use an anonymous
account if it matters to you.

> What about Itk?

See download sites above. There are forks out there as well. I'm sure
they get the job done for some people, but they've not been the right
approach for me, mostly because they've not kept up test suites, and I
am highly dependent on test suites.

> For a first test under Windows ...

All my offerings are in source code form. I'm afraid I cannot offer any
help at all turning that into running libraries and programs on Windows.
If you are dependent on others to make binaries, there's not much more I
can do to help.

> Should I still use Itcl3 under 8.6?

The latest patch releases of Itcl/Itk 3 run on Tcl 8.6. You have the
ability to run them while work continues make Itcl/Itk 4 suitable for
your uses if it is not already.

Itcl 3 does not currently run on Tcl 8.7a* . I would rather not have to
solve that problem. I would much rather be able to say, when you go to
Tcl 8.7, you must also go to Itcl 4.1+. That will only happen when you
and others like you find and report the remaining obstacles so they can
be solved.

> Any advice is greatly appreciated.

Hope that covers what you were looking for.

--
| Don Porter Applied and Computational Mathematics Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

Ralf Fassel

unread,
Mar 23, 2018, 5:05:17 AM3/23/18
to
Thanks Don for your effort in this matter!

* Don Porter <donald...@nist.gov>
| On 03/22/2018 08:47 AM, Uwe Schmitz wrote:
| > we are trying to migrate our Tcl applications to 8.6.
--<snip-snip>--
>
| I'll start from an assumption that you have apps that are working well
| for you on top of a combination of dependencies that look like this:
>
| Tcl/Tk 8.4.$something
| Itcl/Itk 3.4.$something
| Iwidgets of some unknown vintage.
--<snip-snip>--

I assume the same advice holds if starting from Tcl/Tk8.5.x?

R'

Uwe Schmitz

unread,
Mar 23, 2018, 6:15:41 AM3/23/18
to
Don,

many thanks for your valuable advice!

Fortunately we use Linux as our main developing platform
and we build binaries ourself. We're already using Tcl 8.5
with Itcl 3.4.3 and Itk 3.4.2. Even step 3 I've tried some
weeks ago and it looked very promising.
I will start there again and continue with step 4.

I only tried with windows to use an reproducible
environment. And, in the long run, we have some windows
users to which we deliver starkit-executables.

Anyhow, I will follow your suggestions and report if
anything goes wrong.

Thanks again for your time and efforts!
Uwe

Paul Obermeier

unread,
Mar 23, 2018, 5:58:49 PM3/23/18
to
I've added itk and iwidgets to BAWT in the versions Don mentioned.
They work with Tcl 8.6.8 (tested some of the iwidget demos on Windows
and Linux).

Note, that these packages are not included in the BAWT distribution yet,
so you have to download them manually and add them to the Tcl.bawt setup
script.
http://www.bawt.tcl3d.org/download.html#new

Paul

Uwe Schmitz

unread,
Mar 26, 2018, 3:20:08 AM3/26/18
to
Paul,

Thanks for adding this to BAWT and generally for your
efforts providing BAWT!

Best wishes
Uwe
0 new messages