My TCL Desktop     ml124.kit & ezsdk045.kit


I like TCL. It is kind of a robust language, but hard to understand, because there are so many options.  I don not like TCL implemented as an OO (Object-Oriented language).  If you are OO, it makes your programs huge to support OO.  Also you have to  support OO in your source code, which make it a LOT larger.  No thanks. 

I found a good editor which was written in TCL, which is about 50k in size, which was named ML Tcl/tk Text Editor - v1.12.  You can edit up to 10 files at the same time. Nice.  Some good features in there:

  • cut/copy/paste
  • Find/replace
  • Printing
  • etc.

It did look something like this (which was pretty good ten years ago).

cap20120629_100947.gif
cap20120629_100947.gif
19.89 KB

Just for comparison, another editor which was ok, but, although was written in TCL, as Object-Oriented language, was 7.4 gigs vs 50k.  50k is only (50 X 1024 bytes), not 50 meg (which would be 1000 times bigger), but 7.4 gigabytes which would be 1,500,000 times larger in terms of source code. Wow!  The download of the executable installer was  4.8 gig (zipped).  Instead my total size of my ml124.kit is around 56k (or 56 X 1024 bytes).  See why I dislike OO in TCL?

I've modified it quite a lot (ml.tcl is about 77k), lost some changes, put some back in, and I like it a more now.

cap20120718_223658.gif
cap20120718_223658.gif
59.55 KB
Here are some of my changes.



cap20120718_223752.gif
cap20120718_223752.gif
40.21 KB
This is where I've modified it to come up with a popup menu, to:
  • 'Save'
  • 'Save and Run' or
  • 'Save and Run ../main.tcl'

This is great whether you're running straight .tcl files or you're editing a .tcl file within a starkit, and you need to run main.tcl to run the starkit, without having to re-Wrap it first. Then after you get it working correctly, you should Wrap, Test, and then Copy it off to another directory (in case you mess it up later).   If you don't understand what I just said, allow me to ask questions for you.


Wait a minute... I know TCL is Tools Command Language. You said "Wrap" it. With what. What is a starkit?

   Well a starkit could be quite small (or fairly large, especially when unWrapped). When it is executed, it is really a zipped file, that will unzip itself into memory, and then execute.

So what do I need to run it?

   What you need to run it, even if you don't know TCL at all, is that you can run it without having to install all of TCL (which is around 32 gigs) and instead have only one file to run it which is around 4 gigs. One can find them here. The file is named something like this:

  • tclkit852.exe
  • tclkit-8.5.8-win32-x86_64.exe

What's the difference between these two files? Would either of these run the starkit? How big are they?

   Good questions.  Both files have the tcl in there, but different versions of tcl, which is up to 8.5.8 right now. You can see that one is 8.5.2 and the other is 8.5.8. the remainder of the the filename is what platform it runs on (win32-x86) Windows XP and up and one happens to be a 64 bit version.  So tclkit-8.5.8-win32-x86_64.exe is that. The tclkit-8.5.8-win32-x86_64.zip is under 2 gig, and unzips to tclkit-8.5.8-win32-x86_64.exe at around 4 gig. A kit version is just a runtime version of TCL. It can run anything that really is a foo.kit file.


What's the difference between a kit file and a starkit?

   Well it's pretty simple, starkit are kit files.

A .kit file contains all the files necessary to execute the kit file, which could be many. They have all been zipped. They will unzip into memory, and run in memory.  They will have a directory structure and perhaps many files in them under different folders. A real kit file (starkit) can turn into an executable (foo.exe) with a penalty of the size of an executable tclkit. You can read more about starkits here if you want to learn more about them.  A special version of a starkit is a starpack which includes tclkit inside of it, which makes it completely executable.  This is good but it makes it quite a bit larger.


So if I have a foo.tcl file, how do I turn it into a  or starkit file?

   Well, what you need is SDX. You use it to convert it to a foo.kit. You need to use it to regularly Wrap foo.kit. It is kind of wierd running it on Windows. What you have to do is Qwrap it first, then Unwrap it next.
