Version 135 of ToW Tcl on WebFreeWay

Updated 2007-05-17 14:08:26 by NEM

APW 2007-05-16

Inspired through the discussion on "Tcl on Rails" I had some thoughts on how to make that or at least a part of it happen.

As I was thinking about some Tcl tools to help me create some personal webpages I think that could be the starting point of going deeper in that area. Knowing nothing about "Ruby on Rails" (RoR) until some days ago I have now had some contact with it through downloading it and looking for some of the features.

This page shall be a container to collect ideas, wishes and concepts on something similar to "Ruby on Rails" but done with Tcl and adding features for use of XML and XSLT additionally (I don't know whether RoR also supports that). Comments are welcome.

My idea is to build something using Tcl/Itcl/TclXML/TclXslt and starkits for use with Apache 1.3 and Rivet or tclhttpd or wub.

I know that I am too late to fight against RoR- that is not my intention, but I see it more as a fun project.

Everybody who is willing to help is invited (I know it will be very few :-) ), but you can also help me with your comments.

When I am really starting to implement the project I will give it the name ToW (Tcl on WebFreeWay). That was inspired by the term, which I saw in the USA, "car in tow" and it should reflect the picture: take that package as a "car in tow" which you just add to your application and you have access to the Web freeway.

I hope this page gets a lot of comments on the general idea and on requirements/features you would like to have.

This is the starting point to get it somehow done instead only discussing about it!

RLH I would have some suggestions. Either use Tcl+Snit to have a pure Tcl solution that is easy to install since it is all Tcl or use XOTcl. I personally would use Snit for the all Tcl version. I would also program it to target the CGI space and scale well up to FastCGI and above. It will be much easy to get Tcl installed for CGI and you would have a better chance of more people using it. I know that NearlyFreeSpeech [L1 ] gives you Tcl 8.4.14 to work with as a CGI process. So maybe that could be a proving ground because it is a pay as you go service and would be "cheap" to use.

APW I like Itcl much more then XOtcl, so I don't know if that will be the way ..., and I will think about Snit.

MR If you're going this way, you may be interested in a short e-book called 'Rubyisms in Rails' (available on Safari and elsewhere). It talks about how some of the particular language features and philosophy in Ruby were taken advantage of to give Rails some of the convenience and expressivity that people have liked. Some of the techniques would translate nicely to Tcl, some would not, and of course there are some Tcl idioms that might well make a lot of sense in this domain that aren't present in Ruby. The point is, doing a web framework that respects Tcl idioms would be quite different, and probably more interesting and useful, than one that simply tries to clone Rails in Tcl, which would likely result in a weird impedance mismatch.

APW It was not my intention to just clone RoR, but to build some tclish framework and get a little bit inspired from RoR.

LV Amen! One of the complaints that I have frequently heard about pTk (a perl effort to make use of the Tk C interface without including any Tcl) has been that the interface was not perl-y enough. I would think there isn't really a need for a straight port of ruby on rails to Tcl. Instead, evaluating what people using ruby on rails love most - which, from the brief browsing I've done, is the sheer ease of specifying minimal specs and getting generated a web site which takes intelligent defaults (gee, sort of sounds like what some people love about Tk!).

APW I am not planning a straight port, that is why I am asking for features which are useful. My direction will be to build some generators to make it easy as LV suggests to build at first simple web pages and later on web pages with more comfort.

