General

Why numbering should start at 0

EWD831 by E.W. Dijkstra, 1982.

When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what subscript value to assign to its starting element. Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤ i < N. So let us let our ordinals start at zero: an element's ordinal (subscript) equals the number of elements preceding it in the sequence. And the moral of the story is that we had better regard —after all those centuries!— zero as a most natural number.

Remark Many programming languages have been designed without due attention to this detail. In FORTRAN subscripts always start at 1; in ALGOL 60 and in PASCAL, convention c) has been adopted; the more recent SASL has fallen back on the FORTRAN convention: a sequence in SASL is at the same time a function on the positive integers. Pity! (End of Remark.)

What's the modern trend for indexing from zero vs. indexing from one? And for specifying ranges ("from 5 to 8", 5 ≤ N < 9, "four elements starting from 5")? Why?

More Haskell in Java 7 or 8?

An interesting blog post from Ralf Lammel which may raise some reactions...

The post refers to the paper JavaGI: Generalized Interfaces for Java (Stefan Wehr and Ralf Lammel and Peter Thiemann). Here's a teaser:

generalized interfaces cater for retroactive and conditional interface implementations, binary methods, static methods, default methods, interfaces over families of types, and existential quantification for interface-bounded types. As a result, many anticipatory uses of design patterns such as Adapter, Factory and Visitor become obsolete...

Seymour Papert injured in traffic accident

I just heard about Papert's tragic accident. Thankfully, what I am reading suggests that his condition is improving.

Papert is the father of the Logo programming language which, apart from being the first programming language I learned, is one of the most important attempts to use computers, and programming in particular, in education.

Flowers for Seymour is an attempt to create a virutal flower album to provide emotional support for Papert and his family. This is a nice gesture, and I hope the LtU community will contribute to it. The album includes only a few flower images created in Logo, which is a shame. It would be nice to see more images created using the wonderful tool Papert gave us.

Our prayers are with Seymour Papert and his family.

Misc items

A couple of items I came across, that might be of some interest.

Bjarne Stroustrup: The Problem with Programming

A Bjarne Stroustrup interview about programming and about his language design philosophy. Two choice quotes:

I want elegant and efficient code. Sometimes I get it. These dichotomies (between efficiency versus correctness, efficiency versus programmer time, efficiency versus high-level, et cetera.) are bogus.

TR: In The Design and Evolution of C++, you claim that Kierkegaard was an influence on your conception of the language. Is this a joke?

BS: A bit pretentious, maybe, but not a joke. A lot of thinking about software development is focused on the group, the team, the company. This is often done to the point where the individual is completely submerged in corporate "culture" with no outlet for unique talents and skills. Corporate practices can be directly hostile to individuals with exceptional skills and initiative in technical matters. I consider such management of technical people cruel and wasteful. Kierkegaard was a strong proponent for the individual against "the crowd" and has some serious discussion of the importance of aesthetics and ethical behavior. I couldn't point to a specific language feature and say, "See, there's the influence of the nineteenth-century philosopher," but he is one of the roots of my reluctance to eliminate "expert level" features, to abolish "misuses," and to limit features to support only uses that I know to be useful. I'm not particularly fond of Kierkegaard's religious philosophy, though.

Now go read the whole thing, or go directly to the discussion already raging in the LtU disucssion group.

Why Lisp is Different

Lemonodor directs our attention to an interesting comp.lang.list post listing several of the key elements that make Lisp "different".

Don't miss the list of consequences for successful software design in Lisp at the end of the post:

* when in doubt design software to be dynamic (changeable at any time).

* when in doubt design software to be introspective

* when in doubt design software to be reflective

PVS goes open source

The PVS Specification and Verification System from SRI is being released as open source.

Also coming with version 4.0 is the PVS wiki.

Parser combinators in Factor

Chris Double has written a wonderfully concise example of parser combinators in Factor. Slava Pestov's Factor continues to be one of the most interesting language projects in development, in that it's both elegant and already has a solid set of tools.

Ralph Johnson: Language workbenches

My only complaint about Martin (Fowler)'s talk is that he didn't mention Smalltalk and that he said that the Lisp people have been making DSLs for 20 years. I learned about them about 20 years ago, and the Lisp people had been doing it for 20 years before that, so I think they have been doing it for 40 years. Neverthless, DSLs are only starting to become a hot topic. OOPSLA has had a Domain Specific Modeling workshop for four or five years, and I'm hoping that next year it will grow into a symposium. These are ideas that need to become ubiquitous.

Ralph also mentions Intentional Software and points to Fowler's JAOO talk on Domain Specific Languages, a video of which is available online.

Grammar Visualization

An interesting visual comparison of the grammars of Ruby, Java 1.5 and Javascript.

Anyone care to interpret the graphs?

XML feed