IBM Streams 4.3.0

Expression language

Though SPL is a streaming language, there are many places where it uses expressions that are found in traditional imperative or functional languages.

SPL expressions look similar to expressions in languages like C, Java™, or Python: for instance, they have the same operators and even the same operator precedence. But since runtime faults are a big challenge in distributed systems, SPL performs stricter compile-time error checks on expressions than C, Java, or Python: it permits fewer implicit type conversions, and restricts aliasing, side effects, and non-determinism more. SPL's static guarantees also facilitate more compiler optimization. Some expressions are evaluated at run time: in operator output assignments or operator parameters. Some expressions are evaluated purely at compile time, during code generation: these include operator configurations and window clauses. And finally, there are places where SPL accepts not only expressions, but even statements like in traditional languages: such as in operator logic and in function definitions. Strictly speaking, SPL does not really need statements, because the user can put such logic in native code. It supports statements anyway because statements are often easier to write directly in SPL than by going to a native language. Also, statements that are written in pure SPL are more portable across back-end languages, and offer more opportunities for front-end optimizations.