Joose is a complete modern object system for JavaScript based on concepts from many programming languages such as Ruby, Smalltalk, Perl and, well, JavaScript. It provides "keywords" or "syntactic sugar" for class declaration, object construction, inheritance and more. These keywords feel like they become a part of the language and you don't have to care about the implementation details of all these concepts.
With Joose, you can concentrate on the logical structure of your code, focusing on "what" rather than "how". A class definition with Joose reads like a list of very concise English sentences.
Joose provides complete introspection for all Joose-using classes. This means you can ask classes about their attributes, parents, children, methods, etc., all using a well-defined API.
Joose is based in large part on the Moose system, which in turn borrows a lot of from Perl 6 object system, as well as drawing on the best ideas from CLOS, Smalltalk, and many other languages.
Joose isn't a new language or sources preprocessor. The code written in Joose, executes like regular JavaScript, and can be run in any modern JavaScript engine.
Joose makes JavaScript OO both simpler and more powerful. It encapsulates JavaScript power tools in high-level declarative APIs which are easy to use. Best of all, you don't need to be a wizard to use it. Here's the example of Joose class:
Class('Person', {
methods : {
eat : function (food) {
console.log('yummy')
return 'yummy'
}
}
})
This is a complete and usable class definition! Another example:
Class('Person.Tidy', {
isa : Person,
before : {
eat : function (food) {
this.washHands()
}
},
after : {
eat : function (food) {
this.brushTeeth()
}
},
methods : {
washHands : function (food) {
console.log('washing hands')
},
brushTeeth : function (food) {
console.log('brushing teeth')
},
eat : function (food) {
this.SUPER(food)
}
}
})
Joose makes every attempt to provide as much convenience as possible during class construction/definition, but still stay out of your way if you want it to. In the same time, if you want to digg about in the guts, Joose lets you do that too, by using and extending its powerful introspection API (aka reflection) or by providing your own meta class implementation.