On Friday, September 6, 2019 at 1:34:25 AM UTC-6, Roderick wrote:
>
> It seems, python is much more advanced in this sense.
>
If you dig into the core of most python libraries which use compiled code you find they are generated using a tool named 'swig' (
swig.org). Wrapping those same libraries for use in TCL is trivial.
Also, FWIW, python uses Tcl/Tk in its core (
https://wiki.tcl-lang.org/page/Python). If you browse through the python source you will discover it is either using Tcl/Tk dynamic libraries, or embeds the language.
From the latest Python 3.7.4 source:
https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
In the Python-3.7.4/PCbuild folder we find:
tcl.vxproj
tcltk.props
tix.vcxproj
tk.vcxproj
and in the Python-3.7.4 root folder
configure.ac contains a block for finding and using the Tcl and Tk libraries starting at line 3024:
# Check for --with-tcltk-includes=path and --with-tcltk-libs=path
AC_SUBST(TCLTK_INCLUDES)
AC_SUBST(TCLTK_LIBS)
AC_MSG_CHECKING(for --with-tcltk-includes)
AC_ARG_WITH(tcltk-includes,
AS_HELP_STRING([--with-tcltk-includes='-I...'], [override search for Tcl and Tk include files]),
[],
[with_tcltk_includes="default"])
AC_MSG_RESULT($with_tcltk_includes)
AC_MSG_CHECKING(for --with-tcltk-libs)
AC_ARG_WITH(tcltk-libs,
AS_HELP_STRING([--with-tcltk-libs='-L...'], [override search for Tcl and Tk libs]),
[],
[with_tcltk_libs="default"])
AC_MSG_RESULT($with_tcltk_libs)
if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault
then
if test "x$with_tcltk_includes" != "x$with_tcltk_libs"
then
AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither])
fi
TCLTK_INCLUDES=""
TCLTK_LIBS=""
else
TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs"
fi