# US 2016/0253155 A1 · Apparatus and method for metaprogramming platform

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0253155 A1
- Document ID: US20160253155A1
- Status: Published application
- Kind: A1
- Application number: 15/054,995
- Filed: 2016-02-26
- Published: 2016-09-01
- Earliest claimed: 2015-02-27
- Assignees: The Treeline Company
- Applicants: The Treeline Company
- Inventors: Mike McNeil; Scott Gress; Cody Stoltman; Rachael Shaw; Irl Nathan
- Web page: https://patentgrep.com/patent/US20160253155A1

## CPC

- G06F 11/3684: {for test design, e.g. generating new test cases}
- G06F 8/41: Compilation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided is a process of compiling user instructions into a JavaScript program, the process including: obtaining a library comprising a plurality of subroutines having a standardized interface and encoded in a human-readable format; obtaining a decision tree, the decision tree containing a declarative representation of business logic to be implemented in a human-readable JavaScript program to be executed server-side in a client-server architecture, the decision tree identifying at least a plurality of the subroutines in the library to be used in the JavaScript program; and compiling the decision tree and the plurality of subroutines into the JavaScript program, wherein compiling comprises: crawling the decision tree and identifying the subroutines; parsing the one or more instructions executed to perform the tasks of the identified subroutines from the respective standardized interface of the identified subroutines; and adding at least part of the parsed instructions to a text representation of the JavaScript program.

## Claims

### Claim 1

A method of compiling user instructions into a JavaScript program, the method comprising:
obtaining a library comprising a plurality of subroutines having a standardized interface and encoded in a human-readable format, each subroutine being a callable unit, each standardized interface comprising:
a set of input specifications of inputs to the respective subroutine, each input specification comprising:
a unique identifier of the respective input specification;
a description of the respective input; and
an indication of whether the respective input is required by the respective subroutine;
a set of exit specifications of exits to the respective subroutine, each exit specification comprising:
a unique identifier of the respective exit specification; and
a description of the respective exit;
one or more instructions executed to perform a task of the respective subroutine, the one or more instructions receiving as input the inputs corresponding to the set of inputs specifications, and the one or more instructions having a set of exits corresponding to the exit specifications;
obtaining a decision tree, the decision tree containing a declarative representation of business logic to be implemented in a human-readable JavaScript program to be executed server-side in a client-server architecture, the decision tree identifying at least a plurality of the subroutines in the library to be used in the JavaScript program; and
compiling the decision tree and the plurality of subroutines into the JavaScript program, wherein compiling comprises:
crawling the decision tree and identifying the subroutines;
parsing the one or more instructions executed to perform the tasks of the identified subroutines from the respective standardized interface of the identified subroutines; and
adding at least part of the parsed instructions to a text representation of the JavaScript program.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the decision tree comprises:
sending a user device a graphical representation of a block diagram of a portion of the decision tree and at least some of the subroutines in the library;
receiving an indication from the user device that the user has dragged and dropped a given one of the subroutines into the block diagram;
sending the user device the input specifications and the exit specifications of the given one of the subroutines; and
receiving, from the user device, an indication that at least some of the input specifications and at least some of the exit specifications are matched by the user to other input specifications and other exit specifications of other subroutines in the decision tree.

### Claim 3 (depends on 1)

The method of claim 1, wherein compiling comprises:
composing function calls to subroutines based in links between exits and inputs in the decision tree; and
adding the function calls to the text representation of the JavaScript program.

### Claim 4 (depends on 1)

The method of claim 1, comprising:
automatically generating human-readable, prose-form program documentation based on the set of input specifications or the set of exit specifications.

### Claim 5 (depends on 1)

The method of claim 1, wherein at least of the input specifications and at least of the exit specifications comprise a respective data type, the method comprising:
crawling the decision tree to identify an exit of a first subroutine mapped to an input of a second subroutine;
determining that a data type of the exit of the first subroutine is inconsistent with a data type of the input of the second subroutine; and
in response to the determination, alerting a user.

### Claim 6 (depends on 1)

The method of claim 1, wherein an input specification of a given subroutine comprises an input validation function, the method comprising:
executing the input validation function upon receiving an input to the given subroutine.

### Claim 7 (depends on 1)

The method of claim 1, wherein compiling comprises:
identifying a given subroutine in the decision tree;
determining that the given subroutine contains an input specification with an indication that a respective input is required;
determining that the decision tree does not specify a value for the respective input; and
in response to the determination, alerting a user.

### Claim 8 (depends on 1)

