Storyscripts are executed by the Storyscript Cloud Runtime (not compiled to C or Java or any other language). This gives Storyscript distinct advantages over General Purpose Programming Languages (GPPL) with little to no performance overhead since you can use any other GPPL for data processing (low and high-level programming).
Storyscript is a dynamically compiled language. Type checking is performed at compile time, but not in a traditional way. From the perspective of the developer the following steps are performed during compile time.
Compile time consists of four primary processes:
- Linting is performed to check syntax and grammar.
- Translation is performed which translates the Storyscripts into event-logic tree.
- Dependency checks are performed to ensure command and arguments exists.
- Type-Checking is performed on the Stories the ensure data integrity.
The type-checking includes the following checks:
- Type mutation method exists.
- Arguments are of the expected type.
- All dependencies are gathered and prepared for execution.
- The Storyscript Cloud Runtime is prepared with the Stories as first-class assets for swift execution.
- Every Storyscript is executed allowing them to register with event-based services.
A story may execute in many ways.
- The Runtime received notice to start a Story with or without starting arguments.
- The Story is executed in a single thread.
- When a service is called the Runtime will communicate with the service passing necessary data to and from the service back into the primary thread.
- Asynchronous commands may generate new threads and execute in the same pattern above.
translated = language_service translate from:my_string to:"spanish" words = translated.split(by: " ") service_b action_b name:words
The Story above is would perform the following operations:
- Translate a string to Spanish (calling the service
- Split the translated string by whitespace into
- Invoke a second service
action_band pass the first word of the translated text as