Running SPARK is fairly simple. Run spark/bin/spark to start the SPARK interpreter. To load a particular module, type:
>>> module modulename
If you want SPARK to automatically load your module on start, use:
spark modulename
You can also pass in command-line arguments to your main: action by using:
spark modulename args
For more detailed information about interacting with the SPARK interpreter, see the SPARK tutorial.
There are also some advanced options you can pass to spark once you are more familiar with the system:
Usage:
spark [-options] [module] [args...]
or spark [-options] -exec script [args...]
Options:
-s <file>, run the interpreter script file
--script=<file>
-h, --help print this help message
-nomain ignore "main:" declarations
-r, --run use run mode (no command-line interpreter)
-v, --version print the current version
The "spark [-options] [module] [args...]" usage allows you to optionally specify a module to load and also pass in command-line arguments to that module. This likely will be the most common way for you to load SPARK. The -exec script usage is an alternate method that is discussed below.
- [module]
- The name of the SPARK module to load on startup. If this parameter is omitted, SPARK will load using a default module.
- [args...]
- Any parameters specified after the [module] will be passed to the main: action of that module (if applicable).
- -s, --script=<file>
- An script file is a list of commands to run in the interpreter when SPARK loads. SPARK will load the [module] (if specified), then run the commands in the script. These commands can be any command the interpreter recognizes (e.g. trace, test, get intentions).
- -nomain
- SPARK-L files can contain a main: definition that indicates an action/procedure for SPARK to execute on startup. Using this option will tell SPARK to ignore this.
- -r, --run
- By default, after SPARK loads, it presents the user with a command-line interpreter. If you wish to disable this by using the -r run-mode option.
-exec script option:
The -exec script option allows you to pass arguments into an interpreter script without having to specify a module to load. (NOTE: THE ABILITY TO PASS IN ARGUMENTS TO THE INTEPRETER SCRIPT IS NOT IMPLEMENTED YET, SO USE OF THIS OPTION IS NOT RECOMMENDED.) This option is useful if you are writing SPARK interpreter scripts on Unix/Linux/OS X and want to use:#!/path/to/bin/spark -execat the top of your interpreter script to make it executable.
The difference between this option and the -s <script> option is small: in order to pass in arguments using the -s <script> option, you have to specify a module name first. The -exec script usage removes this restriction in order to make it easier to write executable interpreter scripts.