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:  

2006-04-30

Chronos Version Published for Dolphin

I am pleased to announce the availability of a version of Chronos ported to Dolphin (Chronos version B1.171, also now available for VisualWorks and Squeak.)

The Dolphin version currently has no support for any locales other than en_US (US English,) and has no support for retrieiving time zone rule sets over HTTP. Other than that, it provides all the same functionality as the VisualWorks version.

Links to download Chronos:


You should also read the Chronos installation instructions (which admittedly need to be updated to cover both Dolphin and Squeak.) Dolphin uses "package files" (ending in *.pac) instead of either "file ins" or "parcels." The Dolphin version is distributed as the file Chronos.pac (in the archive file Chronos.zip, which also includes the Chronos Time Zone Repository.)


Static typing is so last century

In the article Schizoid Classes published on the ACM Queue, Rodney Bates (of Wichita State University) does a good job of explaining what's wrong with the class models of the curly-braced mainstream langauges.

However, in his last paragraph, he says:

"Smalltalk pays a high price elsewhere for taking object orientation to the extreme, notably in complete loss of static typing and serious runtime efficiency penalties. Special, one-instance forms of classes are, for many programming problems, not as good a conceptual match as modules. But at least it provides a single, consistent, and syntactically explicit call mechanism."

He's right to say that "special, one-instance forms of classes are, for many programming problems, not as good a conceptual match as modules." But he's demonstrably wrong to say that "Smalltalk pays a high price elsewhere for taking object orientation to the extreme, notably in complete loss of static typing and serious runtime efficiency penalties."

Firstly, it is only sometimes true that Smalltalk pays a measurable performance penalty due to the lack of primitive types. In fact, it is very often the case that Smalltalk programs benchmark as faster than equivalent programs written in C++, C# or Java--for any of a variety of reasons I won't go into here.

Secondly, Smalltalk pays no net penalty for its lack of static typing--commonly-believed myths to the contrary notwithstanding. In fact, it receives the net benefit of making developers more productive and making code more generic and reusable.

Static typing is so last century. Interest in dynamic languages is growing. A Kuhnian revolution may be brewing. I sense that it won't be long now before the general community of programmers wakes up to reality, and stops believing the myths of the past.


Scientists make water run uphill

From the BBC, Scientists make water run uphill:


Physicists have made water run uphill quite literally under its own steam.

The droplets propel themselves over metal sheets scored with a carefully designed array of grooves.

The US scientists did the experiment to demonstrate how the random motion of water molecules in hot steam could be channelled into a directed force.


2006-04-28

Nano World: Roadmap for nano-imprinting


Nano World: Roadmap for nano-imprinting from PhysOrg.com

Scientists could soon easily fabricate electronics and other structures only nanometers or billionths of a meter in size by stamping them out, following a new strategy that could help guarantee results, experts tell UPI's Nano World.
[...]




2006-04-27

I think, therefore I am...granted access

From Wired: Your Thoughts Are Your Password

I guess this just wouldn't work for some people. After all, it requires that one actually has thoughts :-)


Hormone Found To Decrease Appetite And Increase Activity

From Science Daily:

"New research shows how topping up the levels of a hormone found in the gut could help reduce the appetite and increase activity in overweight and obese people."

Link to the full story: Hormone Found To Decrease Appetite And Increase Activity


2006-04-26

Water, nanoelectronics will mix to create ultra-dense memory storage


Water, nanoelectronics will mix to create ultra-dense memory storage from PhysOrg.com

Excessive moisture can typically wreak havoc on electronic devices, but now researchers have demonstrated that a little water can help create ultra-dense storage systems for computers and electronics.
[...]




MIT Chemist Discovers Secret Behind Nature's Medicines

From Science Daily:

"MIT scientists have just learned another lesson from nature. After years of wondering how organisms managed to create self-medications, such as anti-fungal agents, chemists have discovered the simple secret."

Link to full article: MIT Chemist Discovers Secret Behind Nature's Medicines.


2006-04-25

Our Universe: A Quantum Loop


Our Universe: A Quantum Loop from PhysOrg.com

“There are two classical branches of the universe connected by a quantum bridge. This connects the former collapse with the current expansion.” While Abhay Ashtekar and his colleagues, Tomasz Pawlowski and Parampreet Singh, may not have come with a completely new theory, what they have done is create a systematic way, through quantum equations, to look back in time to the birth of our current universe.
[...]




Taking Exception To Smalltalk Exceptions

About 3 weeks ago, Cincom's James Robertson posted a blog entry that showcased Smalltalk's exception handling capabilities.

About three days later, some posters at Lambda The Ultimate took exception to the power of Smalltalk's exception handling capabilities [fixed URL]:

