Software ideals and history

A slide presentation on Software ideals and history given in a lecture by Stroustrup and fellow Aggies, turned up in google references to my PL People page. Whatever one thinks of C++ as a language, Stroustrup views on the history of PLs is always an interesting read (I recommend his book the Design and Evolution of C++ for the serious PL enthusiast).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Strachey and CPL

Whoops. I had left off Christopher Strachey in my PL People page. Now if I could just figure out what languages are associated with Dijkstra - he seems to have influenced them all - but I can't seem to associate him with any one in particular.

(P.S., this thread is my weak attempt to placate Ehud's request for more PL History on LtU). :-)

Dijkstra and languages

Well, according to the Stroustrup presentation you just linked to, Dijkstra was associated with ALGOL. Not to mention that (IIRC) it was for his work on ALGOL that he received his Turing Award.

Thanks :-)

Thanks :-)

"I invented OOP"...

The probably correct quote is,"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." A quote identical to the one given in the slides only occurs twice from Google, and in off-the-top-of-the-head contexts. Somoene could correct me if they know an authoritative source for this quote.

The author accuses someone of claiming to invent something they didn't. In that situation, I would consider it necessary to mention or at least check a source. I'm not sure I could take the rest of the presentation seriously knowing how little care for accuracy and tact apparently went into it.

Context

The exact quote from Kay is: "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." But it's a slide presentation, so the comment was likely elided, though the jest of the quip is fairly encompassing about claims of ownership of a term. Of course, naming something is not always the same as creating the idea that is being named. I think Stroustrup's remark also has to be placed in the context of the amount of criticism C++ has received from the Smalltalk camp. Both were derivatives of Simula and were not particularly influenced by each other (Objective-C would be the C based language most influenced by ST). C++ is actually a lot closer to Simula than is Smalltalk. And I guess it should be mentioned that Kay has also quiped that he should have used the term Message Oriented Programming to better differentiate what Smalltalk accomplishes.

Personally, if I were to take offense at the slides, I'd probably say that Lisp was given less credit than it deserves - confining Lisp to the domain of a PL for AI will grate the wrong way for most Lisp advocates. But then I don't expect to see Stroustrap give a totally objective reading of the history of programming languages, as his direct experience is along the lines of Algol, Simula, C, and C++. Only brief mention of Functional and Logic PLs (Scheme, Prolog, ML and Haskell are important forces in the market place of PL ideals).

A vewry similar quote can be

A very similar quote can be found in one of the classic Alan Kay stories (not that wiki is an "authoritative source", obviously).

Seeing as the this is a set of slides, which were probably used to accompany a verbal presentation, I don't think you should be so quick to pass judgement on the authors though.

Point, but...

"Seeing as the this is a set of slides, which were probably used to accompany a verbal presentation..."

It shouldn't have been posted as a front-page story here if the intent is to present serious content relating to programming languages. Think of it as my way of asking that random slideshows not be posted here just because they're associated in some way with a programming langauge or PL creator. I'm not sure *they* would want that, either.

"...I don't think you should be so quick to pass judgement on the authors though."

You may be right there. It doesn't deserved to be judged as if it was in a major public speech or the introduction to a book, as it was not intended for same context or the same number of people. On the other hand, I mentioned that I wouldn't take the *presentation* seriously, not the author. How that judgement reflects on the author is really up to the reader.

LtU mission statement

Ehud has seen enough of my posts over time to realize that some of my stories are good and some not so good. Oddly enuf, my good stories get much less comment than my mediocre ones, and my theory has always been that people are more forthcoming in their opinions when they don't feel threatened.

Although I certainly don't think the slides were anywhere near the quality of many of the technical papers posted on LtU, I also don't feel that LtU is exclusively geared to content that is totally rigorous in the mathematical sense. Yes we have our share of papers that should keep us busy for the next decade or so. But LtU is a discussion forum for all things related to programming languages. History just happens to be one of the ideas that Ehud was interested in generating a bit more discussion - and I think this particular item has yielded some interesting viewpoints on Pascal, Smalltalk and Apple.

As for Stroustrup, he's a big boy, having been flamed in many a place, in much more intense ways. I doubt he cares how we use or abuse this particular material. And if he didn't want people to use it as a resource, then he shouldn't have bothered posting it on the world wide web.

