home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.tcl
- Subject: Re: why Tk doesn't scale well
- Message-ID: <TMB.92Aug13102903@arolla.idiap.ch>
- Date: 13 Aug 92 14:29:03 GMT
- References: <1992Aug13.012211.10452@news.eng.convex.com>
- Sender: news@ai.mit.edu
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 47
- In-reply-to: connolly@convex.com's message of 13 Aug 92 01:22:11 GMT
-
- In article <1992Aug13.012211.10452@news.eng.convex.com> connolly@convex.com (Dan Connolly) writes:
-
- Tcl VS SMALLTALK
-
- I think the programming model proposed by SmallTalk is the clear choice
- for visual interface design.
-
- I'm not so sure about that...
-
- [...] All but the last two have a full class system with inheritance and
- subclassing supported by the language. It's possible (though painful) to
- subclass Xt widgets to add state or messages. The Tk toolkit allows
- class bindings to enhance the messages understood by a class, but it has
- no mechanism for adding state to an interface object.
-
- For example, suppose I wanted to mimic an emacs buffer with a Tcl text
- widget. In an OOP language, I could subclass the text widget, add
- instance variables for things like the filename, editing mode, "dirty
- bit", etc. In Tcl I have to cook up some method to associate this
- state with the text widget.
-
- Well, there are alternative, tried approaches to reuse of UI
- components that do not require inheritance. For example, you can
- filter the messages that go to the text widget (closely related:
- wrapping).
-
- Why would you choose such an alternative approach? First, it goes well
- with a thread/process model. Second, it reduces the risk that you
- accidentally come to depend on some property of the text widget that
- is visible only by descendants. In fact, I would argue that OOP for UI
- programming is an inferior implementation of such an approach...
-
- I wish Tk were built on top of XLisp -- then we'd have efficient
- recursive list processing and an object system.
-
- There are many X window interfaces based on Lisp (some even on XLisp).
- Why don't you use them? If that's what you like, what is it about Tk
- that makes you wish that it were built on top of XLisp?
-
- Tk and TCL seem to me to be very reasonable compromises for living in
- the C/X11/networked world. I would hope that Tk ultimately also will
- explicitly support and encourage UI programming based on a
- multi-threaded environment; "send" is a first step. That could give
- you the flexibility of a message-passing approach to user interfaces
- with the simplicity of the Tk/TCL substrate.
-
- Thomas.
-