"So what you're saying is that you want to be able to bind exception throw behaviour dynamically, rather than lexically. The end result being that a caller can bind handler code into any (uncaught) exception throw, without having any way of knowing the source(s) of the possible exceptions, or their root cause.

How, exactly, is one supposed to document the exceptional behaviour of a library class in that case? What possible security gaurantees could one give, if a calling library can inject arbitrary code on any error condition, and ignore or mask the error as it will? How would you even exhaustively test such a thing, other than by ignoring the horrible stuff that your caller could have done to you and pretending you're in some some language?" -- Dave Griffith [I assume that "some some language" was intended to be "some sane language."]

I have news for Mr. Griffith: Programs Are Data. That truth is one of the pillars of computer science. Deal with it.

If programmers can't be trusted with the stack, they can't be trusted to assign the right value to a variable, nor to pass the right value as a parameter to a function. Compilers are tools, not hall monitors.


2006-04-24

Nano machine switches between biological and silicon worlds


Nano machine switches between biological and silicon worlds from PhysOrg.com

Scientists have created a molecular switch that could play a key role in thousands of nanotech applications. The Mol-Switch project successfully developed a demonstrator to prove the principle, despite deep scepticism from specialist colleagues in biotechnology and biophysics.
[...]


The nanotechnologists have been proving the naysayers wrong time after time. This is just the latest example.


Interstellar Deathray Not Likely to Hit Earth

From Space.com, yet another headline that ought to win an award: Interstellar Deathray Not Likely to Hit Earth.




2006-04-22

Time Semantics: Getting it wrong is easy

Outlook, Appointments and Time Zones:

"To many people, Outlook really seems really bad at handling time zone changes, and that's being kind. This is in part because people don't understand that Outlook uses UTC time for appointments and adjusts the time using the time zone offset configured on the computer."

Translation: You're stupid. Learn to think like your computer!

"Note that this is not "an Outlook problem", as this is how computers, email clients and mail servers handle time zones."

Translation: Other programs work just like Outlook, and the programmers can't all be wrong. [Or can they?]

"Outlook does not support an absolute time option for the calendar, which would permit you to enter 2 PM and the appointment would always stay on 2 PM, no matter how many times you changed the time zone. It also doesn't have an option for ‘in what time zone?’ so that you could make an appointment for 2 PM and select Pacific time zone and it would show up as 5 PM in your calendar when the computer is using the Eastern time zone."

Translation: Ok, we fess up: The problem really does lie in the fact that Outlook uses the wrong time semantics.

The Moral of the Story: Even Billion-Dollar Corporations can get time semantics wrong.

Sometimes, you want timestamps that are invariant to nominal time, so that 3pm = 3pm, with the time not bound to any time zone at all. Other times, you want timestamps that are invariant to Universal Time--so that 2pm in San Francicso will be equal to 5pm in New York.

Sometimes, you want timestamps statically bound to a specified time zone, so that 2pm in San Franciso always is displayed as 2pm (even though the computer treats it as equal to 5pm in New York.) Other times, you want timestamps whose "local time" changes dynamically to match whatever time zone the user specifies as the "local time" of the computer--so that the time displays as 2pm when you've set the computer's time zone to San Francisco time, but displays as 5pm when you've set the computer's time zone to New York time.

Unfortunately, not only do most applications get this wrong, most date/time libraries don't support both nominal-time invariance and Unviersal Time invariance, nor do they support both timestamps statically-bound to a specified time zone and also timestamps bound dynamically to the current system time zone.

Chronos does it all.


2006-04-20

A Strategic Opportunity for Smalltalk

Mark Shuttleworth:

"Instead of fighting over turf or syntax, I sensed a genuine willingness to synthesize the best work from both camps into something that could have both Python's pop-culture widespread appeal, and pedagogical foundations that build on years of Alan's experience in the Squeak world. The mouse might yet become the snake's strongest ally."

The computational model (which depends heavily on the VM) is strategic.

Syntax (which is just a matter of which compiler one happens to use) is tactical.

Avi Bryant had the right idea: Strategic thinkers in the Smalltalk community should create strong, compelling implementations of Python, Ruby and Perl, hosted on Smalltalk VMs--such as Squeak's.

Adding Erlang, Haskell, Io and Ocaml wouldn't hurt, either.

When it comes to advanced, dynamic programming languages, it's "United we stand, divided we fall."


John Koza Has Built an Invention Machine

Its creations earn patents, outperform humans, and will soon fly to space. All it needs now is a few worthy challenges

As a high-school student in the 1950s, John Koza yearned for a personal computer. That was a tall order back then, as mass-produced data processors such as the IBM 704 were mainframes several times the size of his bedroom. So the cocksure young man went rummaging for broken jukeboxes and pinball machines, repurposing relays and switches and lightbulbs to make a computer of his own design.

