ADL (/əˈdɛl/) is short for Agnostic Development Language, a dynamic computer programming language created to simplify programming. It leverages a well-known "boxes-and-arrows" metaphor used in applications such as OmniGraffle and Microsoft Visio. ADL is intended to enable developers, at any level of expertise, to build programs visually by using logical flows instead lines of code. Developing ADL on Graph is organized into 3 functional groups: the workspace, the live documentation and the actual code.
The Workspace is the stage or your canvas to work. You'll place and connect elements to create code. ADL uses similar metaphors to traditional drawing and flow-chart applications where there's a workspace that has tools which manipulate elements.
Your workspace tools are organized in a palette displays as a movable vertical palette in your workspace. Like using Adobe Illustrator or Photoshop you start by selecting a desired tool and then click on the workspace to add it to your code.
Elements are visual representations of the code you're developing. Each ADL view is constructed of elements that are connected by lines. The flow of lines to elements determines the process a view runs in ADL. The lines have arrows at one end to guide you down the development path.
The info palette is your window into the data and actions you can do using elements created via the tools. You create, save, update and delete data in this palette.
All data is returned via a "Data Editor" palette that appears only when you need it. The data is displayed using JSON. It's formatted to make it as simple as possible to view and understand.
ADL utilizes 4 types of primitive values.
ADL is a dynamically typed language. Meaning, you don't have to specify the data type of a variable when you declare it, and data types are converted automatically as needed during script execution. So, for example, you could define a variable as follows:var answer = 42;
And later, you could assign the same variable a string value, for example:answer = "May the force be with you..";
Because ADL is dynamically typed, this assignment does not raise an error.
In expressions involving numeric and string values with the + operator, ADL converts numeric values to strings. For example, consider the following statements:x = "The answer is " + 42 // "The answer is 42"
y = 42 + " is the answer" // "42 is the answer"
In statements involving other operators, ADL does not convert numeric values to strings. For example:"37" - 7 // 30"37" + 7 // "377"
A list/array is a list of zero or more expressions, each of which represents an array element, enclosed in square brackets ([]). When you create an array, it is initialized with the specified values as its elements, and its length is set to the number of arguments specified.
The example at right creates an variable named 'coffees' and stores a list/array in it with three elements and a length of three.
An object is a list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}).
The example at right creates an variable named 'coffee & tea' and stores a dict/object in it with 2 key/value pairs elements and a length of two.
To use values stored in a variable in ADL, you simply need to drag the variable from the "Variables" palette to the desired field you want to use the data in the "Info" palette.
Decision making structures (ala "if" statements) require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false. If statements, in ADL, are very similar to those in other popular programming languages. The only difference is that ADL doesn't currently support "elseif" or statements. That doesn't mean you can handle possibly conditional states that didn't match the first. Only that you have to set them up a little differently that when writing traditional code.
This example examines the variable 'x' (which is set to 100) and evaluates if the value is == to 100 (as it is set in the if statement. If so, the "Success" path is taken and the "return" directive is run returning the text 'x is 100!!!' Otherwise the "Failure" path is taken and the "return" directive is run returning the text 'x is not 100 :('
ADL if statements support as many conditions as you would like to define. A condition examines 2 values and evalues them based on a defined comparison.
Available comparisons are
A while statement executes its statements as long as a specified condition evaluates to true. If the condition becomes false, the flow within the loop stops executing and control passes to the statement following the loop.
The condition test occurs before the flow in the loop is executed. If the condition returns true, the flow is executed and the condition is tested again. If the condition returns false, execution stops and control is passed to the statement following the while loop.
A "times" statement executes its statements for a specified number of times. Once the loop has executed the specified number of times, it stops executing and control passes to the statement following the loop. In this example,we achieve exactly what we did in the "while" loop above. Just using less ADL.
The "for each" statement in ADL is a quick and easy way to iterate over a sequence of things. Rather than always iterating over an arithmetic progression of numbers (like in Pascal), or giving the user the ability to define both the iteration step and halting condition (as C), ADL's "for each" statement iterates over the items of any sequence (a list/array, a dict/object, or a string), in the order that they appear in the sequence.
When iterating on lists/arrays or strings, a reserved local variable named 'item' is added to your flow so you can access the currently iterated on 'item.'
Similarly, when iterating on a dict/object, 2 reserved local variables are added to your flow. They are 'k' (for key) and 'v' (for value).
A for loop repeats until a specified condition evaluates to false. The META structure for an ADL "Advanced for" loop is similar to the Javascript, PHP, Java and C "for" loop.
ADL features a fully-formed functional standard library reminiscent of all modern programming languages. You just used visual elements to control the programmatic flow and access data.
The Standard Library has been organized in a simple easy-to-consume manner to you can find what you need as quickly as possible and use it immediately in your ADL.
Plugins are pre-built turnkey functional packages that eliminate the need to replicate things that have been done, and done well time after time in software development. The, in many ways, similar to traditional importable classes, modules or libraries in languages like JavaScript, PHP, Python, Ruby, Java etc.
Graph currently has 25 plugins that are instantly available to your ADL development. Simply go to the "Plugins" section on your "Project" home page and add the ones you want. They'll, then, be immediately available for you to include in you ADL flows. Easy peasy.
By default ADL will return all global variables as response if a eturn" element is not executed before the view completes. If the return element is found, whatever is defined in the data field will be returned as the response.
By default ADL will return all global variables as response if a "return" element is not executed before the view completes. If the return element is found, whatever is defined in the data field will be returned as the response.
A killer feature of ADL on Graph is the ability to use a views as web application pages. Ala Django, Rails, and PHP, you can define logic and template HTML text to process at request time and return a web page instead of JSON data. To achieve this, all you need to do is set the header for the view before your view executes the return element.
Adding headers is a straightforward process in ADL. To achieve this, all you need to do is set the headers for the view before your view executes the return element. Provide the data as a dict/object and all headers provided will be set in the response.