Kragen Javier Sitaker | 6 Mar 09:37 2008

dynamic code generation to superoptimize calendar calculations

In Mark-Jason Dominus
suggests this algorithm for calculating leap years, as a proposed
replacement for the Gregorian system:

   1. Divide the year by 33. If the result [remainder?] is 0, it is not
      a leap year.  Otherwise,
   2. If the result is divisible by 4, it is a leap year. 

This Dominus Calendar has an average leap-day correction of
0.24242424... leap-days per year, against the Gregorian calendar's
0.2425, the tropical year's 0.24219 or so leap-days per year, and the
vernal equinox year's 0.2422 or so leap-days per year.

Perhaps it would be slightly simpler, and equally accurate, to do the

   1. Divide the year by 33.
   2. Divide the remainder by 4.
   3. If the remainder is 1, it is a leap year.

Other values that would work in place of 1 are 2 and 3, but not 0.

I suspect there is some simpler algorithm (in the sense of not requiring
division by a large number such as 33) that is also more accurate.  You
could write the second one as \ y . ((y % 33) % 4) == 1 and the first
one as \ y . (\ r . (r != 0) && ((r % 4) == 0)) (y % 33), or if you're
into flat representations,
	r = y % 33
	r2 = r % 4
	result = r2 == 1
(Continue reading)

Kragen Javier Sitaker | 29 Mar 22:29 2008

orthographic reform of English

At some time in their lives, all eccentrics who spend a lot of time
reading must take on the doomed project of the orthographic reform of
their language.  Occasionally this project is not doomed; for example,
if their scheme is backed by a king or revolutionary government, it
may have some chance of success.

There is a history of some of these successful attempts in and a catalogue of
fourteen unsuccessful attempts in English at

So I am offering these suggestions for the orthographic reform of
English without any real hope that they have any chance of widespread
adoption, except perhaps through automated translation software.
Briefly, I advocate phonetic spelling, syllable blocks, boldface for
sentence stress, and syntactic layout.

1. Phonetic spelling.  There's an existing, widely-understood phonetic
   alphabet, used in almost all the dictionaries of the world except
   for English ones; it's called the International Phonetic Alphabet,
   or IPA.  Continuing to write English in the impoverished Latin
   alphabet, without even using accents as most other languages do,
   wastes the time of countless generations of youngsters, who could
   be spending their elementary-school days on algebra, music,
   literature, art, or vocabulary, rather than spelling.  So we should
   write English with the IPA.

   Of course, we would have to pick a standard pronunciation to use
   for the phonetic spelling.  I propose using the dialect of English
   with the largest number of speakers: Indian English, with 350
(Continue reading)