...
Even though SIL works just fine as a standalone scripting language outside Jira (for example our installers use SIL to copy the apps to your Jira directory), where it but inside Jira it really makes a difference is inside Jira.
Architecture
The SIL language is actually independent from Jira. It can be used for any purpose, for instance be applied for Confluence. It can be applied for anything. On top of the basic interpreter we've also added a Jira specific interpreter which predefines the standard variables, the key variable the key variable for instance which represents the key of the issue.
As you can see, Jira SIL interpreter (or Issue SIL interpreter as we call it internally) interpreter basically extends the capabilities of the standard interpreter. The standard SIL Interpreter provides a registry for all routines and the Issue SIL Interpreter adds the additional routines into this registry including Jira interactions.
...
Just like any other programming language, a standalone SIL program contains variables, functions (or as we often call them "routines"), and conditional and repetitive clauses. Putting this inside a Jira context will enable enables you to use Jira related routines like createIssue or linkIssue (so the script "has Jira context"). Adding an issue context inside the Jira context (so the script "has an issue context"), will enable enables you to use field values stored on the issue, regardless of whether they are standard fields like summary, description, assignee, or custom fields.
These will be predefined and ready to use without any need for variable definition. When the interpreter (yes, it's interpreted) finds a variable, it looks for it in a pretty much mostly the same way as any other language would. Each block of code is a variable context. Nested blocks will push these contexts into a stack. When looking for a variable, it starts from the current block of code and moves down the stack. If the variable is not found, it will attempt to match it against the fields on the issue (consider this at the bottom of the stack). Let's make it visual using pseudocode.
...
You might notice that SIL works pretty much in mostly the same way inside and outside of an issue context. The two additional contexts (Jira and issue) bring more functionality that you can instantly use inside your program.
...