Code Monkey home page Code Monkey logo

lithium-js's People

Contributors

daluege avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

lithium-js's Issues

Written state

Promote written state within context, do not branch if no write operation occurred.

Seek on radix tree

PatriciaTrie: negative index argument to slice returns a super tree matching the index (tree.parent).

Simple command-line interface

Create a simple command-line interface that accepts input tokens and outputs responses in a synchronous manner using STDIN and STDOUT streams in a POSIX-compatible way.

Bind this interface to a dummy API #5, matching specifications of #2

Extended AVL tree

Extend the tree class:

  • enable enhanced comparison if a .compare method is present on the value object
  • create an altered .find method that returns a node instead of a value
  • add .next() and .previous() to the node interface

Test: CLI input

Create test files representing ASCII text input sequences bootstrapping a valid record tree (genesis).

Any of these tests shall be executable as record << testfile and process without error.

Note: in the JS client, the line break serves as token-separator.

@expose decorator

Implement expose decorator as separate package.

@expose(Y) class X {
  stream: Readable
}

Merge trees

Perform merging if a transition function bound to the context of a subsequent state is applied (executed) on a preceding state on the same level (same output state).

The condition for this event is Record.context.isPrototypeOf(this.context)

No dynamic function prototype

Drop rebasing of Record interface prototype.

Reasons:

  • Not every record chain executed in every client. Properties not available on uninterpreted records. Results in non-deterministic behavior.
  • Rebasing inefficient.
  • Records instances are too heavyweight for atomic functions and values. Record object properties should be populated natively by the JS process.

Branch logics

Specify branching behavior of sequences. Link sequential branches and link target input arguments for reproducibility of transitions as to be performed in #14

Case: execute in current context

  this('dirname/filename < ./input');

Invokes filename in a local context. Written records are visible on the top level - not in 'dirname`.

Add modules folder, export functionalities

Collect modules with isolated APIs such as fork, PatriciaTrie as NPM packages in a new modules folder. Import source code from there directly, do not npm install separately. However, publish modules separately on NPM.

Overridden records

If a descendant record

  • does not appear in the .next stream of its ancestor any more
  • has no children

remove its key from ancestor's map, as it has no information content. It is only selectable supplying the full record value, which would lead to creation of an equivalent record if it did not exist.

Case: split off input prefix

function (str) {
  return str.substr(0, 5);
  // Receives a long string, writes a prefix = redirection target
  // The interpreter will execute the substring.
  // This subsequent execution cycle will select the full str and apply the remainder on the context.
}

Execute in context

Execute a target in a promoted context if the calling context inherits from the transition's context, i.e. it is a newer input state of the same output state.

The condition for this event is this.context.isPrototypeOf(Record.context).
It is opposite to #14.

TypeScript

Migrate to TypeScript, which will improve interface and visibility declarations.

Case: change directory

this('..')() acts equivalent to this('cd ..').

this('..'); has no effect on the path.

Radix tree path

PatriciaTrie nodes must contain a pointer to their full key; rename key to path, add key.

Test: Tree API

Create JS-based NPM tests for the record tree API implemented in #2

Eliminate lib

Eliminate lib folder, replace by external dependencies or move to src.

ES6 and Babel

Migrate from standard JS to Webpack, ES6 and Babel.

Record tree pipes API

Create an API that accepts a sequence of token strings and returns static responses, function handlers or undefined if input is verifiable and otherwise throws an error.

Store the record tree in memory based on the JS object model.

Stick to the Record JS API specification regarding the handler model.

Satisfy API required by #1

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.