Recent Changes - Search:

edit SideBar

AccessorJS

(redirected from Main.AccessorJS)

AccessorJS is no longer maintained, see Node Host for a maintained Node JavaScript Accessor Host.

In order to compose and run Accessors in a ECMAScript environment, the AccessorJS library is being developed. Specifically, using this library, Accessors can be loaded in a ubiquitously available browser or into the flexible NodeJs environment, which can be run even on a small embedded platform.

For the current state of AccessorJS development go to the AccessorJSDevelopment page.

To check out the repository, use:

git clone https://repo.eecs.berkeley.edu/git-anon/users/shaver/AccessorJS.git

The above repository is readable to anyone.

Note that the repo is not particularly accessible using a web browser, so viewing the URL in a browser probably won't work.

Please take a look. Let Chris Shaver , <shaver@eecs.berkeley.edu>, know if you would like to work on this and he will add you to the repo as a committer.

At the moment, there is only one person actively developing this library (guess who). Nevertheless, it can currently be used to parse and load Accessors, instantiate them, build models out of them, and run these models with a basic synchronous MoC. At the moment, have set up the library to load Accessors from the local file system in Node. Loading them from the internet is certainly no obstacle, but I have not updated that code for the moment to reflect other changes made in the codebase. In general, the formulation of Accessors in the library is out of sync with the Ptolemy II implementation. However, given a little more time, this gap can be closed without much trouble.

Details about how some of this is done can be found in the testing.js file in the main directory of the repository.

Testing Instructions

To run the AccessorJS code

  1. Make sure your environment is set up:
    1. node or io.js installed
    2. clone the repo (address above)
    3. 'npm install' in the main repo directory
      1. This will install the babel transpiler
      2. It will load the dependencies
  2. Run the node REPL:
  3. Run:
    require('babel/register');
    This should load the transpiler. You should see [Function]. If this does not work, the babel transpiler is not loading. Let me know.
  4. Run:
    E = require('./testing'); true;'''
    This will load the testing code under the name E. Let Chris Shaver know if this breaks. Part of this process will involve parsing three accessors: E.Adder, E.Log, E.St
  5. Run:
    E.simpleTest();
    E.modelTest();
    This will run a test on the StockTick accessor. You should see some feedback.

Development - Project

We should be able to experiment with this library during the Terraswarm Programming Workshop on May 27-29th as a workshop project. The following is in place so far:

  • Base libraries lib/*
    • lib/u.js - Foundation library providing utilities.
    • lib/type.js - The beginning of a sophisticated type system.
      • Primitive types.
      • Product, Sum, Record, Variant, Function types.
      • A rendition of type theoretic objects. (I will talk about this later).
    • lib/meta.js - A more sophisticated form of eval. (more about this later).
    • lib/loader.js - A library and resource loader/cacher; similar to require in Node.
    • lib/structures.js - A library with special data structures.
  • Core libraries core/*
    • core/parser.js - converts Accessors from XML to JSON.
    • core/accessors.js - Mechanisms for representing and instantiating Accessors.
      • Port, Accessor, and Instance types/classes.
      • An Accessor library loader.

More details to come!


Edit - History - Print - Recent Changes - Search
Page last modified on November 04, 2016, at 09:27 PM