Version 17 of Taygete Scrap Book

Updated 2019-07-06 19:19:13 by Jorge

This is an experimental, partial, compact rebuild of some ideas of Jupyter Notebook which first was presented at EuroTcl 2019. The name is derived from Taygete (Ταϋγέτη) which is a small retrograde irregular satellite of Jupiter, aka Jupiter XX.

It consists of a webview (the rendering component/library of a web browser) with an added Tcl interface, plus some Tcl and JavaScript to provide a user interface resembling Jupyter Notebook. The webview part is basically taken from the Tiny cross-platform webview library for C/C++/Golang with the Python interface taken as starting point for the Tcl interface.

No browser and webserver are required so it can be made into one binary with zero installation and without requiring network infrastructure.

The Tcl binding is about 650 LOC and can be found in the undroid/twv folder on AndroWish's website.

The UI/engine is a single Tcl script of about 1300 LOC and can be found with some examples in the undroid/tsb folder on AndroWish's website.

A ready made ZIP kit for immediate experimation is available in TSB.kit . It supports the three major desktop platforms Windows (32 and 64 bit), MacOS (Intel, 64 bit), Linux (Intel, 32 and 64 bit, distro agnostic but a decent version with gnome 3 runtime is required). If started without further arguments, it presents an overview page with links to examples.


Jorge - 2019-07-02 00:38:33

This is what I got when trying on ubuntu:

 jorge@jorge-Inspiron-1545:~/Downloads$ ./undroidwish-e5dc71ed9d-linux32 TSB.kit
 CRITICAL: Error in startup script: can't find package twv
     while executing
 "package require twv"
     (file "TSB.kit/tsb/tsb.tcl" line 9)
     invoked from within
 "source [file join [file dirname [info script]] tsb tsb.tcl]"
     (file "TSB.kit/main.tcl" line 2)
     invoked from within
 "source [file join [info script] main.tcl]"
     invoked from within
 "if {[file exists [file join [info script] main.tcl]]} {
     source [file join [info script] main.tcl]
 }"
     (file "TSB.kit" line 5)

chw - 2019-07-02 02:14:45

The twv extension requires a libwebkit2gtk-4.0.so.37 shared library which might be in the libwebkit2gtk-4.0-37 package if your Ubuntu isn't that old. Additionally, it wants libjavascriptcoregtk-4.0.so.18 which should be in the libjavascriptcoregtk-4.0-18 package.

In general I suggest to not use it in combination with undroidwish but with vanillawish since the tsb.tcl script tries to withdraw the tk toplevel anyway since it is not needed due to the webview having its own toplevel window.

Another problem on Linux which I observed is, that it seems not possible to startup the webkit stuff in a 32 bit environment on a 64 bit system, although the proper packages (see above) where installed for 32 bit, too. On Windows, this wasn't a problem at all.


Jorge - 2019-07-03 14:34:15

Thanks, when upgrading from Ubuntu 1204 to 1604, the application works fine. Then some examples show some errors for a missing package, which I will find out if missing in my setup.


Jorge - 2019-07-03 23:35:46

The specific missing package when using vanilla wish, is the uri package. Now, when using undroidwish, both the geneva and plotchart examples run fine. Quite impressive!


chw - 2019-07-05 06:35:15

What I've meant with vanillawish is not a plain tcl/tk install but the vanillawish from the download page of Androwish which has a full recent tcllib built in. Should the tcllib package of the distro of your choice include the uri package, however, you might be properly set up to run all examples.


Jorge - 2019-07-06 00:16:03

Correct, I can confirm that the application works just fine with vanillawish as you explained above. The only other error I have now is with the Northwind example as follows:

 Problem with the SSL CA cert (path? access rights?)
     while executing
 "fetch_url ${BASEURL}/Northwind_ERD.png"
     ("uplevel" body line 1)
     invoked from within
 "uplevel \#0 $str"

chw - 2019-07-06 13:22:29

Verified with an old netbook with Ubuntu 16.04 i386. Caused by their olden certificate store. You have two options to overcome the Northwind problem: 1. in the TclCurl variant of the fetch_url procedure add the option "-sslverifypeer 0" where the handle's url is configured, or 2. don't use TclCurl at all e.g. by changing the "package require TclCurl" to "package require NoIDontWantTclCurl".


Jorge - 2019-07-06 19:13:30

Thanks again, that works. Then I just downloaded tsb.tcl to get access to the modified copy of northwind.tsb

 ./vanillawish-e5dc71ed9d-linux32 tsb.tcl northwind.tsb

awesome!