[Click here for the rest of the story]


2006-04-18

Sci/Tech: Communication Channel Secured by Quantum Mechanics Used To Transmit Encryption Key at Record Speed over Fiber


Code for 'Unbreakable' Quantum Encryption Generated at Record Speed over Fiber from PhysOrg.com

Raw code for "unbreakable" encryption, based on the principles of quantum physics, has been generated at record speed over optical fiber at the Commerce Department’s National Institute of Standards and Technology. The work, reported today at the SPIE Defense & Security Symposium in Orlando, Fla.,* is a step toward using conventional high-speed networks such as broadband Internet and local-area networks to transmit ultra-secure video for applications such as surveillance.
[...]




Sci/Tech: Simulation Breakthrough: When Black Holes Collide


Simulation Breakthrough: When Black Holes Collide from PhysOrg.com

NASA scientists have reached a breakthrough in computer modeling that allows them to simulate what gravitational waves from merging black holes look like. The three-dimensional simulations, the largest astrophysical calculations ever performed on a NASA supercomputer, provide the foundation to explore the universe in an entirely new way.


[...]




2006-04-15

The Videotape Recorder Turns 50

Quote:

"During his remarks, Lodge mentioned a new technological breakthrough, but was not specific. At the conclusion of his address, he remained at the podium. As the crowd began to murmur and break up, the video monitors went from black to an image of Lodge. Only this time, Lodge was still making his presentation, not standing silently.

This was a seeming impossibility, as the only means for preserving video images was kinescope recording, a process in which a special motion picture camera photographed a television monitor. When the recording was finished, the film had to be removed and sent away for developing. Under normal circumstances, this could take hours.

The crowd, realizing that they were experiencing something very unusual, became hushed and locked onto the monitors, viewing an image of Lodge that was indistinguishable from the video seen just moments before. Again, this was quite uncanny, as even the best "kine" had a distinctive look that set it apart from the live video it had captured.

Then a curtain opened, revealing a strange machine and four individuals hovering around it. The crowd couldn't restrain itself and amid cheers, whistles, back slappings and applause, began pushing and pressing in around the world's first video recorder and part of the team that had made it possible. Some even stood in chairs to get a better look at the device that was making this miracle possible.

That was the scene 50 years ago this month."

For the rest of the story, follow the link to The Videotape Recorder Turns 50


Daylight Saving Chaos

Just saw this post from Stilgherrian on the mess caused by a this-year-only change in the date for transitioning from DST back to standard time in Australia.

