Type, Module and Signature
Visual Lambda is a graphical programming language. In QWFIX, Visual lambda can be
used to generate complicated rules.
Types
Unlike most scripting languages, Visual Lambda is a strong typed languages. Every
piece of data in Visual Lambda is associated with a data type.
It's application developers' responsibility to specify types supported in their
own applications in the Visual Lambda initialization function calls.
In QWFIX, the following types are currently supported in Visual Lambda:
- int
The "int" data type defined in FIX specification.
- float
The "float" data type defined in FIX specification.
- String
The "String" data type defined in FIX specification.
- char
The "char" data type defined in FIX specification.
- Boolean
The "Boolean" data type defined in FIX specification.
- DateTime
The "Timestamp" data type defined in FIX specification, which represents both a
date and a time.
- TimeOnly
The "Time" data type defined in FIX specification. Note the TimeOnly is also used
to represent a TimeSpan data type. In another word, TimeOnly in QWFIX can have negative
or greater than 24 hours. Also TimeOnly can be acquired by substracting two DateTime
types as an interval of two times.
- Regex
Represents a regular expression.
- FIXMessage
Represents a FIX message.
- FIXMessageRepeatingInstance
Represents an instance in FIX repeating group.
- FIXMessageComponent
Represents a FIXMessage or a FIXMessageRepeatingInstance. It can be viewed as a
base calss of both FIXMessage and FIXMessageRepeatingInstance. FIXMessageComponent
is a collection of fields as key/value pairs. Operations supported on FIXMessageComponent
are also supported on FIXMessage and FIXMessageRepeatingInstance.
Collection Types
Visual Lambda support collection types. A collection type is a one dimensional array
of types listed above. Users can define their own static collections that contain
pre-defined fixed number of members. Expressions can also return an instance of
collection dynamically.
Currently, collections has the following limitations:
- Only one dimentional collection is supported. The system doesn't support types such
as "collection of collections".
- Visual Lambda can only read the length of the collection, or read members of collection
based on an index specified. Operations that alter the collection is not supported.
Visual Lambda Module and Signature (Input and Output)
A Visual Lambda module is like a function in other programming languages. A module
has a list of input parameters and possibly one output parameter. Like many other
languages, the output parameter in Visual Lambda is called "return
value".
A Visual Lambda module that doesn't return any value is called "action".
In Visual Lambda, the type and order of input parameters, along with the type of
output
parameter (possibly empty), is called signature.
For example, two modules that share the same signature will have the same type of
input parameters, in the same order and the same output parameter.
The framework can compile modules into native code so that the host application
can simply call the modules in the same way as calling regular program functions.