Aug 2023 Tcl Meetup notes

Tcl meetup 2023-08-08


As it was expected, due to the holiday season in the northern hemisphere, that there would be few people attending, no topics were suggested. The turn-up was substantial, however.

The topics that were discussed:

  • Tcl 9 and the compatibility macros
  • The NexTcl project by Stefan Alecu
  • Running the tutorial interactively via Tcljupyter or CloudTk

Note arjen: these are my personal notes from the meeting. Corrections and additions welcome.

Tcl 9 and the compatibility macros

The first topic was how to migrate from Tcl 8.6 to Tcl 9. While the compatibility macros that hide the changes in the API when you go from Tcl 8.6 to Tcl 9, may help up to a point, the consensus was that actually going the other way is easier. That is: use Tcl_Size as the type used in the new Tcl 9 API for the length of strings and so on.

When going back to Tcl 8.6, this type can easily be defined for compatibility. The advantage is that you allow the compiler to check for the correct semantics, while the compatibility macros for going the other way, may actually hide mistakes.

Rolf Ade shared his experience with compiled extensions: the changes required for the Tcl 9 API are for the most part mechanical, especially after TIP 660.

The NexTcl project

As announced on the Wiki and in comp.lang.tcl, Stefan Alecu is working on improved tooling for the Tcl language. One part of this project concerns a language server as used by editors like Visual Studio Code. It is a popular technique to customize editors for cooperation with all manner of programming languages -- syntax colouring, completion and so on. Besides the core commands, the language server should also know about extensions, in particular extensions like Expect and SQLite.

This project was received with enthousiasm, but we warned Stefan not to take up too much work at once. He promised to post his progress regularly.

Interactive tutorial

The tutorial as it is available on the Wiki consists of some 50 "lessons", each contained in its own Wiki page. The tutorial was derived from the excellent TclTutor application by Clif Flynt. Already quite a few years ago a small group of us decided that we wanted to preserve the contents in an easier maintainable and extendable form. Hence the Wiki pages.

A drawback is that this form is a collection of static pages (note: the tutorial was also turned into a PDF file). So, no immediate interaction. Rolf suggested to me to contact Stefan Sobernig, who presented recent work on Tcljupyer. It also revived the idea of running the tutorial via Jeff Smith's CloudTk.

As a further note: I already contacted Stefan Sobernig -- running the tutorial via Tcljupyter will require converting the WIki pages into Jupyter notebooks, hopefully this conversion can be automated. Also, a prototype for running the examples via the Wiki is on its way. Probably the Jupyter route is the most attractive from a "marketing" perspective.