Getting Started
The Philosophy of Visual Lambda
- Visualized Programming
Programming with Visual Lambda is done primarily with mouse. The program is visualized
with a tree structure.
- Context Sensitive Programming
The Visual Lambda editor GUI application guides user throughout the entire
programming process by providing user all possible choices they can take in the
next step.
- Domain Specific Programming
Visual Lambda limits all possible actions user can use in a specific application
domain. By limiting the application domain user can build safer and clear applications
without sacrificing flexibility mathematically.
Expression
An expression in a programming language is a combination of values, variables, operators, and functions that are interpreted (evaluated) according to the particular rules of precedence and of association for a particular programming language, which computes and then produces (returns, in a stateful environment) another value.
The goal of Visual Programming is to build "modules" with
specific "signature". For more information about module and
signature, see "Type, Module and
Signature".
Expressions usually take several operands. For example, "addition expression" takes
two or more operands to calculate the sum of them. The oprands can be other
expressions as long as the data type matches.
A Visual Lambda module is an expressions itself.
Below are types of expressions currently supported in Visual Lambda:
Note: Users can just try to comprehend as much as possible and then proceed
to the following chapters. Users can always go back and reference the expression
types in the list in the future.
- [Built in] Math Expressions
The Built in math expressions are basic algebraic operators, logical operatorsand
comparison operators.
There are
two types of algebraic operations in this category, arithmetic and bitwise operations.
Arithmetic operators are used to perform many of the familiar arithmetic operations
that involve the calculation of numeric values. Arithmetic operators include
Addition (+); Subtraction (-); Multiplication
(*); Division (/); Modulo operation
(%).
Bitwise operators evaluating two values in binary (base 2) form. Bitwise operations
include And (&); Or (|); Not
(~); Xor (^).
Logical operators compare Boolean values and return a Boolean result. Logical
operations include And (&&); Or (||);
Not (!); Xor (^).
Comparison operators compare two expressions and return a Boolean value that represents
the result of the comparison. Comparison operations include Equality
(==); Inequality (!=); Less than (<); Greater
than (>); Less than or equal to (<=); Greater
than or equal to (>=)
- [Built in] String Functions
String functions are operations that involve a text string. Below are some
examples of string functions.
Properties: such as Length
Comparison: such as Compare, StartsWith, EndsWith
Search: such as IndexOf, LastIndexOf
Transform: such as Insert, PadLeft,
PadRight, Remove, Replace, Substring,
ToLower, ToUpper, Trim
- [Built in] Char Functions
String functions are operations that involve a character. Below are some examples
of character functions.
Test: IsControl, IsDigit, IsLetter,
IsUpper, IsLower, IsNumber,
IsPunctuation, IsSeparator, IsSymbol
IsWhiteSpace, etc.
Conversion: ToUpper, ToLower
- [Built in] DateTime Functions
Built in DateTime functions are functions operate on a Datetime type. Below
are some examples of DateTime functions.
Comparison: Compare
Component Access: get_Year, get_Month, get_Day,
get_Hour, get_Minute, get_Second,
get_TimeOfDay etc
System Time: get_Now, get_UtcNow, get_Today
Calculation: Add, Substract, AddYears,
AddMonths, AddDays, AddHours,
AddMinutes, AddSeconds, AddMilliSeconds,
DaysInMonth, IsLeapYear
Transform: ToLocalTime, ToUniversalTime
Constructor: CreateDateTime
- [Built in] Time Functions
Built in DateTime functions are functions operate on a timeonly type. Below
are some examples of time functions.
Comparison: Compare
Component Access: get_Days, get_Hours,
get_Minutes, get_Seconds, etc
Calculation: Add, Substract, Negate
Constructor: FromDays, FromHours,
FromMinutes, FromSeconds, FromMilliseconds,
CreateTime
- [Built in] Conversion
Built in conversion provides the conversion among types. For example, all primitive
types can be converted to and from a string type.
Integers can be converted into float values but not vice versa.
- [Built in] Collection Functions
Built in DateTime functions are functions operate on a collection type. Below are
some examples of collection functions.
Properties: get_Length
Access: get_Item
Search: Contains, FirstIndexOf
- [System] Math
The system math functions contain trigonometric, logarithmic, and other common mathematical
functions. Below are some examples of system math functions:
Trigonometric: Sin, Sinh, Cos,
Cosh, Tan, Tanh, Asin,
Atan, Atan2
Logarithmic: Log, Log10
Other: Abs, Ceiling, Floor,
Exp, Pow, Max, Min,
Round, Sign, Truncate
- FIX Message Operations
FIX message operations are functions operate on a FIX message or repeating
group instance.
Properties: getMsgType
Access: GetIntValue, GetBooleanValue, GetStringValue,
GetCharValue, SetValue
- Value
Values are constants.
- Template
Template is a special type of constant. The constant value of template can be customized
during deployment. It's a powerful feature of Visual Lambda. We will explain more
details about template in the following chapters.
- [FIX] FieldTags
FIX field tag is a special constant integer value type. User can indirectly specify
the value of the expression by choosing a tag name.
- [FIX] MessageTypes
FIX message type is a special constant string value type. User can indirectly
specify the value of the expression by choosing a message name.
- [FIX] ValidValues
FIX field valid value is a special constant value type. User can indirectly specify
the value of the expression by choosing a pair of field name and valid value name.
Decision
Decision is a special type of expression. It can be composed of two expressions.
The first expression has a type of "Boolean" value (in Visual Lambda we call it
"Condition"). The second one does not have a return value (in Visual Lambda we
call that kind of expression an "Action"). The "Action" can only be executed if
the evaluation of "Condition" returns "true".
Expression Tree and Decision Tree
Both expressions and decisions can be expressed as a tree. Visual Lambda editor
helps user to build the expression and decision trees.
For example, the expressing is display as a tree view with the operands
as the child nodes.
An operand can be another expression, too. So expressions can be nested
to form an express tree. Remember, the Visual Lambda module is an expression, too.
In the following chapters we will walk through building the expression trees fro
Visual Lambda modules.