Language Reference
A language reference is a formal document that provides the information required to write a compiler or analysis tools for source code input.
Fly is currently a moving target and a complete language specification is premature. A few sections will be posted here though.
Terms
Compilation unit: A Fly program in source form is composed of one or many compilation units. The most typical example is a set of source files, each containing one or many class definitions. However, a compilation unit may also be present in other forms, such as a network location (URI). The term translation unit is used interchangeably with compilation unit.
Class: A class introduces to the compiler a new type containing attributes and a set of functions to define the shape and behavior of objects.
Type: Fly has two kins of types: Primitive types like integers and booleans, and object types. For each primitive type, an object version exist to provide nullability.
Lexical syntax
<todo>
Type system
There are two kinds of types: object types and primitive types. The primitive types are int<bits> and uint<bits> for signed and unsigned integer types respectively; 'bits' can be 8,16,32 and 64. In addition int and uint without the bits modifier denotes integers of the native size. Types float, double, decimal denotes IEEE 32, 64 and 80 bit floating point numbers.
For each primitive, there is an object type version whose type name has the first letter uppercased, such as Int32. The compiler will automatically box and unbox between object and primitive types. The main purpose of the object type versions is to provide nullability. Note that calling a method on a primitive type does *not* incur boxing overhead.
Object types are defined by classes whose base class is ultimately system.Object.
Function overload resolution
Two or more functions with the same name, but with different parameter types, are said to be overloaded. When a caller references an overloaded function name, the correct function must be found based on the actual parameter types.
The functions of a base class is only searched for matches if no match at all is found in the declared type of the called function.