Coder Social home page Coder Social logo

jsq's Introduction

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.

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 Jsq

The 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.

jsq's People

Contributors

mountain avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.