My personal suggestion is to not take this internet stuff so seriously and to expend energy fighting battles that are more worthwhile. If you like the more technical papers on LtU, the better way to go about it is to ignore the stories you don't like and engage in the technical discussions that interest you. For example, why not spend more time on my CP story that has a higher quality of links, rather than waste time on what you consider to be a low quality story?

Interesting story

I found the slides to be interesting, and am glad that you posted the story. I think the key is to look at the slides not as an objective (pun intended) history of programming languages, but as a presentation of Bjarne Stroustrup's perspective on that history. Which is an interesting thing in itself. The fact that, to take one example that someone else here already raised, Stroustrup gave such a small amount of attention to Lisp helps us to understand why C++ is the way it is.

Right

LtU is a discussion forum for all things related to programming languages.

Right. And I trust the judgement of our contributing editors, who go to the trouble of posting for our benefit, in choosing interesting items worthy of attention, even when they are not scientific papers. Many such items were posted here over the years, indeed they include some of the more interesting things I stumbled across via LtU (course pages, demos, tutorials, movies etc.)

Personally, I see no problem with this item.

My first reaction was...

...to defend the post to the 9's, elevating the slides to being the most important thing ever in the discussion of the history of PLs. Then perhaps engage in a bit of ad hominem. (All those years of intercollegiate debate means that I'm quite capable of arguing any point from any perspective, whether I believe it or not).

But my evil twin lost the argument, as I figured this wasn't a particularly productive line of thought. :-)

Stroustrup and C++ are a lightning rod when it comes to discussion of PLs, so a certain amount of fallout was probably inevitable. Personally I enjoy reading Stroustrup, even if I'm not enamoured of C++.

re: "I invented OOP"...

This appears to be quote from Alan Kay's keynote speech at OOPSLA 1997 (available via Google Video here). The comment in question appears roughly 10 min 30 sec into the speech (at least on the Google video version). The exact quote is

...I made up the term object-oriented — and I can tell you I did not have C++ in mind...

Error

Anders Heljsberg didn't invent Object Pascal; Nicklaus Wirth and some folks at Apple—principally, if memory serves me correctly, Larry Tesler—did. First there was a "Clascal" compiler on the Lisa, then it cross-compiled to the Mac, then Tom Leonard did "TML Pascal," which eventually added Object Pascal support, and finally Apple had MPW Pascal. All versions of the MacApp framework prior to 3.0 were in Object Pascal; 3.0 and later are in C++. Anders, of course, was responsible for embracing and extending :-) Object Pascal in the form of Delphi while still at Borland, and as is so often the case, because Delphi was quite a bit more popular than any of the Apple manifestations of the language, people say Anders invented it.

While I'm on the rant, here are some other things that few people seem to realize Apple invented:

  • TrueType
  • Unicode
  • Firewire
  • Much of the VRML file format
  • Much of the MP4 file format

If only Apple had borrowed Smalltalk...

...from their forays into Xerox Parc, along with the GUI, mouse and networking, the history of PLs might have played out much differently. :-)

Edit Note: I know Anders is associated with Delphi, but was he also the major force with Turbo Pascal?

Answer: yes

Regarding Anders and Turbo Pascal, yes, Anders was the guy. When I was at ICOM Simulations, developers of the TMON debugger for the Mac, we got a contract to implement a source-level debugger in a to-be-released version of Turbo Pascal for Macintosh. My good friend and colleague Darin Adler executed on that contract. IIRC, that version of Turbo Pascal for Macintosh never shipped, but Darin got to work directly with Anders and had great stories to tell.

Re: Smalltalk, there was a pretty intense Smalltalk culture in the Advanced Technology Group at Apple even while I was there—in fact, you could basically say that ATG Cupertino was the Smalltalk camp and ATG Cambridge was the Lisp camp (no surprise, since "ATG Cambridge" was essentially the assets of Coral Software, developers of Macintosh Common Lisp).

Wikipedia tells us...

Something I didn't know -- a great success story of a tiny well-written kernel of code blossoming into an epic career...

Borland licensed the PolyPascal compiler core, written by Anders Hejlsberg (Poly Data was the name of his company in Denmark), and added the user interface and editor. Anders joined the company as an employee and was the architect for all versions of the Turbo Pascal compiler and the first three versions of Borland Delphi.

smalltalk hindsight

Chris Rathman: If only Apple had borrowed Smalltalk from their forays into Xerox Parc

