I’m taking a break from posting about Clojure this week, because a few weeks ago my study of Clojure inspired me to work on a non-Clojure project. That sounds odd, I suppose, but it’s often the way: in studying some programming language I’m not familiar with, I get ideas for work in areas I am familiar with.
In this case the inspiration came from the Leiningen build tool, which I gushed about a couple of months ago. To recap, a budding Clojure programmer need only download Leiningen; and it will not only make Clojure available, it will make it absurdly easy for the programmer to get his code out into the Clojure ecosystem for other people to use.
Now, my favorite programming language is TCL/TK, and my contributions to open source software over the years have all been related to TCL/TK; and my immediate reaction to Leiningen was, “Gosh, I want a program like this for TCL/TK!” And then, some time later, “Hmmm. You know, I could do this, and this and…” More dangerous words were never uttered.
Anyway, the long and the short of it is, I’ve been working on a project called “Quill”, which is a TCL/TK analog of Leiningen. It’s early days, yet, but the initial version, Quill 0.1.0, is now available at GitHub for those who are interested. It isn’t as simple to set up and use as Leiningen quite yet, but I’m surprised at how far I’ve been able to push it in such a short time.
Assuming your computer is set up properly (I’ll explain what that means further down, because it isn’t as simple as I’d like), you can do this at your command line of choice:
$ quill new app my-project mytool ... Creates a project skeleton for my-project, containing the ... code for an application called mytool. $ cd my-project $ ./bin/mytool.tcl Hello World my-project 0.0a0 Args: <Hello World> $ quill build ... Builds the application as ./bin/mytool.kit $ ./bin/mytool.kit I'm a Program my-project 0.0a0 Args: <I'm a Program> $ quill install ... Installs ./bin/mytool.kit to ~/bin $ mytool I'm Installed my-project 0.0a0 Args: <I'm Installed>
In just a couple of minutes, you can go from a standing start to an executable file which you could give to someone else. Mind you, you still have to write the code and the documentation (and the test suite) but the basic skeleton is there.
The cool thing about this is that it will make it possible for me to put together small applications and send them to people. TCL is a great language for writing small programs…but you need to have TCL installed on your computer to run a simple TCL script. With Quill, I can write a simple script, and immediately package it up for delivery to a computer that doesn’t have TCL.
In addition to the above, Quill can:
- Format attractive HTML documentation for you, with navigation links.
- Run your test suites (once you’ve written them).
- Build library packages for deployment on other people’s computers.
- Pull down external dependencies (from ActiveState‘s “teapot repository”), and include them in your projects.
OK, now, back to those weasel words about having to have your computer set up properly. For Quill 0.1.0,
- You need to have ActiveTcl 8.6.1 installed on your computer. You can download ActiveTcl for free from ActiveState.
- It has to be installed on your “path”. (Programmers, you’ll know what this means.)
- You need to have installed the Quill executable into a directory on your path.
- To build executables, you need to have ActiveState’s TclDevKit tools, which are not free, alas (but there’s a free trial).
And then, of course, there will be other issues. Quill has been tested on Mac OS X. It was intended from the get-go to run also on Windows and Linux, both of which I’m familiar with; but I’ve not yet done so, and it’s possible there will be glitches. (If you try Quill, please report any problems using the Quill issue tracker at GitHub).
Work on Quill is on-going. Quill currently builds as a “starkit”, meaning that it depends on the version of TCL you have installed on your system. The next step is to build it as a standalone executable, and enable it to build projects for whatever version of TCL you happen to be using; and then, for pure-TCL projects, enable it to build standalone executables for other platforms (i.e, so that I can build Quill for Windows on my OS X machine.)
So much to do!