Key points:


  • Because the Windows fix wasn’t security-related, it wasn’t labelled “critical” — so it wasn’t downloaded automatically by Windows Update.

  • Even downloading the daylight saving Hotfix and digesting Microsoft’s easy to follow (ahem!) overview wan’t enough. [Stilgherrian's] own properly-patched Windows XP test computer still reverted to standard time anyway.

  • Microsoft’s patch has to be removed [next year], because Windows can’t cope with different rules for different years.

Macs and Unixes also had problems.

I've added Stilgherrian's post to the "Cautionary Tales" page of the Chronos web site.


2006-04-13

Architecture is not inflexible dogma

Chris Petrilli goes off on a great rant against the typical stupidities of corporate IT:

"People obsess over the choice of tools, but the true talent, and the true skill, is the understanding of business problems that are trying to be solved, including the window available. If my tool—whatever it is—can help me focus and be more collaborative with the people whose problems I’m trying to solve, then it’s a better tool."

Coffeehouse chess players have often memorized all the moves for all the variations for all the standard chess openings--as recorded in books. But when a Grandmaster presents them with a move not in the books, they're lost. After all, it's the grandmasters who write those books.

True artists create great works of art using their native talent. Others paint by the numbers. Of course, true artists specify those numbers.

True software architects know when to apply architectural/design patterns elucidated by others, and when and how to invent their own if that's appropriate. Enterprisey architects follow the rules popularized a decade (or more) ago by someone they ignored at the time, but whose methodology and thinkng they now apply dogmatically without fully understanding the system's limitations.

Gifted sofware engineers know when counting the number of classes, or the number of methods, or the number of instance variables is a valid measure of code quality--and they know when such "painting by the numbers" is simply invalid to the case at hand.

Great architects judiciously break the mold, creating new rules that work better than the old ones. Dogmatic architects defend the old rules by force of habit, because that's the "safe" thing to do.

Don't be caught fiddling while the enterprise burns.


Sci/Tech: Rice scientists attach motor to single-molecule car


Rice scientists attach motor to single-molecule car from PhysOrg.com

In follow-on work to last year's groundbreaking invention of the world's first single-molecule car, chemists at Rice University have produced the first motorized version of their tiny nanocar. The research is published in the April 13 issue of the journal Organic Letters.


[...]





2006-04-12

The Timing of Time: Chronos Benchmarks

The time has come, the benchmarker said, to speak of many things. Of dates and times and cold, hard facts, of durations and timings. Of why the code is boiling hot and whether Chronos has wings (with apologies to Lewis Carrol.)

To put it less poetically: What follows are some benchmars comparing the Squeak version of Chronos (Version B1.167) with Squeak's native Chronology library.

First, let's level set. I've been working on Chronos since October 2004, and although it's my first attempt to implement a date/time library in Smalltalk, and it's the first time I've ever implemented a date/time library as a hobby without being paid by an employer, it's not at all the first date/time library I've implemented. I essentially "started from scratch" on the fundamental architecture/design of Chronos at least three or four times. I have spared no expense in time, effort or amount of code to achieve both the functionality I was determined that Chronos should have, and also the level of performance I thought was necessary/achievable. In other words, you should have every right to expect that Chronos would generally exceed the level of performance provided by the "out of the box" date/time libraries as distributed with the various Smalltalk implementations.

Also, it should be noted that Squeak is among the august group of Smalltalk implementations that make any attempt to have their date/time package conform to the ANSI Smalltalk Standard (VisualAge, Gnu Smalltalk and #Smalltalk are the only others, as far as I am aware.) More than that, Squeak's Chronology package exceeds the ANSI-required functionality, in that it offers significant and useful behavior related to intervals of time.

1. The hardware and software used for the benchmarks:

CPU: AMD FX-55
Chipset: nForce4-Ultra
Motherboard: MSI K8n Neo4
RAM: 2GB DDR400
OS: Windows XP, SP2
Squeak Version: 3.8.
Chronos version: B1.167

2. System Clock (Primitive 137)

The system clock benchmark measures the amount of time required to perform 1,000,000 invocations of Squeak primitive 137. Both Chronos and Chronology rely on this primitive in order to answer the current date and/or time-of-day, and so it's useful to measure the amount of time required to execute this primitive, since it is used by both Chronos and Chronology:

[1000000 timesRepeat: [SystemClock ticksNowSinceSystemClockEpoch]] durationToRun => 0:00:00:00.462 (0.462 seconds)

3. Get current date/time--without any subsequent queries

Chronology:
[1000000 timesRepeat: [DateAndTime now]] durationToRun => 0:00:00:44.556 (44.556 seconds)

Chronos:
[1000000 timesRepeat: [Timepoint now]] durationToRun => 0:00:00:06.241 (6.241 seconds)

4. Get current date/time, then query result for year, month, dayOfMonth

Chronology:
[1000000 timesRepeat: [DateAndTime now year; month; dayOfMonth]] durationToRun => 0:00:00:49.364

Chronos:
[1000000 timesRepeat: [Timepoint now year; month; dayOfMonth]] durationToRun => 0:00:00:09.605

5. Get current date/time, then query result for dayOfYear

Chronology:
[1000000 timesRepeat: [DateAndTime now dayOfYear]] durationToRun => 0:00:02:34.078 (154 seconds)

Chronos:
[1000000 timesRepeat: [Timepoint now dayOfYear]] durationToRun => 0:00:00:08.982 (less than 9 seconds)

6. Get today's date

Chronology:
[1000000 timesRepeat: [Date today]] durationToRun => 0:00:01:45.931

Chronos:
[1000000 timesRepeat: [YearMonthDay today]] durationToRun => 0:00:00:09.897

7. Get current time-of-day

Chronology:
[1000000 timesRepeat: [Time now]] durationToRun => 0:00:00:22.68

Chronos:
[1000000 timesRepeat: [TimeOfDay now]] durationToRun => 0:00:00:09.525

8. Create point-in-time value from YYYY-MM-DDTHH:MM:SS parameters

Chronology:
[1000000 timesRepeat: [(DateAndTime year: 2006 month: 7 day: 23 hour: 4 minute: 55 second: 16)]] durationToRun => 0:00:00:45.891

Chronos:
[1000000 timesRepeat: [(Timepoint year: 2006 month: 7 day: 23 hour: 4 minute: 55 second: 16)]] durationToRun => 0:00:00:04.004

9. Create point-in-time value from count of seconds

Chronology:
[1000000 timesRepeat: [(DateAndTime fromSeconds: 3331083316)]] durationToRun => 0:00:00:43.938

Chronos:
[1000000 timesRepeat: [(Timepoint secondsSinceEpoch: 63289227316)]] durationToRun => 0:00:00:03.486

Note: In the above, although the count of seconds differs, both expressions evaluate to the same date/time value--and the Chronos example has one more digit.

10. Add 50 days to a date

Chronology:
| tp |
tp := Date today.
[1000000 timesRepeat: [tp addDays: 50]] durationToRun => 0:00:01:24.046

Chronos:
| tp |
tp := YearMonthDay today.
[1000000 timesRepeat: [tp addingDays: 50]] durationToRun => 0:00:00:01.733

11. Add 500 days to a point-in-time

Chronology:
| tp duration |
tp := DateAndTime now.
duration := Duration days: 500.
[1000000 timesRepeat: [tp + duration]] durationToRun => 0:00:00:11.112

Chronos:
| tp |
tp := Timepoint now.
[1000000 timesRepeat: [tp addingDays: 500]] durationToRun => 0:00:00:01.217

And that should be enough to see the general trend, as far as the performance of Chronos relative to Squeak's Chronology package is concerned.


Chronos Version B1.167 Published

Chronos Version B1.167 has been published ("Beta Release 1--build 167".) Chronos B1.167 is available for both VisualWorks and Squeak. The Chronos Seed Archive for B1.167 is also available (the "Chronos Seed" is the platform-independent Chronos codebase, used for porting Chronos from VisualWorks to other Smalltalk pltatforms.)

Chronos Version B1.167 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository. Or you can use either the direct download link for VisualWorks or the direct download link for Squeak.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.

About Chronos Version B1.167


Chronos Version B1.167 includes no new functionality, nor any bug fixes (at least, not in the usual sense.) The changes in this version are either 1) the removal of unused methods, 2) repackaging for the purpose of making it easier to port Chronos, or 3) changes motivated by issues discovered when porting Chronos to other Smalltalk environments.

