A Trifle Absurd
Matthew Morgan’s software notions
Programming with Prototypes
26 January 2005 at 18.00 • in Languages, ProgrammingSince it looks like I’ll be programming in JavaScript for a while, I thought I’d read up on prototype-based languages. (Prototype-based means, more or less, object-oriented minus classes. That is, there are no classes, only objects.) JavaScript is the best-known such language, but there are other examples out there, like Self, NewtonScript, and Io.
Self was a major influence in the designs of NewtonScript, JavaScript, and Io, and there are plenty of freely-available papers about it. Programming as an Experience, a retrospective paper, is the best place to start. Lisp and Symbolic Computation (v.4, no. 3) packages up several other Self papers.
Some of the niftier tricks for organizing programs without classes in Self don’t apply to JavaScript, since JS only has single inheritance. On the plus side, though, you don’t have to decipher Self’s tricky name-conflict resolution rules.
I don’t know much about NewtonScript, other than the snippets I’ve picked up here and there. It was inspired by Self, but adapted to fit the needs and constraints of the Newton. A couple of days ago, I came across Programming for the Newton in the library, and I’m looking forward to reading it. (Sometimes it’s a good thing for libraries to be stocked with outdated computer books…)
So why am I reading about all these other languages instead of just JavaScript? Part of it is just that I’m a language junkie, and so I need little excuse to go learn about obscure languages. Another part, though, is that I want to swipe useful techniques for programming-in-the-large from other prototype-based languages.
4 Comments
Sorry, the comment form is closed at this time.
You might be interested in the Garnet system for prototyping advanced user interfaces, which was developed at Carnegie-Mellon, and is still (somewhat sporadically) maintained at Sourceforge.
Although Garnet was built in Common-Lisp, it has its own prototype-based object system (KR), which is the basis of the system.
I have found that Garnet takes a while to become comfortable with, largely because of its prototype system. On the other hand, the prototype system really enhances one’s ability to rapidly throw together (I had to resist the temptation to say “prototype”!) new UI gadgets that provide novel functionality; far, far less constraining than most other toolkits.
Comment by Robert Goldman — 28 January 2005 #
There’s also a project I’m working on called Slate which is a kind of blend of several different languages with a Smalltalk syntax. It basically has Self-style prototypes, but with multi-methods. However, it’s still in the sub-point release stage, being built up to the point of real usefulness gradually. I left a link to it in my sig. Oh, yeah. I also live near downtown Seattle! Drop me a line.
Comment by Brian Rice — 28 January 2005 #
An Object By Any Other Name Would Still Do What?
Trackback by Birdman's land — 31 January 2005 #
[…] 31 January 2005 NewtonScript I read through the Newton programming book I mentioned last week. Interesting stuff–not just NewtonSc […]
Pingback by A Trifle Absurd » NewtonScript — 31 January 2005 #