Free Electron
|
Provide a simple casual end user scripting solution.
If a full feature scripting language is needed for a particular application, then it might be better to embed something like lua or python. This solution is meant to be extremely light, straighforward, and simple.
However, one significant upside for FE is that this directly operates on src/data, and is plugged into via FE components.
The language itself is very light and lisp-like.
Expression are of the form:
The first token (in the above, "a") is first checked to see if it is a known function. If it is, the expression is a function call. If it is not, then the expression is an assignment to a variable of that name.
Other fields maybe be expressions, numbers, or variables.
There is a single global notion of variables (this is for simplicity and performance).
Assignment is done by using an expression where the first token is the variable name. Access is simply by using the variable name as a field.
Comments start with "#" and go to the end of the line.
Full lisp-like functions and lambda are not yet supported. However, "define" can be used to specify re-callable code. This approximates functions, but without arguments support (yet).
Functions are added by implementing fe::ext::FunctionI.