KSL Wiki
Welcome to the official documentation for the KSL programming language. This site provides a comprehensive reference covering the following areas:
- Language Specification – Detailed syntax rules and core language concepts.
- Built-in Function Reference – Complete guide to the standard library and available built-in functions.
- Examples and Tutorials – Practical code samples and walkthroughs to help you get started.
Creating Standalone Executables
KSL includes a utility script, bundle.sh,
that packages a KSL script together with the interpreter into a single, standalone executable.
Prerequisites
The following three files must be placed in the same directory before running the script:
- The
bundle.shscript itself. - The
kslinterpreter executable. - The KSL script you intend to bundle.
Usage
Invoke the script as follows:
./bundle.sh <ksl_script_file> <output_executable_name>
Example
The following script, fib10.ksl, computes the 10th Fibonacci number:
Let[{ a, b, m }, { 0, 1, 0 }];
While[Less[m, 10], {
Update[{ a, b }, { b, Add[a, b] }],
Update[m, Add[m, 1]]
}];
Print[a];
To package this script into an executable named fib10, execute:
./bundle.sh fib10.ksl fib10
This command produces the executable file fib10.
Both the original script and the bundled executable yield identical output:
> ./ksl fib10.ksl
55.0
> ./fib10
55.0