A port of Chronos to a third Smalltalk environment may be announced soon.

Also, I expect that updates/enhancements/changes to Chronos will be few and infrequent (or perhaps nonexistent) for the next month or so.

--Alan


2006-04-11

San Francisco's catastrophic 1906 Earthquake a warning for today


San Francisco's catastrophic 1906 Earthquake a warning for today from PhysOrg.com

It was an unprecedented natural disaster that destroyed a coastal US city. A bungled government response made it worse. Racism plagued survivors. It wasn't Hurricane Katrina, which slammed New Orleans and the Gulf Coast last year. It was the 7.8-magnitude earthquake that rocked San Francisco one hundred years ago on April 18.
[...]


When the nominal moment of the 100-year anniversry of the Great San Fransisco Earthquate occurs--which will be 2006-04-18T05:12-0700--the duration since the event will actually have been 36524 days and 23 hours (876599 hours or 52595940 minutes,) and not 36525 days of 24-hours each. The reason is that back in 1906, Daylight Saving Time was not observed--not in San Francisco, not in the United States, and not anywhere in the world. In fact, in 1906, time zones with "Standard Time" had only been in use in the United States for 23 years.

The count of seconds since the event depends on which timescale one uses. Using UT0 or UT1, the count of seconds would be 3155756400. Using UTC, it is necessary to at least add the 23 leap seconds that have occurred since the adoption of the UTC timescale in its current form in 1972.

The UTC standard says nothing about whether leap seconds should proleptically be imputed to have occured before the adoption of leap seconds into UTC--although some date/time algorithms take just that approach. Whether that's "right" or not depends on the Use Cases that one is attempting to satisfy.


2006-04-09

Sci/Tech: Big breakthrough for tiny particles

A new technology is born:


Big breakthrough for tiny particles from PhysOrg.com

MIT chemical engineers have devised an elegant new method for creating complex polymeric microparticles that could have applications in a variety of fields, from drug delivery in medicine to the creation of building blocks for the photonic materials that carry light. The particles can also add texture to skin creams and color to inks.
[...]




2006-04-06

Sci/Tech: Nanopore Method Could Revolutionize Genome Sequencing


Nanopore Method Could Revolutionize Genome Sequencing from PhysOrg.com

A team led by physicists at the University of California, San Diego has shown the feasibility of a fast, inexpensive technique to sequence DNA as it passes through tiny pores. The advance brings personalized, genome-based medicine closer to reality.
[...]




2006-04-05

Beware of geeks...wearing gifs :-)

Or, Chameleon clothing lets you vanish into the background from PhysOrg.com

A chemist in the United States is working on "chameleon clothing" that at the touch of a switch would mimic the wearer's surroundings, New Scientist says.
[...]




2006-04-04

Numerology

Tomorrow morning, there will come a moment whose local time (in North American notation) will have the designation 04/05/06 07:08:09 (April 5, 2006.)

Next month (using YY-MM-DD notation,) the date-time designation 06-05-04 03:02:01 will occur (2006-May-04.)

In June, we'll have 06/06/06 06:06:06.

Later this year, at Noon of 21 September 2006, will occur Julian Day 2454000--which is one or two days before the Autumnal Equinox (depending on your time zone.)


