Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mountain/jsq
An Object system for Node.js based on the MOP concept from Lisp CLOS
https://github.com/mountain/jsq
javascript mop object-oriented self-hosted
Last synced: about 1 month ago
JSON representation
An Object system for Node.js based on the MOP concept from Lisp CLOS
- Host: GitHub
- URL: https://github.com/mountain/jsq
- Owner: mountain
- Created: 2010-10-21T05:22:07.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2017-02-18T16:45:06.000Z (almost 8 years ago)
- Last Synced: 2024-04-17T03:50:29.864Z (9 months ago)
- Topics: javascript, mop, object-oriented, self-hosted
- Language: JavaScript
- Homepage:
- Size: 814 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Jsq README
==========Jsq is an object system for javascript. This project is not maintained any more
and only for achieve purpose.The API is similar to eBay's VJO system, but the ideas is rooted from MOP
of Lisp CLOS.The overview of the API
-----------------------Below code is an example of the jsq Object system.
```javascript
jsq.cls("test.basic.ChildType")
.bases("test.basic.ParentType")
.defines({
constructs : function (x, y) {
this.base(x+y);
this.x = x;
this.y = y;
},
getX : function () {
return this.x;
},
addToY : function (val) {
return this.y+val;
}
})
.end();
```We intended to implements Namespace, Object(Singleton), Function, Class,
Enumeration, Mixin and Traits types in Jsq, but only Namespace, Object and Class
had been finished.Jsq self descritption
---------------------The most interesting part of Jsq implementation is that we implemented Jsq on
a simplified version of Jsq itself.You can see two bootstrap code in org.jsq.bootstrap packages:
* uBootstrap.js: boot the simplified version of Jsq, only Class was supported
* Bootstrap.js: second round of bootstrap for full version of JsqThe performance of the second Jsq is not alway slower than the first version.
MOP is not a layered achietecture, the second Jsq metaobject is created by the
first Jsq metaobject, but they are independent each other. After the creation
of second metaobject, the first metaobject will be discarded, and the execution
of jsq code afterwards is not dispached to the first metaobject.Why not maintain it
-------------------An Object System is too heavy for Javascript.