For example I am thinking about having an XML structure (maybe similar to a XML-Schema specification) and to use that to generate XSLT templates, which then can be filled. But that is an additional feature besides "normal" HTML files. I am also thinking about a little tool which helps you defining CSS files (maybe something in that direction already exists). Another tool would be a simple generator which use a xml, xslt and css file and generates the html file (that's very easy using the tools already there but for beginners that might be hard). I would also like to have as one of the databases a starkit/meta DB and I think some of the tools or all should be in a starkit to make it easy to install and start. There should be also included one of the Tcl http servers to be able to generate a small application to begin with with minimal effort.

RS Starting with Schema, XSLT, CSS doesn't look like minimal to me :^) I'd suggest to start from one use case, see what's needed for that, and how it can be implemented with most convenient for the user. Then the next, etc. ... APW you are right, XSLT, CSS etc. are not planned for the start, that is only planned for a later version :-).

escargo 16 May 2007 - I've looked at this problem from a couple of viewpoints before. One question that's central is, "Is the user trying to have access to an existing data base store, or is the user wanting to manipulate some population of objects that he or she wants to be persistent?" In the latter case, one could have Snit objects, something like the Snit object inspector, and a Snit persistence layer through a Snit data base connector. (Instead of a Tk interface to the Snit object inspector, one would need to generate a form that presented the same information.)

slebetman You guys are already starting to talk about implementation here. Whatever the implementation ends up being, itcl, XOtcl, snit or plain ensemble, I hope from the user's point of view it looks and feels like Tk. For me, the user, I don't want to be forced to work in an object oriented manner. I guess snit is the most flexible choice. Anyway, the key is the features. What I'd like ToW to have is:

  • scaffolding generator (with nice, sensible defaults)
  • separation of presentation and business logic (MVC will do this, but there are other ways)
  • database neutrality (either a back-end neutral API or like Rails a migration tool)
  • web server neutrality (scales from CGI and up)

APW I had the same in mind as slebetman suggests.

JE RS' suggestion -- start from one use case, implement that in a way that's convenient for the user, then do another one, and another, and another, is a very good approach. You can't tell if a Web App framework is useful until and unless you've built actual Web Apps with it. So: does anyone have any ideas about what sort of applications they want to build?

DK77 Here's an uninformed opinion: Be as inflexible as possible. If you think OO using Snit with an sqlite backend is the way to go, don't worry about making allowances for those who see things differently. It's too complicated and they're probably wrong anyway.

M If you start with NaviServer and ns_db, you'll be half-way there. You can borrow extensive code and ideas from OpenACS. Most important things, at least to me, seem to be the mechanisms that ties the database to code, and the code to the UI. Do these right, and you have a winner.

APW 2007-05-17 I am happy that the discussion now gets a little bit more concrete, seems it is possible to get more people involved in a starting project, then I was expecting. Please continue to write down your ideas and thanks for the ones which have already been written down!


RS: re hype psychology, I'm not sure that "On Tow" has all positive connotations - doesn't it suggest "Here's a defective vehicle being slowly towed to repair or demolition"?

APW I had more people in mind which are driving there trailer when having holidays and had their "normal" car in tow. Don't know, if that is still true, my experience is 25 years ago. Nevertheless I am open to a better name for it, please make suggestions. I think it should be a really "cool" name, to help it to become well known, if the project succeeds.

stevel Tcl on Trax ?

APW What does "Trax" stand for?

MR FWIW, most of the suggestions about what to include so far would correlate to building yet another web framework without most of the conveniences that Rails brought (not that there is anything wrong with that, just saying). If you think the big thing about Rails is the scaffolding, you're missing the point. The other meta-note is that one of the reasons Rails was interesting is that (being extracted from a particular type of application), it handles a certain class of application very well, and becomes just gross for many other types of applications. The Tcl community historically has worried a lot about generality and doing things to fit many different situations, which is the antithesis of this approach. Frankly, I'm not about to knock anyone who wants to go about writing a Rails-or-any-other-framework-in-Tcl knockoff from scratch "just because", but my expectations for anything of the sort would be quite modest.

Also of interest might be a framework that targets a different type of web (or other) application. Are there niches that existing solutions aren't filling well? Are there any such niches that Tcl seems to do well in? Are there existing Tcl apps in the niche to use as inspiration (extracting the framework from them, or at least core ideas)? Is the niche large enough to support a bit of a community of users, and can enough be put in place off the bat to interest that community? And could people be restrained enough to stay focused and not try to turn it into a general purpose solution capable of doing anything, but nothing well?

APW Just one question to MR: what do you mean with "conveniences that Rails brought"? Maybe that also can at least partially be included, if I know what you are speaking about.

NEM Like others, I'd say keep it simple and concentrate on a single particular application you want to build. I'd also suggest that the very first thing you should do is figure out why we need this project at all:

  1. What is wrong with Rails/Django/Struts/whatever?
  2. What particular advantages would a Tcl framework have?
  3. What sort of applications do you want to build? Digg/Reddit-style aggregators? Amazon-style business sites? 'Blogs? Forums? Calendaring/email/PIM stuff? Word-processors/spreadsheets/database apps? Pick one to start with.

Category Application | Category Internet