Sci/Tech: Professor Predicts Human Time Travel This Century


Professor Predicts Human Time Travel This Century from PhysOrg.com

With a brilliant idea and equations based on Einstein’s relativity theories, Ronald Mallett from the University of Connecticut has devised an experiment to observe a time traveling neutron in a circulating light beam. While his team still needs funding for the project, Mallett calculates that the possibility of time travel using this method could be verified within a decade.
[...]





Sci/Tech: Chaos=Order: Physicists make baffling discovery


Chaos=Order: Physicists make baffling discovery from PhysOrg.com

"Da police are not here to create disorder; dere here to preserve disorder." -Richard J. Daley, Chicago mayor, explaining to the media the role of the police during the riotous 1968 Democratic National Convention.

Police keep order. That's why, for example, they issue tickets for "disturbing the peace." Thus the only logical conclusion to Mayor Daley's famous quote above – other than dismissing it as the result of a tangled tongue – is sometimes disorder spawns order. Sounds impossible, right? Wrong.
[...]





Sci/Tech: Device Only Atoms Across May Allow Infinitesimal But Powerful Computers


Researchers at the University of Chicago recently created a single-molecule diode only a few tens of atoms in size and 1,000 times smaller than its conventional counterparts. Theorists from the University of South Florida and the Russian Academy of Sciences recently determined how the device works. The researchers found electron energy levels in a molecule are efficient channels for transferring electrons from one electrode to another. (Credit: Trent Schindler, National Science Foundation)



Link: Device Only Atoms Across May Allow Infinitesimal But Powerful Computers


2006-04-03

Version 2006c of the Chronos Time Zone Repository Published

Arthur David Olson published version 2006c of the Olson Time Zone Database today. Consequently, version 2006c of the Chronos Time Zone Repository has been published--both the Chronos-native and XML versions are available from date-time-zone.com.


Bug Report

A Chronos bug was reported to me earlier today. I'd say who made the report, except in the absence of permission to do so, it's better to err on the side of personal privacy.

The bug is in the method LocalTimeCalendarClock>>basicTodayIn:. The symptom is an MNU #subtractSeconds:. The fix is to replace "subtractSeconds: now secondsSinceStartOfDay" with "addSeconds: now secondsSinceStartOfDay negated". Note that the erroneous code never runs in an environment where the system clock reports Universal Time, and not local time. In other words, you won't see it unless you are using Chronos in either Squeak, or in a pre-7x version of VisualWorks on a non-Unix host platform.

The reason for the bug is simply that I had removed all the #subtractSeconds: methods (which, before I removed them, could only successfully have been sent to mutable Chronos objects, and were not part of the public API,) in favor of only supporting #addSeconds: with a negated argument. In other words, when the code in question was written, it was not a bug.

How I missed this (and one other) sender when I removed all the #subtractSeconds: methods from Chronos I have no idea, unless perhaps it had something to do with the fact that there are non-Chronos implementers and senders of #addSeconds: in VisualWorks.

How I missed the resulting bug is easy to explain: I use VW 7.4 as my main development platform (where the code would never execute,) and my test procedure for Squeak didn't have adequate coverage, because up to now I've been more concerned with the correctness of the infrastructural/platform-specific code in Squeak, under the (now-revealed-to-be faulty) assumption that my test coverage in VisualWorks 7.4 would be good enough for everything else.

The fix is in both the Squeak and VisualWorks download archives, available from the Chronos web site.


2006-04-02

Chronos Version B1.160 Published: Time Zone Rulesets Over HTTP

Chronos Version B1.160 has been publised ("Beta Release 1--build 160".) Chronos B1.160 is available for both VisualWorks and Squeak. The Chronos Seed Archive for B1.160 is also available (the "Chronos Seed" is the platform-independent Chronos codebase, used for porting Chronos from VisualWorks to other Smalltalk pltatforms.)

Chronos Version B1.160 can be obtained from the Chronos Web Site. The VisualWorks version can also be obtained from the Cincom Public StORE Repository. Or you can use either the direct download link for VisualWorks or the direct download link for Squeak.

The Chronos Time Zone Repository is included in the download archive. Be sure to follow the Chronos Installation Instructions--especially if you have not already done so for a previous version of Chronos.

If you are reinstalling Chronos into an image in which an earlier version is already resident, and do not install the new version from the Cincom Public StORE Repository using StORE, it is necessary to first remove the earlier version. StORE has been able to correctly install the new version on top of every earlier version I have tried--but I haven't tried them all.

About Chronos Version B1.160


Chronos Version B1.160 is able to retrieve the ruleset of any Olson-defined time zone, on demand, over HTTP. As far as I have been able to determine, Chronos is the only date/time library in the world with such a capability. If that's so, then this is a significant "first" for Smalltalk, in my humble opinion.

