IDE: from cathedral to patchwork bazaar

Richard Suchenwirth 2006-01-18 - IDE, "Integrated Development Environment", is a lofty name. These things often come as big monolithic software, with the corresponding complexity. Developers often use them, and not so rarely even want to roll their own. "My cathedral is bigger than yours." (For ESR's "cathedral/bazaar" paper, see [L1 ]).

IDE and simple somehow don't go together: you're supposed to have many features, and add one here and another there. Bells and whistles (can be hazardous to your hearing).

On the other hand, Tcl is radically simple. Tcl users are often fond of using editors like emacs or vi, or even Wordpad, which are feature-poorer than full-fledged IDEs, and yet they achieve much with little. Edit here, test there, works smoothly even on a PocketPC. An interactive tclsh is good to test some details, and then you code confidently, and test successfully - one might even call that "intelligent design".

http://www.itworld.com/shared/images/2003/3/Unicode_editor.gif

And yet, I've also tried my hand at making a complex IDE ("sep", see screenshot above). This sandbox of mine has an entry, a listbox, a text, a canvas, and various connections between all of them. I started to write it in 1997, and for a few years it has just staid as it is, but I still use it every day. I work with it, but why don't I work on it? Maybe it's the cathedral effect: the thing is so big, like a dinosaur, that I'm afraid to change one place and run into errors in a remote other.

Years ago I boldly started out to make a 2.0 version, and it has stalled since long, because to change from one complex system to another even more complex system isn't inviting to be done as a weekend fun project. "sep" just has stagnated at version 1.7 for some five years now, but that doesn't make it worthless. It does its job every day, but I sometimes smile how naive I was years ago.

WikiDbImage ifile01.jpg WikiDbImage ifile4.jpg WikiDbImage ifileuni.jpg

And with iPaq and then my current HTC Magician PocketPCs, I kept the traditional pattern: iFile: a little file system browser was, well, not a cathedral, but a chapel built on the palm of my hand. And the same effect came back: I like to use iFile, but I don't feel tempted to work on it.

Enter eTcl, a young single-file Tcl/Tk 8.4.12 distribution with many noticeable features. A good console (that convinced me I'd rather take it than roll my own), and ways to extend it from outside (init scripts, lib directory) without unpacking and packing and all that jazz - and easy switching between toplevel windows, which the previous PocketPC ports lacked. I played with it, configured this and that, and somehow my mind changed - seeing the console as a launch-pad for apps (like on Unix/Cygwin desktop boxes), I thought I'd like to call an editor, and so I wrote e: a tiny editor plugin for eTcl - small, self-contained, yet very useful (especially as it allows to edit files as well as procs, and save to file or eval). Other things like displaying small images could be done right in the console itself:

WikiDbImage see_inline.jpg WikiDbImage htext_ppc.jpg

Next step (today) was htext as eTcl plugin - tweaking a 5-year old code that I hardly ever looked at after, to run pretty nicely on the PocketPC. It's also stand-alone, but plugs into the existing infrastructure: hypertext pages are stored in a global ::docu array, so if you add something to that, htext will display it next time. Decoupling components just somehow feels good.

It dawned on me that I could delegate the editing of ::docu entries to e, so without one knowing about the other, they would cooperate. Add a simple function for serializing an array, and somehow three little components start to be something like a PocketWiki together...

I'm just in the middle of thinking about these new perspectives, but I'm slowly getting a concept of a set of little puzzle pieces (to come: generic canvas and listbox and ways to compose them on the fly, say for displaying an encoding - encoview as eTcl plugin), which can each be refined and polished without fear, but on demand compose into a bigger picture which looks like an IDE cathedral - and in fact is just a bazaar of software patchwork.

Maybe this is because on a PocketPC you just have 240x320 pixels of screen estate, each window should best be a full-screen toplevel, so putting together an IDE of many windows next to each other is not really feasible. On a desktop PC, a flurry of toplevels might rather disturb. But there might be ways to dynamically put toplevels into e.g. a NoteBook, just like tabbed browsers do it, without knowing much about the pages they render.

SEH 20060119 -- very appealing ideas. I have a persistent fantasy of being able to carry a complete Tcl cross-platform user environment with me to whatever computer I need to work at (go Whim window manager!). Handhelds present a barrier to running the average Tcl/Tk application because of, as you say, small screen size; but I can see generalizing your idea for an IDE to any application, architecting an application as a collection of toplevels which arrange themselves as necessary according to platform (like a generalization of pack, but for toplevels rather than a single window). I find your concept expecially appealing because it's often the case that such a generalizing of a problem to solve a specific issue (transitioning from desktop to handheld and back) turns out to be the solution of a great many unanticipated future problems (as turned out to be the case with Tcl itself).


RS 2006-01-20: Here's a little example for composing patches that I coded last night:

 menu+ edit proc {e [lb'select [lsort [info procs]]]}
  • menu+ adds an item to the console menu (see that page).
  • "lb'select" (soon here) brings up a listbox with the specified list, and returns the selected element (or "" if canceled).
  • e is the one of e: a tiny editor plugin for eTcl.

Plugging together three independent components in one configuration line feels very very cool :^)

Of course, the patchwork philosophy is not exactly new - Software Tools described the approach of little independent tools, that do one thing well, in 1976 already...

See Sepp for details of my ongoing implementation.


Martyn Smith 2008-06-09: I found this editor for pocket pc on the web (http://newmagic.progs.googlepages.com/ficedit ) I forgot to mention it this WE.