Purpose: to collect information regarding special tips, techniques, tricks, and got-chas in writing true cross platform Tcl scripts.

Page begun by Larry Virden.


Issues:


Other resources:


Here are some example Tcl applications that run on all of UNIX, Win, and MacOS and which are not merely trivial but demonstrate many of the problems/solutions of cross-platform portability.

  • Alphatk [L1 ] is such an application. It is a cross-platform programmer's editor. It has some problems on MacOS, but this is due to a few remaining bugs/issues in MacTk, and not in Alphatk's scripts. It has cross-platform support for things like: executing external scripts, starting up latex processes (and capturing their output), etc. There are now about 170000 lines of Tcl code in there, which work cross-platform!
  • tkbiff [L2 ] includes a lot of code to make it work on all platforms. It sounds like a trivial app but it is actually 4300 lines of Tcl. Besides the things Tcl handles automatically, extra coding is necessary for cross-platform issues like : playing audios, fonts, cursors, preference file locations, keyboard/mouse bindings, invoking browsers, dialogues, and diagnostics. Fairly good rosetta stone since it is small and yet demonstrates things like UNIX/Win exec vs Mac-Applescript and Mac-resources.

Sometimes, even when a command itself isn't available in Tcl or Tk, it can be built rather easily. Hopefully the maintainer of tcllib and developers will continue to work together to gather things like fileutil and other pieces of code together into modules.


Please feel free to add anything you can. Hopefully some new tools could be added to the Tcl and Tk core to improve portability!