However, by default Chronos version B1.160 does not attempt to retrieve time zone rulesets over HTTP, for three reasons:

1. It is wise to avoid relying on new code when there is no clear need to do so.

2. The local filesystem probably has a higher availability than a remote HTTP server would have. To put it in "enterprise speak" (heh,) the local filesystem can probably be expected to meet a more demanding SLA.

3. Retrieving time zone rulesets over HTTP is significantly slower than from the local filesystem. This is hardly noticeable in the case of a single time zone, but becomes noticeable even when retrieving as few as five zone rulesets (according to my tests using a 4Mbit/second broadband connection.)

In spite of the above caveats, there are definitely cases where it makes great sense to retrieve time zone rulesets from a time zone server over HTTP, and not from the local filesystem. The same goes for a lot of other common reference data, such as locale information, holiday rules, the UTC leap second schedule, the current and/or historical prices of stocks, currencies and commodities, the dictionary definitions of words, help text, and numerous other examples.

The reasons for obtaining reference data over HTTP from a well-known, canonical source, in spite of the above concerns, are several:

1. Although reference data is usually relatively static, that's not always the case. It does change--and keeping all users up to date with the latest reference data can be quite a challenge for software vendors/distributors.

2. If reference data is kept locally, then the local application must manage it. That includes keeping track of of its location in the user's filesystem. Such information can and does get lost.

3. If each application is separately responsible for managing reference data, then not only does that involve a lot of duplicated effort on the part of the world's software vendors/distributors, it also puts the user at risk of getting different answers to the same questions from different applications. In other words, it presents a "reference data integrity" issue.

4. Reference data can usually be obtained without the need of CGI, servlets, EJBs, SOAP or "Web Services." More often than not, a RESTian architecture is quite sufficent. The Chronos architecture for reference data retrieval over HTTP is RESTian--an HTTP server is all that's needed.

5. Ajax applications typically don't have access to the local filesystem.

To configure Chronos so that it will retrieve time zone rulesets over HTTP from the default Chronos time zone server, evaluate the following "do it":

ChronosSystemFacade current resourcePathPrefix: 'http:///'


The above "do it" answers either true or false. If it answers false, then Chronos was not able to verify that the Chronos Time Zone Repository was accessible from the default Chronos time zone rule server, and the image will continue to use the local time zone repository. If it answers true, then the image will satisfy all future requests for a time zone ruleset from the Chronos time zone server over HTTP, until either a) it is told to use the local filesystem, or b) it is unable to connect to the time zone server on image startup.

To instruct Chronos to stop using the Chronos time zone server over HTTP to access the Chronos Time Zone Repository, and to instead access the time zone repository on the local filesystem at a specified path, evaluate a "do it" such as one of the following examples:

ChronosSystemFacade current resourcePathPrefix: nil.
"The first example makes Chronos look in the
current directory for the TZ repository"

ChronosSystemFacade current resourcePathPrefix: '/usr/local/reference/'.

ChronosSystemFacade current resourcePathPrefix:
'C:\Documents and Settings\shibumi\My Documents\Squeak\Chronos'.


You can also ask Chronos to search for the time zone repository at various likely locations (as documented in the Chronos installation instructions) by evaluating the following "do it":

ChronosSystemFacade current resourceRepositoryContext invalidateResourcePaths


The #invalidateResourcePaths operation can be quite useful in VisualWorks, but much less so in Squeak. The VW infrastructure provides the basis for a rather sophisticated approach to finding a resource using a dynamically-determined "search path," compared to what can be easily implemented in Squeak. For this reason, I expect most Squeak users will simply keep the time zone repository in the same directory as their image file.

I would also note that the Chronos infrastructure for managing/accessing reference data had to be drastically refactored/redesigned in order to support this new functionality. One consequence of the refactoring/redesign is that a lot of the inter-Smalltalk "platform portability" code used by Chronos has been factored out into its own modules that are completely independent of the rest of Chronos.

I'll have much more to say about Chronos' "inter-Smalltalk portability" modules in the future. I have a suspicion that those modules might be of great interest to certain people who need to maintain versions of their applications on multiple Smalltalk platforms--Squeak, VisualWorks and Dophin, for example.

I'll also be providing full documentation of the Chronos reference data framework, including how to use it for your own reference data (whether or not you need or use Chronos date/time functionality.) But for now, you'll just have to wait.

In fact, it may be some time before there are any new versions of Chronos published. I have other matters to which I must attend--and I need a vacation. But I will continue to write blog entries.

--Alan



North American Time Zones Switch to Daylight Saving (Summer) Time

Did those of you living in North America remember to move your clocks ahead by one hour?

