Let's create a simple guessing game using a few plugin artifacts and see how artifacts can work together.
For this example we are going to utilize two plugins. A random number generator and a standard input plugin to read user input through terminal.
Our application will pick a random number and ask the user to guess the number.
"@stl/terminal-input0.1.5" #terminal
"@stl/random0.1.5" #random
:terminal.promptAndReadLine $guess
// generating a random number between 0 to 9 inclusive
9 random.integer $TARGET "Enter your guess: " guess
guess = TARGET "Congratulations! You guessed right!" ?
guess > TARGET "Target is smaller, Guess again: " guess
guess < TARGET "Target is bigger, Guess again: " guess
This is a pure event and data driven, aka vibration driven, implementation. All the interactions will naturally happen when the vibrations are available. The code is quite straightforward, even while it is not using any reserved token, common in CPLs.
Although these plugins are running on CPU, the application itself is compiled into a set of mathematical entities that can be executed on any hardware that is Simorg friendly, e.g. a GPU.