The method of claim 1, wherein a first one of the input specifications comprises a data type that indicates a given input can only be used once, wherein compiling comprises:
determining that a second one of the input specifications uses the input; and
in response to the determination, alerting a user.

### Claim 9 (depends on 1)

The method of claim 1, comprising:
generating a test routine for the JavaScript program based on the standardized interface of a subroutine in the JavaScript program.

### Claim 10 (depends on 1)

The method of claim 1, comprising:
executing the JavaScript routine on in a Node.js server;
receiving a request from a browser or native application executing on a remote user device with the server;
executing at least three of the subroutines in response to the request; and
sending responsive content to the remote user device via the Internet with the Node.js server.

### Claim 11

A system comprising:
one or more processors; and
memory storing instructions that when executed by at least some of the processors effectuate operations comprising:
obtaining a library comprising a plurality of subroutines having a standardized interface and encoded in a human-readable format, each subroutine being a callable unit, each standardized interface comprising:
a set of input specifications of inputs to the respective subroutine, each input specification comprising:
a unique identifier of the respective input specification;
a description of the respective input; and
an indication of whether the respective input is required by the respective subroutine;
a set of exit specifications of exits to the respective subroutine, each exit specification comprising:
a unique identifier of the respective exit specification; and
a description of the respective exit;
one or more instructions executed to perform a task of the respective subroutine, the one or more instructions receiving as input the inputs corresponding to the set of inputs specifications, and the one or more instructions having a set of exits corresponding to the exit specifications;
obtaining a decision tree, the decision tree containing a declarative representation of business logic to be implemented in a human-readable JavaScript program to be executed server-side in a client-server architecture, the decision tree identifying at least a plurality of the subroutines in the library to be used in the JavaScript program; and
compiling the decision tree and the plurality of subroutines into the JavaScript program, wherein compiling comprises:
crawling the decision tree and identifying the subroutines;
parsing the one or more instructions executed to perform the tasks of the identified subroutines from the respective standardized interface of the identified subroutines; and
adding at least part of the parsed instructions to a text representation of the JavaScript program.

### Claim 12 (depends on 11)

The system of claim 11, wherein obtaining the decision tree comprises:
sending a user device a graphical representation of a block diagram of a portion of the decision tree and at least some of the subroutines in the library;
receiving an indication from the user device that the user has dragged and dropped a given one of the subroutines into the block diagram;
sending the user device the input specifications and the exit specifications of the given one of the subroutines; and
receiving, from the user device, an indication that at least some of the input specifications and at least some of the exit specifications are matched by the user to other input specifications and other exit specifications of other subroutines in the decision tree.

### Claim 13 (depends on 11)

The system of claim 11, wherein compiling comprises:
composing function calls to subroutines based in links between exits and inputs in the decision tree; and
adding the function calls to the text representation of the JavaScript program.

### Claim 14 (depends on 11)

The system of claim 11, comprising:
automatically generating human-readable, prose-form program documentation based on the set of input specifications or the set of exit specifications.

### Claim 15 (depends on 11)

The system of claim 11, wherein at least of the input specifications and at least of the exit specifications comprise a respective data type, the method comprising:
crawling the decision tree to identify an exit of a first subroutine mapped to an input of a second subroutine;
determining that a data type of the exit of the first subroutine is inconsistent with a data type of the input of the second subroutine; and
in response to the determination, alerting a user.

### Claim 16 (depends on 11)

The system of claim 11, wherein an input specification of a given subroutine comprises an input validation function, the method comprising:
executing the input validation function upon receiving an input to the given subroutine.

### Claim 17 (depends on 11)

The system of claim 11, wherein compiling comprises:
identifying a given subroutine in the decision tree;
determining that the given subroutine contains an input specification with an indication that a respective input is required;
determining that the decision tree does not specify a value for the respective input; and
in response to the determination, alerting a user.

### Claim 18 (depends on 11)

The system of claim 11, wherein a first one of the input specifications comprises a data type that indicates a given input can only be used once, wherein compiling comprises:
determining that a second one of the input specifications uses the input; and
in response to the determination, alerting a user.

### Claim 19 (depends on 11)

The system of claim 11, comprising:
generating a test routine for the JavaScript program based on the standardized interface of a subroutine in the JavaScript program.

### Claim 20 (depends on 11)

The system of claim 11, comprising:
executing the JavaScript routine on in a Node.js server;
receiving a request from a browser or native application executing on a remote user device with the server;
executing at least three of the subroutines in response to the request; and
sending responsive content to the remote user device via the Internet with the Node.js server.
