TCL / TK strengths and uses 
Author Message
 TCL / TK strengths and uses

Hi all,

I have been given an assignment to create a piece of software
(completely free choice) using a lesser-used language. I have chosen
TCL / TK for this, because it looks to be both an interesting language
and one which is fairly simple to learn.

It's not a language I've much idea about, so I'd be interested to
know:

A. What type of applications is it well suited to creating? I have a
free choice of what to create (could be a game or a simple utility of
some kind or something else), so knowing the language's strengths will
aid my choice of what to make.

B. Are there any other less-well known technologies it can easily be
coupled with? I'm thinking another language, or a type of database
perhaps? The reason I ask, is that the more technologies I use in this
assignment, the better. If I can combine TCL / TK with something else
to make this software, I'm onto a winner.

Any advice would be appreciated.

Cheers,

Matt



Sat, 27 Sep 2008 06:30:44 GMT  
 TCL / TK strengths and uses

Quote:

> ...
> B. Are there any other less-well known technologies it can easily be
> coupled with? I'm thinking another language, ...

Obviously C, but also Perl and python via tclperl and tclpython, even
concurrently within the same application.


Sat, 27 Sep 2008 06:42:48 GMT  
 TCL / TK strengths and uses

Quote:

> Hi all,

> I have been given an assignment to create a piece of software
> (completely free choice) using a lesser-used language. I have chosen
> TCL / TK for this, because it looks to be both an interesting language
> and one which is fairly simple to learn.

> It's not a language I've much idea about, so I'd be interested to
> know:

> ....

> B. Are there any other less-well known technologies it can easily be
> coupled with? I'm thinking another language, or a type of database
> perhaps?

Tcl and the SQLite bindings for it pack a lot of punch in a small
package. You get a very large subset of SQL 92, and whatever can't be
done in SQL can be handled by Tcl.

HTH,

Gerry



Sat, 27 Sep 2008 11:51:42 GMT  
 TCL / TK strengths and uses

Quote:

>> B. Are there any other less-well known technologies it can easily be
>> coupled with? I'm thinking another language, or a type of database
>> perhaps?

> Tcl and the SQLite bindings for it pack a lot of punch in a small
> package. You get a very large subset of SQL 92, and whatever can't be
> done in SQL can be handled by Tcl.

Yeah, I'd second that... you could make something really neat with Tcl +
SQLite.

--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/



Sat, 27 Sep 2008 14:17:00 GMT  
 TCL / TK strengths and uses
[...]

Quote:

> A. What type of applications is it well suited to creating? I have a
> free choice of what to create (could be a game or a simple utility of
> some kind or something else), so knowing the language's strengths will
> aid my choice of what to make.

Tcl/Tk is good at (as in, makes relatively simple): GUIs, network
servers/clients, responding to events in general, gluing together
components (written in many different languages), and generally
connecting things together and putting a nice interface on them.

It's not so good at anything particularly CPU intensive.

Quote:

> B. Are there any other less-well known technologies it can easily be
> coupled with? I'm thinking another language, or a type of database
> perhaps? The reason I ask, is that the more technologies I use in this
> assignment, the better. If I can combine TCL / TK with something else
> to make this software, I'm onto a winner.

