Chronos is one of the many Smalltalk-related blogs syndicated on Planet Smalltalk
χρόνος

Discussion of the Essence# programming language, and related issues and technologies.

Blog Timezone: America/Los_Angeles [Winter: -0800 hhmm | Summer: -0700 hhmm] 
Your local time:  

2005-12-27

Why Chronos?

I thought it would be appropriate to start my Chronos blog by explaining my motivations for creating and publishing the Chronos Date/Time Library.

It all started back in 1984, when my friend Kenton Hoover encouraged me to purchase a book named Smalltalk: The Language And Its Implementation (affectionately now known as the "Blue Book.") When I first read it, I did not have access to an actual Smalltalk implementation, and so failed to get the complete experience and complete understanding. Nevertheless, the book had a profound impact on my computer programming and computer science world view.

About a year later, a technical support person wheeled a Tektronix 4404 Smalltalk workstation into my cubicle at Bank America (in an office building on Spear Street in San Francisco.) Over the next few months, I came to fully understand the terms 'class,' 'object,' 'instance,' 'message,' 'method,' 'metaclass' and 'block,' in a way that transcended the level of understanding I had achieved from just reading the Blue Book. The mental transformation involved is not unlike the one that must happen in order for someone with an Aristotelian weltanschauung to grok Newton. [Most programmers have yet to benefit from an equivalent enlightenment, including many who think they already have. But more on that at some other time.]

Smalltalk was so far ahead of anything else available at the time, that fully experiencing and grokking it during the mid 1980's can best be compared to taking a ride in a time machine to a world decades in the future. But instead of enumerating all the advantages of Smalltalk compared to its mid-1980's competition, let me focus on just one small facet of the overall picture: Dates and Times (which are, after all, the subject of both this post and this blog.)

For most programming languages in 1985, the handling of dates and times was left to application coders to deal with as best they were able (ahem.) Which is not to say that there weren't reusable date/time libraries available for some of the major languages. For example, the <time.h> module of what is now the ANSI Standard C library came from code donated to 4.3BSD Unix by Arthur David Olson in 1986. The <time.h> module was incorporated into ANSI C in 1989.

By the standards of the day, <time.h> was in many ways rather superior to anything else that was commonly available. For one thing, it actually dealt with time zones in a reasonable way. For another, its internal representation of time was a count of seconds since an epoch, specified in Universal Time (which is often incorrectly referred to as either GMT or UTC—but more about that at some other time.) In this, C's <time.h> module was superior to Smalltalk's Date and Time classes. But in 1985 and early 1986, I didn't know any of that. In fact, I didn't even learn C until 1988, and didn't pay much attention to <time.h> until much later.

Unlike any other language with which I was familiar at the time, Smalltalk actually had dates and times as coherent, first-class values. You could assign them to variables, pass them as arguments, and return them as the result of a message send. You didn't need to know or care anything about the internal representation of a Date or Time object. Because of the way Smalltalk works, and because the Date and Time classes were included as part of the "standard class library," it was the equivalent of having Date and Time as "built in" data types in Pascal, Modula-2 or Ada.

The fact that "types" (classes) implemented by the programmer can have the same "look and feel" as "built-in" types is of course one of the major benefits of Smalltalk compared to most of its competition. Dates and Times are one of the more compelling concrete, non-theoretical examples of why that matters. In 1985, the idea of having a Date type and a Time type was a revolutionary advance.

From my 1985 perspective, Smalltalk started out in a situation where its support of Dates and Times was second to none. In 2004, when I started work on what is now the Chronos Date/Time Library, that was no longer the case. Chronos is my attempt to restore Smalltalk to the same position with respect to date/time handling that it enjoyed back in 1985 (as I saw it then.) I want the programmers of today to experience the same feeling of delight about Smalltalk's date/time capabibilities that I felt back in 1985. And I also hope to inspire others to make similar contributions to Smalltalk (and/or its deserving successors) in other domains.

Additionally, I want to encourage the various Smalltalk implementations to grow together, and not apart. Smalltalk needs a much wider and deeper "standard library" if it is going to survive. I hope that Chronos will be a significant contribution towards that goal.


2 comments:

Anonymous said...

One thing I'd like to see are iCalendar like recurence rules:
Every other year the last two workdays in July at at 8:30 AM and 9:30 AM

And of course a squeak port ;)

Alan Lovejoy said...

One thing I'd like to see are iCalendar like recurence rules:

Yes, I intend to implement recurrence rules. What I haven't decided is whether to make them a part of Chronos, or whether to provide them as a separate component built on top of Chronos.

And of course a squeak port ;)

That's the number 1 request I get. I'm still hoping someone else will step up for this job (hey, I've made my contribution already.) However, once I'm done with Production Release 1 of Chronos, and there's still no Squeak port done by others, perhaps I'll do one myself.