The Chronos Date/Time Library makes it easy to see the transition as it rolls from one time zone to the next. [Note: Most time zones transition to and from Daylight Saving Time at the same local time, not at the same moment in Universal Time. The major exceptions are the European time zones. All countries in the European Union transition at the same moment according to Universal Time, without regard to local time.]

Here's how Chronos shows the situation just before my local time zone switches to Daylight Saving Time:

Sun, 02 Apr 2006 21:55:02 +1200 (NZST: Pacific/Auckland | New Zealand Time)
Sun, 02 Apr 2006 19:55:02 +1000 (EST: Australia/Sydney | AUS Eastern Time)
Sun, 02 Apr 2006 18:55:02 +0900 (JST: Asia/Tokyo | Tokyo Time)
Sun, 02 Apr 2006 17:55:02 +0800 (WST: Australia/Perth | W. Australia Time)
Sun, 02 Apr 2006 17:55:02 +0800 (HKT: Asia/Hong_Kong)
Sun, 02 Apr 2006 15:25:02 +0530 (IST: Asia/Calcutta | India Time)
Sun, 02 Apr 2006 13:55:02 +0400 (MSD: Europe/Moscow | Russian Time)
Sun, 02 Apr 2006 12:55:02 +0300 (IDT: Asia/Jerusalem | Israel Time)
Sun, 02 Apr 2006 11:55:02 +0200 (CEST: Europe/Amsterdam)
Sun, 02 Apr 2006 10:55:02 +0100 (BST: Europe/London | London Time)
Sun, 02 Apr 2006 09:55:02 +0000 (UT: Universal Time)
Sun, 02 Apr 2006 06:55:02 -0300 (BRT: America/Sao_Paulo | E. South America Time)
Sun, 02 Apr 2006 06:55:02 -0300 (ART: America/Argentina/Buenos_Aires)
Sun, 02 Apr 2006 05:55:02 -0400 (EDT: America/New_York | Eastern Time)
Sun, 02 Apr 2006 04:55:02 -0500 (CDT: America/Chicago | Central Time)
Sun, 02 Apr 2006 03:55:02 -0600 (MDT: America/Denver | Mountain Time)
Sun, 02 Apr 2006 01:55:02 -0800 (PST: America/Los_Angeles | Pacific Time)
Sat, 01 Apr 2006 23:55:02 -1000 (HST: Pacific/Honolulu | Hawaiian Time)

Note that most of the other North American time zones have already switched as of the time shown above. For example, New York is usually 3 hours ahead of California, but at the moment depicted in the above it is 4 hours ahead.

And here's the situation as of the moment of transition:

Sun, 02 Apr 2006 22:00:00 +1200 (NZST: Pacific/Auckland | New Zealand Time)
Sun, 02 Apr 2006 20:00:00 +1000 (EST: Australia/Sydney | AUS Eastern Time)
Sun, 02 Apr 2006 19:00:00 +0900 (JST: Asia/Tokyo | Tokyo Time)
Sun, 02 Apr 2006 18:00:00 +0800 (WST: Australia/Perth | W. Australia Time)
Sun, 02 Apr 2006 18:00:00 +0800 (HKT: Asia/Hong_Kong)
Sun, 02 Apr 2006 15:30:00 +0530 (IST: Asia/Calcutta | India Time)
Sun, 02 Apr 2006 14:00:00 +0400 (MSD: Europe/Moscow | Russian Time)
Sun, 02 Apr 2006 13:00:00 +0300 (IDT: Asia/Jerusalem | Israel Time)
Sun, 02 Apr 2006 12:00:00 +0200 (CEST: Europe/Amsterdam)
Sun, 02 Apr 2006 11:00:00 +0100 (BST: Europe/London | London Time)
Sun, 02 Apr 2006 10:00:00 +0000 (UT: Universal Time)
Sun, 02 Apr 2006 07:00:00 -0300 (BRT: America/Sao_Paulo | E. South America Time)
Sun, 02 Apr 2006 07:00:00 -0300 (ART: America/Argentina/Buenos_Aires)
Sun, 02 Apr 2006 06:00:00 -0400 (EDT: America/New_York | Eastern Time)
Sun, 02 Apr 2006 05:00:00 -0500 (CDT: America/Chicago | Central Time)
Sun, 02 Apr 2006 04:00:00 -0600 (MDT: America/Denver | Mountain Time)
Sun, 02 Apr 2006 03:00:00 -0700 (PDT: America/Los_Angeles | Pacific Time)
Sun, 02 Apr 2006 00:00:00 -1000 (HST: Pacific/Honolulu | Hawaiian Time)

The offset of America/Los_Angeles is now -7 hours, instead of -8 hours--and the New York time zone is again only 3 hours ahead of San Francisco's.