Re: TCL (was Re: [tkined] Monitoring a 3Com SuperStack II 3300 switch)

From: Cary O'Brien (cobrien@optimsys.com)
Date: Tue Feb 01 2000 - 23:05:01 MET


>
>
> >
> >Much as I dislike TCL, I like the way Scotty itself works. The whole idea is
> >sound but I don't think TCL hacks it for writing largish scripts (and I don't
> >want to go back to C - ugh!). But I don't see anything else which is on a par
> >with Scotty.
> >
> >I just won't use TCL for any more large projects. Actually, I knew that
> >before but had no idea my current project (storing polled MIB variables in a
> >MySQL database) would be so large. I anticipated maybe 2 or 3 weeks but its
> >been nearly 3 months now and nowhere near what I was hoping to do with it.
> >
> There are lots of object oriented extensions out there for
> Tcl. Choose one that fits your MO. Also, making use of
> namespaces and inherent action/object oriented features
> makes things nice (::)
>
> >I'm not blaming it all on TCL, I'm way out of practice of writing anything
> >longer than a page of code and my current reading material is a very good book
> >called "The promise of Sleep (Dement)" which will hopefully improve my
> >productivity :) So this is just a personal thing, I know some people like
> >TCL.
> >
> >I'm quite keen to get to grips with guile for myself so I'll probably be
> >looking for a way to cross call TCL from guile (no problem I've got 256 Mb of
> >memory, I can run both interpreters!).
> >
>
> You probably want to look at SWIG:
>
> 1. Introduction
> ---------------
>
> SWIG is a compiler that makes it easy to integrate C and C++ code with
> scripting languages including Perl, Tcl, and Python. In a nutshell,
> you specify a bunch of ANSI C/C++ declarations and it generates an
> interface to your favorite scripting language.
>
> SWIG is almost entirely the product of users who have used the system
> and suggested new idea. Without this support, SWIG would be not be
> nearly as fun to use as it is now. Many thanks!
>
> ----------------

Sure you can wrap the cmu (or ucsd?) snmp library in SWIG, but
you don't get the tcl event handling. See below.

>
>
> SWIG is available at neosoft and other Tcl and Perl archives.
>
> FWIW - I like Tcl. It's a very nice extension language.
> Nothing beats it for easily embedding esoteric apps and
> functions with a nice shell and gui.
>

You're forgetting the best part of TCL. Since TCL and TK were
implemented roughly together, TCL has been developed to work in an
event driven environment. Scotty uses this to great advantage. No
other scripting language (that I know of) has such a sophisticated
event model. As far as I am concened, the TCL event model is even
better than threads. You don't need to worry about concurrency, as
long as you keep processing you've got the execution context. Do a
blocking op and you give it up. No messy mutexes. Ok, sure, it
doesn't help you use all 8 processors in an SMP box to calculate PI to
10000 digits, but for comms processing it works great.

As for scripting SNMP, there was a Python module called SNMPY, that
basically wrapped the ucsd-snmp library in a Python wrapper. It has
kind of been abandoned. I wish it worked, I could solve a bunch of
problems with ZOPE + SNMPY. But even if it worked, you wouldn't get
the support for event-driven apps that you get with TCL.

-- cary

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:33 MET