I am really a big fan of javascript. It is really a great prototype based OOP language. Now I want to learn some other prototype based language. Really really interested in some design guideline i.e How can I manage the code without classes etc. Which language should I choose ? Some resource in design patterns for prototype based language ?
This is a large subject. I suggest you read this article on wikipedia. At the bottom you will see a list of different languages.
Broadly, javascript is the most common (and, perhaps, only?) prototype-based language in use today, but you can use the Prototype Pattern in many different languages like Java and Python - for examples see The wikipedia page.
I would suggest you look for tutorials and guidance on the Prototype Pattern rather than looking for a specific language to work in, particularly since you're in perhaps the most appropriate one already. Note that javascript can be run on the Java platform via Rhino.
The best all-round introduction to prototype patterns, defending their use, is one of Steve Yegge's blog posts, 'The Universal Design Pattern'.
Steve Yegge also points us towards Martin Fowler's article on the topic, which I am off to read!
The best guidelines that I have read to take advantage of JavaScript's prototypical nature were in the book JavaScript the Good Parts and you can apply these guidelines to other languages also. I changed the way I code in Python after reading this book.
If you want to learn a language similar to JavaScript, try ActionScript first. Both are based on the same standard. It will be easy and rewarding.
The answer to both of your questions is Self. Self is the original prototype-based OO language, and also probably the best one (for a completely unscientific and subjective definition of "best", of course). (In fact, IMHO it's (together with Newspeak) one of the best OO languages, period.)
Anyway, the nice thing about Self is that it also contains a lot of excellent documentation, including but not limited to the famous Self tutorial Prototype-Based Application Construction Using SELF 4.0
There are also a great number of resources at the old Self website at Sun Research:
- Self: The Power of Simplicity is the original paper that introduced Self at OOPSLA 1987
- Programming as an Experience: The Inspiration for Self is a retrospective paper about Self from ECOOP 1995
These two (together with the tutorial mentioned above) explain pretty much exactly what you are asking about. (In fact, the second one pretty much contains your question "How can I manage the code without classes" word for word in the title):
Then, there is Self; The Movie, an introductory video about the Self programming language, the Self GUI, the Self system and the Self VM starring Self's lead designers and developers. Unfortunately, it came out in 1995 on VHS, and when the video was finally digitized, the original tapes were already degraded. You can find several versions of the video on this site with Smalltalk videos. I personally find the Large QuickTime easiest to view.
Here's a couple of other interesting Self links:
- Self at Ward's Wiki
- A Self link list
- A Wiki page about Self by a company that used to make Self CPUs
Dave Ungar, the primary designer of Self gace a talk at Stanford in September, titled Self and self: whys and wherefores. Streaming video of this talk is available.
A slight problem with Self is that it was basically abandoned by Sun in 1995 in favor of an obscure little scripting language for making animated cartoon characters in electronic TV guides on TV set-top-boxes. (You might have heard of it, it's called Java.) Thus, the latest stable release 4.3 only runs on OSX on PowerPC ( maybe x86, too) and Solaris on a Sparc CPU. A couple of months ago, though, the Self project was picked up again by some of its former members as well as some new fans of the language, and it has now been ported to Linux and OSX on x86, with a usable 4.4 Alpha 2 release available and a final release expected in January.
A couple of other interesting prototype-based languages are:
- NewtonScript (inspired by Self) was intended to be the application development language for the Apple Newton PDA; it is also the direct inspiration for JavaScript
- Slate is "a clean slate object-oriented Smalltalk-style environment"
- Io is a prototype-based programming language inspired by Smalltalk (all values are objects, all messages are dynamic), Self (prototype-based), NewtonScript (differential inheritance), Act1 (actors and futures for concurrency), Lisp (code is a runtime inspectable/modifiable tree) and Lua (small, embeddable)
- Ioke is a prototype-based programming language that is inspired by Io, Smalltalk, Lisp and Ruby
As far as your question about how to structure programs goes, I must admit that I find that classes actually obscure the object-oriented design. I mean, there is a reason why it's called Object-Oriented Programming, not Class-Oriented Programming.