Jul 2023 Tcl Meetup notes

Tcl meetup 2023-07-11

possible topics

  • Tcl/Tk 9.0 - what's needed to get it done?
    • outstanding TIPs
    • documentation
    • conversion guides
    • important extensions
    • wiki links
    • other?
  • the remaining encoding issues
  • anything else?

Outstanding TIPs

DKF: No comment on these beyond they're non-Final Project TIPs with a target before 9.1

Encodings

#        Title
671        New encoding profile - passthrough
667        Make "strict" the default encoding profile.
665        Remove support for internal utf-16 for Tcl 8.7
659        Allow other default profiles than "strict"
657        Make "-profile strict" the default in Tcl 9.0
654        Profiles for character encoding/decoding behaviour
653        Handling encoding errors for read and gets

Expressions

#        Title
676        Introduce "expr -nosubst" and alias this to "="
674        a new multiple expression command
672        Extend $ substitution to include expressions as $(expression)

C API

#        Title
666        Change ptrdiff → Tcl_Size in Tcl 8.7
664        Enable compiler warnings for missing int → Tcl_Size conversions
662        Un-deprecate Tcl_VarEval
661        Disable the Tcl 8 compatibility macros in Tcl 9 by default
546        Typedefs to Support Source-Compatible Migration

Other Tcl

#        Title
677        Constant Variables
673        Remove deprecated [trace] subcommands
670        Simple Extra Procedures for File Access
652        Remove "string is unicode" and Tcl_CharIsUnicode"
567        Add Operation to Support Set-like Slots
530        Control over performance impact of TIP 280
486        Thread 3.0 is for Tcl 9

Tk

#        Title
612        Setting WM_CLASS for main/root window
611        Add subcommands to the "photo image" command to rotate and reflect an image
576        Poor-mans Table listbox enhancement
570        Gesture Support for Finger Scrolling and "Pinch to Zoom"
560        Megawidget Configure/Property Support
553        Ellipses: the Alternative to Scrolling and Wrapping
466        Revised Implementation of the Text Widget
419        A New Command for Binding to Tk Events
370        Extend Tk's selection with a -time option
369        Widget cargo command
349        New "-cargo" option for every Tk widget
271        Windows-Style Open and Save File Dialog on Unix
243        Supply Find Dialog for the Text Widget
238        Fire Event when Widget Created
186        Expose the Type and Modified-State of Widget Options
180        Add a Megawidget Support Core Package
154        Add Named Colors to Tk

EG From all the listed Tk TIPs above, these are my remarks about the ones I consider important:

  • 349 and 369 ("cargo" related tips): These can be added easily with snit::widgetadaptor. This shows that's what is needed is a megawidget framework, not these two particular TIPs.
  • 553 Ellipsis (not ellipses, those geometric places that satisfy ((x**2/a**2 + y**2/b**2) == 1)): I have some code to implement them.
  • 154 Named colors: I can give it a go. I think they are important for things like dark modes.
  • 370 Extend Tk's selection with a -time option: IIUC this is needed for TkDnd. It should be in.
  • 560 Megawidget Configure/Property Support: great to implement megawidgets.

stevel - 2023-07-12 07:01:07

We also need feedback from other language communities (PerlTk, LuaTk, Python Tkinter) as to whether porting to Tcl 9.0 is going to be a problem due to 32 bit unicode chars and 64 bit ints


chrstphrchvz - 2023-07-21 17:24:03

Tcl.pm for Perl (which is not Perl/Tk—that remains stuck on 8.4-era code), Tkinter, and Ruby/Tk all use C APIs. I have already contributed some changes to get Tcl.pm and Tkinter ready for Tcl 8.7 and 9.0: see [L1 ], [L2 ], [L3 ].

Regarding 64-bit, some work was needed to properly handle 32-bit int Tcl values going away (TIP 484). But since these wrappers are primarily used for Tk and not general purpose Tcl, it may not be a priority to migrate to 64-bit size C APIs for passing objects larger than 2**31 to/from Tcl. The maintainer of Tcl.pm in particular likely still wants 8.4 compatibility.

Regarding Unicode, Tcl.pm only uses modified UTF-8 (e.g. Tcl_GetStringFromObj()/Tcl_NewStringObj()), while Tkinter uses modified UTF-8 and possibly UTF-16 or UTF-32 (e.g. Tcl_GetUnicodeFromObj(), depending on sizeof(Tcl_UniChar)), so I am not aware if any C API adjustments are needed.

I have not looked into Ruby/Tk deeply; it could still be simpler since e.g. it typically only accesses Tcl values as UTF-8 string or bytearray rather than various other types, however it still contains some pre-8.4 handling.