[Novalug] Combining Tk with other languages -- was "Munging language"

Clif Flynt clif@cflynt.com
Fri Oct 30 13:24:04 EDT 2009


On Fri, Oct 30, 2009 at 07:53:01AM -0400, Wayne Dernoncourt wrote:
> Paul D. Bain
> 
> >   My understanding is that Python+Tk is a common combination.
> > IOW, after a Python programmer has finished creating a
> > functioning, Python program (not a web application), he can
> > create a user-friendly, GUI interface using Tk. I suspect
> > that you could combine Tk with Ruby, too.

  This is about a decade old.  I've not talked with the Perl-Tk
or Python-Tk developer's recently.  The designs may have changed.

  The early version of Python-Tk embedded the Tcl interpreter in
python.  Python passed the GUI scripts to the Tcl interpreter to
be rendered.

  The perl folks wrote code at the "C" level to talk to the tk
libraries.  They went straight from a perl call to "C" library
calls.

  The python approach made it easy for python to keep up with Tcl
during the Sun days when Tk went throught a lot of evolution, byte code
compiler, native representation of data, etc.

  The perl folks were always a rev or two behind because they had to
mung "C" code whenever the Tk API changed.

> That seems more like the GUI part is tacked onto a language.
> I have to wonder if that is one reason why Tcl/Tk didn't find
> more acceptance in the real world.

  I find that non-CS trained folks who need to program tend to 
like Tcl/Tk, while folks with a CS degree usually don't.

  I think the non-keyword based parser is so 'wrong' to someone who's
only learned algol-derived or FORTRAN-ish languages that they can't
cope with it.  The folks who come from lisp/scheme seem to adapt to Tcl
more easily.  

  I've not used Lua, but looking at it quickly, it looks like the
standard Tcl features with more algol-derived semantics.  I didn't find
any feature that wasn't also in Tcl.

>  Tcl/Tk is cross-platform
> compatible, graphics, processing, quick to execute (note Tcl/Tk
> probably wouldn't be real applicable where real math gets
> used a lot, simple math is fine, don't try to write/run Doom
> in Tcl/Tk.

  There are 3D gaming systems with Tcl/Tk.  The combination of 
compiled and interpreted code is very powerful.  You might check out
the Nebula engine.  I've not seen Doom written using that, but I have
seen 3D flight simulators.

  No Starch Press published a book by Loki about writing Linux games. 
They used Tcl/Tk to handle the main GUI, game configuration, user
interaction and scenario description parts and compiled code to handle
the real-time stuff.

  My next holiday game will be out soon.  I'm digging up music
and sound effects and might tweak the GUI a little.  I'll announce
on the list when it's up.

  Clif

-- 
... Clif Flynt ... http://www.cwflynt.com ... clif@cflynt.com ...
.. Tcl/Tk: A Developer's Guide (2nd edition) - Morgan Kauffman ..
. 17'th Annual Tcl/Tk Conference:  2010,  ChicagoLand, IL  USA ..
.............  http://www.tcl.tk/community/tcl2010/  ............








More information about the Novalug mailing list