Talk:Prototype-based programming: Difference between revisions
Luca.greco (talk | contribs) e4x is not a prototype based language but an ECMAScript standard extension |
|||
Line 81: | Line 81: | ||
::I'm just taking what you said above and rewording it slightly. It's better, I think, but can still use some work. [[User:Andrew Eisenberg|Andrew Eisenberg]] 22:26, 9 August 2006 (UTC) |
::I'm just taking what you said above and rewording it slightly. It's better, I think, but can still use some work. [[User:Andrew Eisenberg|Andrew Eisenberg]] 22:26, 9 August 2006 (UTC) |
||
:::I would also like to critisize a part of the article. In the section about criticism, Javascript is mentioned as a "good" example of prototype based programming. IMHO, I think Javascript is a BAD example of prototype based programming. In fact I find Ruby (which is class based) much more open and accessable than Javascript, and I really can not understand how Javascript is becoming a role model for prototype based programming. In fact, I think Javascript does everything wrong. Maybe the section about criticism about prototype based programmign could become less centric on Javascript, and instead generalized more readily, including Languages like Io and Self more rather Javascript. |
|||
== Incomplete Prototype implementation reference for ruby == |
== Incomplete Prototype implementation reference for ruby == |
Revision as of 13:25, 20 February 2009
A few sections of this article confuse the concepts of prototype-based and classless programming. Prototype-based programming is based on cloning existing prototypical objects. It is a special case of, but not the same as, classless programming. A few parts of the article, particularly the ones mentioning JavaScript, get this distinction wrong. While JavaScript is classless it is not prototype-based since there are no prototypes and no cloning. The JavaScript language does include a concept of prototypes but in a very different sense from the traditional one. Plesner 19:12, 25 March 2007 (UTC)
What is information hiding?
- Use the wikipedia: Information hiding Wouter Lievens 17:06, 1 May 2005 (UTC)
-- Uses --
Aside from JavaScript, which PBL's are used outside academia? Wouter Lievens 17:07, 1 May 2005 (UTC)
On another note, this page could do with a section contrasting different 'styles' of prototype-based languages; off the top of my head, there is: delegation, inheritance and cloning. I will try to write something up at some point.Ryandaum 01:32, 11 January 2006 (UTC)
Not sure why Ruby was added as a specific example of a OO language that allows alteration of classes during runtime, as I can think of several: Python, Lisp (with CLOS), etc. I worry there's a bit of advocacy going on here?Ryandaum 01:47, 18 February 2006 (UTC)
History of prototypes
Everyone seems to consider Self to be the first prototype-based language, but in actual use among a large number of people, MOO must pre-date it substantially. Note that both languages came out of Xerox PARC, so I'm not suggesting that Ungar and Smith's Self research didn't pre-date MOO, but MOO was in active use as of about 1990, and my sense of Self (hmm) is that it didn't become very "real" until a fair bit later. Anyone with a better sense of the historical details care to clarify this?
MOO did not in fact come out of Xerox PARC. (I'm an early MOO user, and have heavily edited that article as well as this one). MOO was created by Stephen White before Pavel Curtis took it over and called it LambdaMOO. And AFAIK LambdaMOO was never truly an official PARC research project, but instead something that was given hosting by PARC and maintained by Pavel.Ryandaum 01:22, 10 May 2006 (UTC)
Curtis' chapter in the Haynes & Holmevik book suggests that what White had created was pretty patchy before Curtis got hold of it. Curtis was working at PARC as on programming languages, so he clearly had a legitimate interest in developing the language and the libraries, though I agree that it appears to have not been an "official" PARC project. The question remains... where did the prototypes architecture come from? From White? In which case he is quite an innovator -- wasn't he a Waterloo student at the time? JMax 03:05, 27 June 2006 (UTC)
This would be a good thing to look into. White's later work (CoolMUD) definitely had a prototype model, and a more refined one at that. I also don't know if MOO was consciously prototype-oriented at the time, or if the design choice was simply dictated by the way MUDs operate (physicality of objects). Certainly MOO and its early documentation never use the word 'prototype' anywhere, and delegates are referred to as 'parent', etc. Also, do you have a reference for the assertion that Curtis was working on programming languages at PARC? I have never seen a description of the actual work he was doing there. These might be good questions to ask White, I do have his email address somewhere. I will try to remember to look into it.Ryandaum 23:03, 28 June 2006 (UTC)
WELLL... Not a lot of detail, but in the chapter "Not Just a Game: How LambdaMOO Came to Exist and What it Did to Get Back at Me", in C. Haynes & J. R. Holmevik (Eds.). High Wired: On the Design, Use, and Theory of Educational MOOs (Ann Arbor: U Mich Press 1998), Curtis writes that he was leading the SchemeXerox project at PARC at the time, and that the project had slowed down to a crawl, giving him the opportunity to first discover MOO and then devote a bunch of (unofficial) time to it. On discovering MOO, he wrote:
I recognized immediately that, in some form at least, there must be a user-accessible programming language here. Being a professionally trained programming-language designer, I have a sometimes morbid fascination with the design efforts of amateurs; I wanted to see if, maybe, these folks had done something interesting... (p. 26)
He then goes on to praise White's design for originality and good 'fit' to the domain, and reports that he and White worked together to fix bugs and work on the "evolution of his language" (p. 29). In early 1991, Curtis says that his annual performance appraisal at PARC forced him to reconcile himself to the fact that MOO had chewed up an entire quarter, and that he would up making promises to get back to SchemeXerox (p. 32). JMax 17:09, 3 July 2006 (UTC)
Ah, interesting. From http://hci.stanford.edu/seminar/abstracts/91-92/920108-curtis.html
Biographical Sketch: Pavel Curtis has been a member of the research community at the Xerox Palo Alto Research Center since 1983, during which time he has worked on aspects of the Smalltalk-80, Interlisp-D/Xerox Lisp, and Cedar programming environments and on other projects mostly related to the design and implementation of programming languages. His current activities include the design, implementation, and maintenance of an extensible and programmable multi-participant text-based virtual reality called LambdaMOO and leadership of the SchemeXerox project, which aims to produce an advanced programming environment based around a new implementation of the Scheme programming language suitable for use in large-scale software systems.
I must note that there is a very obvious functional programming influence in LambdaMOO; as with prototypes, whether this was a White or Pavel influence or both, I do not know.Ryandaum 00:16, 5 July 2006 (UTC)
Example of object creation
Could someone add an example to clarify the difference between class based and prototype based object creation/cloning?--82.92.191.87 16:44, 29 June 2006 (UTC)
Unsourced statements
Can someone please add a source for the following claim:
For example, Lisaac compiler produces code almost as fast as C. Tests have been run with a MPEG-2 codec written in Lissac, copied from a C version. These tests show the Lisaac version is 1.9% slower than the C version with 37% fewer lines of code. --Dzhim 00:14, 7 July 2006 (UTC)
Or this:
"Prototype-based programming is often associated with particular schools of thought in cognitive psychology which emphasize prototypes or exemplars as key attributes of the learning process." Sounds like BS to me.
--Lingwitt 05:02, 29 January 2007 (UTC)
Confusing sentence
The article says this:
With class-based languages, objects come in two general types. Classes define the basic layout and functionality of objects, and instances are "usable" objects based on the patterns of a particular class.
What does this mean? First of all type has a specific meaning in Computer Science, so that term shouldn't be used. Is this sentence trying to say that an object has two facets—an instance and a class? I'm just confused.
...
I agree, the wording is bad -- I based it on some aspect of the word of the original article, which was talking about low-level pointers/offsets/vtable issues, which I felt was not appropriate. Type is a poor choice of word -- "kind" would be a better word. The sentence isn't saying that an object has two facets, but that a class can be seen as a a kind of object itself, a 'special' object (see Smalltalk's metaobject protocol, for example.) We need to come up with some better wording here.Ryandaum 23:31, 8 August 2006 (UTC)
- I see. I always considered objects to be instances of a class. Even the class object is an instance of metaclass in Smalltalk. I think that distinguishing between classes and instances is misleading because they are all instances. The only difference is that a class object is a special kind of object. Am I right in saying that in OO, object and instance are synonyms?--Andrew Eisenberg 05:40, 9 August 2006 (UTC)
- Well the entire point of the prototype article is to point at systems that don't have instances versus classes, but only have ... objects. The word instance implies a 'blueprint', which prototype systems do not have.Ryandaum 20:15, 9 August 2006 (UTC)
- OK, then. How about something like this as a rewrite:
In OO systems, all objects are instances of a class. A class defines a kind of blueprint for an instance, defining its structure and functionality. In prototype-based systems, an object is simply an object and can be configured with any kind of structure and functionality as desired.
- I'm just taking what you said above and rewording it slightly. It's better, I think, but can still use some work. Andrew Eisenberg 22:26, 9 August 2006 (UTC)
- I would also like to critisize a part of the article. In the section about criticism, Javascript is mentioned as a "good" example of prototype based programming. IMHO, I think Javascript is a BAD example of prototype based programming. In fact I find Ruby (which is class based) much more open and accessable than Javascript, and I really can not understand how Javascript is becoming a role model for prototype based programming. In fact, I think Javascript does everything wrong. Maybe the section about criticism about prototype based programmign could become less centric on Javascript, and instead generalized more readily, including Languages like Io and Self more rather Javascript.
Incomplete Prototype implementation reference for ruby
The linked prototype-script for ruby does not do what it claims to do and is no complete prototype implementation. When cloning a proto, it does copy the attribute of the source to the destination, but if an attribute links to another object - like an Array - it is not copied. Thus, after copying such protos, they will share the same secondary objects. If you add something to an Array in Proto A, it is also there in Proto B - and the other way around. Therefore, ruby currently has no properly working Prototype-Implementation and therefore should not be listed as supporting Prototypes. --82.141.50.118 (talk) 02:08, 1 April 2008 (UTC)
E4X
In the section languages E4X is reported as a prototype based language, but it's an extension of ECMAScript and not an ECMAScript derived language.