Apple did, after a fashion. But I think a main limitation at the time was limited resources in consumer grade machines, which had shockingly small amounts of RAM by today's standards. (Think: at most one megabyte.) Both Lisp and Smalltalk tended toward heavier use of memory, because of their meta-complete natures, in comparison to low resource languages like C. (Folks might not remember that the main objection to Lisp and Emacs at one time was the sheer amount of memory these things needed; they had reputations for being resource hogs.)

Apple had Rick Meyers implement Lisa Smalltalk, which later evolved into MacSmalltalk. [You can read about Rick's research in Smalltalk in "Smalltalk-80: Bits of History, Words of Advice", in a part three: An MC68000-Based Smalltalk-80 System by Richard Meyers & David Casseres.] I was later able to get all the Smalltalk source inside MacSmalltalk (for free on request) when I was an Apple employee; the sources made good reading as well as great sample source for the Smalltalk compiler I wrote as a hobby at Taligent. Coincidentally, Rick Meyers was the head of the C++ CompTech compiler group at Taligent, though he wasn't interested in discussing the old Smalltalk days when I approached as a Smalltalk groupie. At Taligent, it was all C++ all the time -- just like a C++ radio station.

When Smalltalk had any success, it was in languages like Objective-C in the low memory resource tradition, that borrowed from Smalltalk without abandoning the C goal of zero development time space and time overhead at deployed application runtime.

(At OOPSLA one year, folks from the PinkOS project at Apple attended to announce they were writing an all new operating system in (gasp) an object-oriented language. When asked by the audience what language was being used, they replied, why C++ (of course). Which was met with laughter and general derision, according to report; it seemed to make Taligent folks glum.)

Objective-C was basically C with Smalltalk embedded inside, and this was adopted by NeXT Computer (Jobs' post Apple creation) as the systems programming language. At Taligent there was little but trash talk for Objective-C, which I found disturbing, because it wasn't as bare metal as C++ or something. In retrospect, it's now ironic that Apple eventually purchased NeXT (apparently priced to match what Apple and IBM had wasted on developing Pink/Taligent), and caused Objective-C to become the dominant systems language at Apple.

Paul Snively: Re: Smalltalk, there was a pretty intense Smalltalk culture in the Advanced Technology Group at Apple even while I was there--in fact, you could basically say that ATG Cupertino was the Smalltalk camp and ATG Cambridge was the Lisp camp (no surprise, since "ATG Cambridge" was essentially the assets of Coral Software, developers of Macintosh Common Lisp).

Apple tended to be divided politically on technology at times. I rarely met the Smalltalk guys, and some of them had become C++ guys, like Rick Meyers.

The Common Lisp/Dylan folks from Cambridge were a lot of fun. When David Moon and a couple others visited to discuss Dylan plans and integration with Taligent wares, I managed to get invited to lunch discussions, and a dinner or two along the way. (I was a grunt of no consequence whatsover, but as adynamic language groupie conversant in lisp, smalltalk, and C++ jargon, I was welcome as a translator into plain english for the non-technical or C++-only folks around.)

The machines we C++ developers had at the time came with enormous amounts of RAM intalled -- sixteen megabytes. :-) I know, this sounds like nothing now. I wangled an evaluation copy of Dylan to play around with, but it required twenty megs of RAM. When I tried it with only 16 megs, it didn't ... quite ... work. So apparently 20 megs was a realistic minimum.

This might help explain the resource usage situation with Lisp and Smalltalk, and how this made them unacceptable to many low level coders who couldn't splurge on time and space. We were planning to deploy on 8 meg end user machines, which were double the size of currently shippingsystems. The Dylan folks had to work with complex design constraints to ensure all unnecessary development time costs were stripped away for end user execuables.

And today, it just doesn't matter. Even a real resource hog of a development platform has trouble making a serious dent in the amount of resources a typical end user takes for granted.

Different Language

Delphi's object oriented model is completely different from the original Object Pascal. From looking at what has happened to the object-oriented extensions added for Turbo Pascal 5.5, you can see that they were ultimately a failure. The object-oriented model was reinvented for Delphi 1. For example, here are some of the differences between Turbo Pascal 5.5's object model and the Object Pascal in Delphi 1:
  • Delphi's objects are reference types with metaclasses, while TP5.5's objects are value types, subject to slicing etc. (Basically records with methods.)
  • Virtual metaclass methods - no analogue in TP 5.5.
  • Method pointers (aka delegates in .NET) - not in TP 5.5.
  • Published visibility, with RTTI - not in TP 5.5.
  • A sane syntax for dynamic allocation, calling a constructor directly rather than the odd New syntax, which infers the type to construct from the supplied pointer type, and has the constructor call as what looks like an expression argument.
  • Exceptions
  • Properties
Modern Delphi basically uses nothing from (TP 5.5 less TP 5.0). There are some syntactic similarities, but the semantics are quite diffirent. For example:
var
  x: PSomeClass;
{ ... }
  New(x, Init(5));
{ ... }
  Dispose(x, Done);
versus:
var
  x: TSomeClass;
{ ... }
  x := TSomeClass.Create(5);
  try
    { ... }
  finally
    x.Free;
  end;
The semantics are substantially different. One somewhat detailed example: New() doesn't zero-initialize memory for non-"special" types, while InitInstance on Delphi classes does (InitInstance is called automatically as part of object initialization). Because TP 5.5 doesn't have exceptions, there's no provision for an error in a constructor. Because fields are zero-initialized in Delphi, a constructor throwing an exception automatically calls the destructor, which can safely call Free on all field references, whether or not they are null. Free checks if Self is null before calling the destructor.

IMHO, it's a mis-appropriation to say that modern Delphi is based on Apple's contributions - the best you can say is that it learned a lot from the numerous mistakes of the original Object Pascal.

Failure?

I wouldn't say TP 5.5's "objects" are a failure -- I seem to remember the old-style TP objects still being available in Delphi, even. In fact, there are times you'd want to use the old-style objects for performance reasons (analagous to stack allocation in C#'s structs vs classes, which is a disinction that still exists in a modern Anders language :) )