Others have mentioned SQLite, so I'll mention MetaKit
(http://equi4.com/metakit/) too, which is another embedded database
library, that also forms the basis of the "starkit" deployment
technology that is a popular way of packaging up Tcl apps into a single
file.

You could trawl the wiki (http://wiki.tcl.tk/) for inspiration. As you
mention games, you might like the Nebula Device
(http://www.nebuladevice.org/), or take inspiration from Category Games
(http://wiki.tcl.tk/references/3622!). My own TkPool
(http://wiki.tcl.tk/8656) could do with some work, ... :-)

Cheers,

-- Neil



Sat, 27 Sep 2008 14:51:34 GMT  
 TCL / TK strengths and uses

   You can use sqlite to join with SQL or tdom to join to XML and XSLT
or tcl3d (http://wiki.tcl.tk/15278) to join to OpenGL...

Ramon Rib


escribi:

Quote:

>> ...
>> B. Are there any other less-well known technologies it can easily be
>> coupled with? I'm thinking another language, ...

> Obviously C, but also Perl and Python via tclperl and tclpython, even
> concurrently within the same application.

--
Compass Ing. y Sistemas         Dr. Ramon Ribo

c/ Tuset, 8 7-2                 tel. +34 93 218 19 89
08006 Barcelona, Spain          fax. +34 93 396 97 46


Sat, 27 Sep 2008 14:56:46 GMT  
 TCL / TK strengths and uses

Quote:

> B. Are there any other less-well known technologies it can easily be
> coupled with? I'm thinking another language, or a type of database
> perhaps? The reason I ask, is that the more technologies I use in this
> assignment, the better. If I can combine TCL / TK with something else
> to make this software, I'm onto a winner.

How about tcldb? Here's a tutorial on how to build a simple SQLite based  
address book.

http://dqsoftware.sourceforge.net/tcldb_guitutorial.html

You might want to go a bit further and do a mini-CRM with contacts history  
for this one. That would be a nice 1k LOC example :-)

ps. It should work out of the box with ActiveTcl and SQLite v2 from  
sqlite.org - there's no sqlite v3 support in what is currently released on  
SF, unfortunately. I'm working on it.

--
WK



Sat, 27 Sep 2008 15:43:18 GMT  
 TCL / TK strengths and uses

Quote:


> [...]

> > A. What type of applications is it well suited to creating? I have a
> > free choice of what to create (could be a game or a simple utility of
> > some kind or something else), so knowing the language's strengths will
> > aid my choice of what to make.

> Tcl/Tk is good at (as in, makes relatively simple): GUIs, network
> servers/clients, responding to events in general, gluing together
> components (written in many different languages), and generally
> connecting things together and putting a nice interface on them.

> It's not so good at anything particularly CPU intensive.

On the other hand it is very good at interfacing with C code. And C is
good at CPU intensive tasks. I'd also recommend the OP to look at SWIG,
the example code took me just 5 minutes to get up and running.


Sat, 27 Sep 2008 16:58:55 GMT  
 TCL / TK strengths and uses

Quote:



> > [...]

> > > A. What type of applications is it well suited to creating? I have a
> > > free choice of what to create (could be a game or a simple utility of
> > > some kind or something else), so knowing the language's strengths will
> > > aid my choice of what to make.

> > Tcl/Tk is good at (as in, makes relatively simple): GUIs, network
> > servers/clients, responding to events in general, gluing together
> > components (written in many different languages), and generally
> > connecting things together and putting a nice interface on them.

> > It's not so good at anything particularly CPU intensive.

> On the other hand it is very good at interfacing with C code. And C is
> good at CPU intensive tasks. I'd also recommend the OP to look at SWIG,
> the example code took me just 5 minutes to get up and running.

I'd second the comment about interfacing with a fast C back-end for
CPU-intensive tasks, which can be done by:
 - Creating a C library, then hooking into it from Tcl/Tk.
 - Creating a C application that calls Tcl/Tk libraries from inside it.
 - Creating a command-line C application (or any language) that Tcl/Tk
wraps around.

Also, in addition to the list above of what Tcl/Tk is good at, it's
also good for creating domain specific languages (DSLs). Any language
that uses the basic syntax of Tcl/Tk (command arg1 arg2 arg3...) can be
created in a straightforward way in Tcl/Tk and processed using its own
interpreter (which can be a safe interpreter).



Sat, 27 Sep 2008 18:36:28 GMT  
 TCL / TK strengths and uses
To give you an idea of how powerful TCL is, I have a pile of scripts
and web server apps that all exchange libraries.

Ok, not very impressive.

Did I mention that they manage various bits of dirty laundry on not
less than three different architectures, simultaneously. Our staff
website, written in TCL, stores the staff list in MySQL. Our windows NT
logon system runs a TCL interpretor to read that staff list and match
the right users up with the right network drives. Several command line
utlitiies I've written replace the normal useradd and usermod scripts
to drop the data into LDAP and MySQL when we create new accounts.

The same system also handled some paperwork during our brief jaunt into
OS X as a server platform.

I also use TCL to pass commands to our robotic tape library. We lost
the sheet of bar codes, so I developed an app that fakes out the system
into "seeing" the manual labels on our tapes. How do I know what labels
are on the tape? Why the tape monkey tells them. Because the app also
handles putting the right tape to go off site into the mail slot, as
well as inputting a tape to go back into circulation.



Sun, 28 Sep 2008 00:52:55 GMT  
 TCL / TK strengths and uses
Some strengths that haven't been mentioned yet:

Tcl is very adept at handling strings.  Unicode is thoroughly
integrated into the language; dozens of other character encoding
schemes are also supported.  String handling commands abound.

TCP/IP is another one of Tcl's strengths.  Tcl's [socket] command takes
care of all the nitty gritty details of socket creation, binding, and
connection for you, and [fileevent] allows you to set up callbacks when
your socket becomes readable/writable.

Some packages that will let you do really cool things with minimal
programming effort on your part:

Img: lets you work with a wide range of image formats.  If you need to
do image manipulation on top of that, check out TclMagick by David
Welton and Rolf Schr?dter.
Snack: sound toolkit, allows you to record, play, analyze, and
manipulate audio data.  This one is my personal favorite package.
http: this package comes as a part of the standard Tcl distro; it's a
simple and powerful way to surf the net programmatically.

Finally, a language that doesn't get mentioned much around here but
which has a complete Tcl interface is SICSTus Prolog.  Unfortunately,
it costs an arm and a leg, but if you happened to have some Prolog
skills and your school happened to have a license, Prolog + Tcl/Tk can
be an interesting combination.  A budget-friendly compromise could be
to communicate between SWI-Prolog and Tcl via sockets.

What sorts of things interest you?  There's lots of quality library
code for Tcl/Tk, and even code not specifically designed with Tcl in
mind can often be "glued on" rather painlessly.  I'm sure group readers
can help you locate resources for just about any project you can think
up.



Sun, 28 Sep 2008 04:24:25 GMT  
 TCL / TK strengths and uses


Quote:
>Some strengths that haven't been mentioned yet:

>Tcl is very adept at handling strings.  Unicode is thoroughly
>integrated into the language; dozens of other character encoding
>schemes are also supported.  String handling commands abound.

>TCP/IP is another one of Tcl's strengths.  Tcl's [socket] command takes
>care of all the nitty gritty details of socket creation, binding, and
>connection for you, and [fileevent] allows you to set up callbacks when
>your socket becomes readable/writable.

>Some packages that will let you do really cool things with minimal
>programming effort on your part:

>Img: lets you work with a wide range of image formats.  If you need to
>do image manipulation on top of that, check out TclMagick by David
>Welton and Rolf Schr?dter.
>Snack: sound toolkit, allows you to record, play, analyze, and
>manipulate audio data.  This one is my personal favorite package.
>http: this package comes as a part of the standard Tcl distro; it's a
>simple and powerful way to surf the net programmatically.

>Finally, a language that doesn't get mentioned much around here but
>which has a complete Tcl interface is SICSTus Prolog.  Unfortunately,
>it costs an arm and a leg, but if you happened to have some Prolog
>skills and your school happened to have a license, Prolog + Tcl/Tk can
>be an interesting combination.  A budget-friendly compromise could be
>to communicate between SWI-Prolog and Tcl via sockets.

>What sorts of things interest you?  There's lots of quality library
>code for Tcl/Tk, and even code not specifically designed with Tcl in
>mind can often be "glued on" rather painlessly.  I'm sure group readers
>can help you locate resources for just about any project you can think
>up.

Thanks, people, for all the replies. Sounds like I'm spoilt for choice
with this one.

Incorporating database functionality would be very nice and judging by
the rave reviews, SQLLite and TCL/TK seems like a good way to go.

I'll be working on this for the next few weeks, so be warned that a
barrage of clueless newbie questions is forthcoming!

Matt



Sun, 28 Sep 2008 08:33:53 GMT  
 TCL / TK strengths and uses

Quote:

> I'll be working on this for the next few weeks, so be warned that a
> barrage of clueless newbie questions is forthcoming!

We're ready, bring 'em on.

--
Bryan Oakley
http://www.tclscripting.com



Sun, 28 Sep 2008 08:56:28 GMT  
 TCL / TK strengths and uses


                        .
                        .
                        .
Quote:
>Incorporating database functionality would be very nice and judging by
>the rave reviews, SQLLite and TCL/TK seems like a good way to go.

                        .
                        .
                        .
I use 'em both, together, and they're delights.

Before you start, though, I recommend that you take a half-minute
more to consider the Tcl(/Tk)/Metakit combination.  Functionally,
it's roughly the same as SQLite, and it's even easier to begin
with it--a single executable can give you all the programmability
you'll need for all your development, as opposed to having to
fiddle with several different files, libraries, ... with SQLite.

You'll be successful, in any case.  Your decision.



Sun, 28 Sep 2008 11:08:03 GMT  
 TCL / TK strengths and uses

Quote:

> Before you start, though, I recommend that you take a half-minute
> more to consider the Tcl(/Tk)/Metakit combination.  Functionally,
> it's roughly the same as SQLite, and it's even easier to begin
> with it--a single executable can give you all the programmability
> you'll need for all your development, as opposed to having to
> fiddle with several different files, libraries, ... with SQLite.

I'd say that if you want to use SQL syntax you should use SQLite, and if
you aren't keen on SQL you should use Metakit. If you're more agnostic
on the whole database business, it's probably up to you to review the
alternatives. (The key advantage of SQLite that I can see is that it's
pretty easy to migrate to a heavy-duty server-based DB when your
requirements go up).

Donal.



Sun, 28 Sep 2008 20:34:34 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Using Tcl/Tk-extensions with Tkinter (the Python-Tk)

2. problem: using tcl/tk with visual c++ / tk.h / RC_INVOKED

3. how to access prolog from tcl?(not using tcl/tk interface from prolog)

4. Bugs and Fixes for Tcl/Tk and incr Tcl when using TCL_MEM_DEBUG

5. FAQ: comp.lang.tcl Commercial Uses of Tcl/Tk

6. Perl strengths vs Tcl

7. Perl and Tcl strengths

8. Running a Tcl/Tk applet within a Tcl/Tk program

9. converting Java app to Tcl/Tk ( new thread for all the tcl/tk itcl gurus)

10. Tcl/Tk 8.2.3 and Tcl/Tk 8.3.0 under windows

11. Mixing Xevents and Tcl/Tk events with tcl/tk version 8.0/8.2

12. tcl/tk-scripts, Apache & tcl/tk-plugin

 

 
Powered by phpBB® Forum Software