GUIs - A Modest Proposal

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Tue Jun 8 19:46:37 EDT 2010


On Tue, 08 Jun 2010 15:40:51 -0700, geremy condra wrote:

> On Tue, Jun 8, 2010 at 3:09 PM, Lie Ryan <lie.1296 at gmail.com> wrote:

>> Nobody complains that python included a regular expression engine in
>> its standard distribution; so why complain that python included a Tcl
>> expression engine in its standard distribution.
> 
> This is a silly argument.
> 
> REs are not full programming languages, even from a theoretical point of
> view, 

True, but some theoretical extension to REs could be. If I've understood 
correctly, Perl's regexes aren't actually regular expressions any more 
(they're a superset) and might even be Turing Complete.

In any case, the point is not that you can or can't write your entire 
application using a RE. The point is that regexes are a mini-language, a 
DSL, not written directly in Python.

> aMSN is written in Tcl, as wikipedia would have told you, and
> having to depend on the tools of another language to get commonly
> desired functionality is not a good thing for a programming language.

I don't see why you think so. Python is specifically designed to be a 
glue language, to bring together functionality from disparate components 
written in other languages and provide a user-friendly language around 
them. Fundamentally, what's the difference between these?

* CPython relies on Tk/Tcl for a GUI

* CPython relies on a C library for regular expressions

* IronPython relies on the .Net environment for everything

* Jython relies on Java libraries for many things

I don't see why that first one is so much worse than the others. Sure, it 
adds an extra dependency to installing Python for GUI programming, but 
that's no different to any other GUI toolkit: PyQt has Qt as a 
dependency, PyGtk has Gtk as a dependency, etc. (I trust you're not 
suggesting that every language needs to create its own fully-independent 
GUI toolkit that talks directly to the hardware!)

What does it matter that Tk is Turing Complete and Qt or Gtk aren't?

In any case, if you consider Tkinter is harmful, don't use it. It isn't 
like GUI programming in Python relies on it, there are alternatives.



-- 
Steven



More information about the Python-list mailing list