But then

They've been deprecated for a long time. They aren't available in the .NET version of Delphi, for example.

Software Ideals

When I read the title Software Ideals, my first thought was something rather different.

Honest critisism.

To make life easier for the serious programmer
I hate debugging

I have discussed many times online that C++ needs garbage collection, but I have been wildly ignored. I do not propose garbage collection as the primary method of memory management, but I think C++ must have some changes that would allow me to write an efficient collector.

By "efficient collector", I mean a precise collector that knows where pointers are in the globals area, in the stack and in data structures.

I can not see how life is easier without gc for some of the serious programmers out there.

And garbage collection is so simple to implement! if only C++ provided a way to:

a) anonymously examine members of data structures at compile time, using templates, in order to find out which members are pointers, and which are not pointers. For example:

//a data structure
struct node {
    node *prev;
    node *next;
};

//a mark function for marking members; empty because only pointer members are to be marked
template <class T> void mark_member(T m) {
}

//a mark function for marking pointer members
template <class T> void mark_member(T *m) {
    //bla bla marking code
}

//a generic mark function which marks individual members of a struct
template <class T> void mark(T *n) {
    for(int i = 0; i < lengthof(*n); ++i) {
        mark_member(memberof(*n, i));
    }
}

b) have access to data type information in 'operator new', so as that the proper mark code is instantiated. For example:

//global operator new that is typed (i.e. the actual type is passed by the compiler to the programmer)
//the allocation happens with a finalizer of certain type.
template <class T> void *operator new(size_t size) {
    return gc_malloc(size, finalizer());
}

c) access stack frames as structures. For example:

//mark the stack frame of a function;
//intrinsic function 'frameof' marks the stack frame of given function
template <class T> void mark(function f) {
    mark(frameof(f));
}

d) access the global data area as a structure. Same above; replace 'frameof' with 'globalof' or something similar.

All the above is just for example, of course.

I am sorry to say this, but Stroustrup does not listen to his audience, the programmers.

EDIT:

Here is a C++ multithreaded garbage collector I wrote in the last few hours that is portable (it uses pthreads) and precise...just a proof of how easy it is to code one. Of course it is totally lame (maybe, I have not benchmarked it) performance-wise, because every pointer instantiation or assignment has to lock a critical section...(but not a global one, each thread has its own).

At this point in the life of C++

...I don't know if any more radical changes are in the cards. Even Bjarne only has a limited amount of control over the direction of the language. Probably best he can do is drum in the idea of having the implementations meet the standards that have already been agreed to.

My reading of where the C++ would like to go has less to do with the language itself and more to do with trying to get a more comprehensive set of standard libraries. Most see this as the reason that Java has made inroads into some traditional C/C++ territory. Of course, one can argue that making libraries is much harder without a standard GC framework, but that's a more torturous sell.

a more comprehensive set of

a more comprehensive set of standard libraries.


I think Bjarne said as much in one of his articles we mentioned in the past.