yarnlang

the more you know, the less you need

yarnlang

An interpreted language for powerful data manipulation, inspired by neuron-style functions.

Each yarn is made up of an ordered list of commands which are evaluated as a hashmap.

Each command in a yarn may take any combination of none or many inputs, represented by literal values and/or existing fields (copied as literal values) from the hashmap by glob style matching a fields key.

The inputs (if any) are linearly processed by the command - the resulting output of which is stored back into the hashmap overwriting or creating one or many new fields.

A yarn may return a string, representing an error that occurred during evaluation - or if successful a yarn will return a hashmap of all fields whose key's match the glob style pattern 'return*'.

Simple Command Syntax: input~command~output

Multiple Command Syntax: input~command0~output,input~command1~output

Literal Input Syntax: (@ - at symbol, followed by the value url encoded as a string) @%20hello%20world~command~output

Multi Input Command Syntax: input0 input1 inputN~command~output

Multi Output Command Syntax: input~command~output0 output1 output2

Multi Input Multi Output Command Syntax input0 input1 inputN~command~output0 output1 outputN

Single Character Glob Style Input Command Syntax: (assuming the keys 'input0' 'input1' and 'inputN' exist in the hashmap) input?~command~output

which becomes logically equivalent to:
input0 input1 inputN~command~output

Multi Character Glob Style Input Command Syntax: (assuming the keys 'input0' 'input1' and 'inputN' exist in the hashmap) put~command~output

which becomes logically equivalent to:
input0 input1 inputN~command~output

Mixed Input Command Syntax: (assuming the keys 'special0' 'special1' and 'specialN' exist in the hashmap) inputBefore special* inputAfter~command~output

which becomes logically equivalent to:
inputBefore special0 special1 specialN inputAfter~command~output