Write my own library/extension or create package that calls external program?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Write my own library/extension or create package that calls external program?

From: Kevin Walzer <sw@wordtech-software.com>
Date: Sun Mar 05 2006 - 02:59:44 CET

I've been making (glacial) progress at learning C so I can implement
some extensions that expose parts of the Mac OS X API not currently
wrapped by Tcl/Tk. However, I recently ran across a cool set of
command-line utilities that do *exactly* what I want--they do things
like get and set custom icons, convert them into formats readable by
Tcl/Tk, etc.

Is there any reason *not* to write a batch of Tcl procedures that wrap
the functionality of these tools, and then bundle that as a Tcl package?
(At the Tcl package level, the procedures would probably work by running
a lot of exec functions out to the command-line tools.) Is speed an
issue? Is this considered lousy application design? Do others wrap the
functions of command-line programs in Tcl procedures to provide a
cleaner (though non-C-level) interface to them?

I'd just rather tap into what these programs offer, rather than
implementing my own code at some distant point in the future, unless
there's a compelling reason not to.

In case anyone's interested, the command-line tools are osxutils
(http://osxutils.sourceforge.net).

-- 
Kevin Walzer
iReveal: File Search Tool
http://www.wordtech-software.com
Received on Sun Apr 30 02:23:38 2006