Then what you need to do is find the proper folder which was just created 'foo.vfs/lib/app-foo' and edit foo.tcl.    You can look here or here to find out about SDX.


What's Next?

  So let's say you're editing foo.tcl under the folder  'foo.vfs/lib/app-foo'.
Go ahead and make some changes. When you're done what you should do is save it, then re-Wrap it, and then you can test it.
Ouch got an error in syntax. Ok.. Go back and fix the error by trying to change the source to what it should be and rerun the sentence above.
It's commands are kind of simple but a pain to type. Ouch it seems like it's kind of a pain doesn't it?


What did you do?

    Well first didn't I tell you about my version of ML 1.2x.x? It's got a right-click pop-up menu where you can 'Save and Run ../main.tcl'.

cap20120718_223812.gif
cap20120718_223812.gif
67.41 KB


What does saving the file you're working on and 'Run ../main.tcl' do?

   It first Saves the file, and then runs the equivalent of the wrapped kit file by executing ../main.tcl.

So here is a program I'm messing around with a little bit. It is called yet another clipboard manager, or short for that is yacm.tcl.  It is by no means near completion, not even close to release 0.70x, but it is a work in progress.  I will tell you later in this page how I converted it from yacm.tcl to a starpack.

It does do what I wanted it to do, which is to remove blank lines from a copied Web page. I looked around a lot a couldn't find anything else that could do that, so I wrote one.

So I'm currently editing the source code which is in 'D:\dl\dcl\mine\icons\yacm.vfs\lib\app-yacm\'.  I'm doing this by using ML on the source code of yacm.tcl (which is all of the main program of the  starkit).  So look at this and you'll see where I'm at in my hard disk.

Picture Not Found!

See the 'Modified' in red? I've just right-clicked and selected 'Save and Run ../main.tcl'.

Picture not Found
And here is the program running.  A lot faster in getting the program saved and running it.
I'm actually sort of cheating and running ' ../main.tcl' which is equivalent, sort of, to running the re-Wrapped starkit.  What I'm not doing is
  • Saving
  • re-Wrapping
  • re-Executing.
So, I save it and run it by right-clicking and using the 'Save and Run ../main.tcl' option.  It saves, runs it in about  2 seconds, and bang I've got a new screen for the program running.  Nice huh?

You can download ML from the top or bottom of this screen
cap20120718_223827.gif
cap20120718_223827.gif
24.10 KB
So how did you convert it to a starpack?

  Well I've written a program to do that for me.  Have a look at it.


cap20120718_224443.gif
cap20120718_224443.gif
26.48 KB
This program can handle both types of files:
  • foo.tcl
  • foo.kit
You can run the file even if you are editing it with say notepad, which knows nothing about .tcl files.
You can Qwrap it and Unwrap it.  If you open a .tcl file and try to unwrap it you'll get an error message like this:



Once you've hit the Qwrap button you'll get an error message like this:



If the .kit file exists. If it doesn't you'll get a message like this:



This make you realize you have to check the console screen by hitting the debug button.  If you do you'll then see this:



What you should look for is what happens to the file you've been editing after the line 'sdx::sdx qwrap foo.tcl'.  If it worked then you can hit the Unwrap button and you'll see a message like this:



and likewise:



So if it worked it's now a starkit.  You can download it (around 160k, because it includes sdx) here as ezsdk045.kit .

Here's the almost current about screen ->


cap20120718_224450.gif
cap20120718_224450.gif
32.66 KB

and here's the debug screen.
It really does work.  When I save the program in ML Edit and click on the ' Wrap & Run' button it takes about 4 seconds to wrap and run.  But that does not include the save button in that.

Here is the somewhat current version of ML which is ml124.kit .


cap20120718_224500.gif
cap20120718_224500.gif
18.96 KB

Created with the help of IrfanView