========================================================
Primitive Types
========================================================

JIT
IL
Data Processor Language

Code
	-> [ParserGen] -> Tree
	-> [DPL Data Converter] -> DPL Tree
	-> [Compiler Coded in DPL] -> IL

Native Control Language
Koncept

========================================================
Primitive Types
========================================================

void				system.Void
					system.Interface
object				system.Object				// similar to dynamic in C#
uint8				system.UInt8
uint16				system.UInt16
uint32				system.UInt32				(uint)
uint64				system.UInt64
int8				system.Int8
int16				system.Int16
int32				system.Int32				(int)
int64				system.Int64
float				system.Single
double				system.Double
bool				system.Boolean
char				system.Char
string				system.String
					system.DateTime
					system.Locale
					system.Enumerator
					system.Enumerable
					system.ReadableList
					system.List
					system.ReadableDictionary
					system.Dictionary
					system.InterfaceProxy
					system.Function

========================================================
Composite Types
========================================================

{T}					system.Enumerable<T>
[T]					system.List<T>
const [T]			system.ReadableList<T>
{U:T}				system.Dictionary<U, T>
const {U:T}			system.ReadableDictionary<U, T>
func (T1, T2):R		system.Function<R, T1, T2>
func (T1, T2)		system.Function<void, T1, T2>

ClassType*			raw pointer
ClassType			shared pointer

========================================================
Definitions
========================================================

extern <definition>

struct Point
{
	x : int;
	y : int;
}

(enum|flags) Season
{
	Spring,
	Summer,
	Autumn,
	Winter
}

func Sum(xs : {int}) : int // compiled as a static method in <current-namespace>::$GlobalFunctions class
{
	result : int = 0;
	for(x in xs)
	{
		result = result + x;
	}
	return x;
}

interface Link
{
	prop Data : string;
	prop Next : Link;
}

interface IDerived : IBase1, IBase2
{
	ctor (proxy : system.InterfaceProxy);
	func Do(x : string);
	static func Do(x : string);
	prop Text : string {get GetText; set SetText;}
	event Clicked : func (GuiGraphicsComposition*, GuiEventArgs*);
}

// extern interface inherits extern interface
// interface inherits interface
// interface inherits extern interface with ctor(system.InterfaceProxy)

namespace system
{
}

========================================================
Constructors
========================================================

0
1.0
"fuck"
true
false
null

{}
[]
[1, 2, 3]
{
	"x" : 1,
	"y" : 2,
	"z" : 3
}

Point { x : 1, y : 2 }
{ x : 1, y : 2 }

Class(100) [{ ... }]
Class
{
	A : 0,
	B.C.D : 1,
	.Do("fuck"),

	obj1, obj2, obj3 ...
}

x -> x+1
(x) -> { return x+1; }
func (x : int) : int { return x+1; }

new IDerived // requires ctor(system.InterfaceProxy)
{
    func Do(x : string)
	{
		Print(x);
	}
}

========================================================
Expressions
========================================================

Unary:
	+
	-
	bnot
	not
	typeof Type // Type to system::TypeDescriptor
	typeid a // Value to system::TypeDescriptor
	cast a [to Type]
Binary:
	* / \ %
	+ - ++ // += for string concatenation
	shl shr
	^ // integers and flags
	&
	|
	< <= > >= == <>
	^^
	&&
	||

a[b]
a(b, c)
a.b
(a)
this // used in functions in classes

var handler = attach this.Clicked((a,b)->{});

// casting from or to object is implicit
// casting between numbers is implicit
// casting between string and non-interfaces calls system::ValueSerializer
// boolean operation returns bool even if arguments are objects
// signed and unsigned intergers are not allowed to do calculation
// result of interger operations is int64 or uint64

legal casting:
	numbers <--> numbers
	string <--> non-interfaces
	interfaces <--> interfaces // in inheriting relations
	object <--> everything // implicit
	null --> interfaces, void

========================================================
Statements
========================================================

a = b;
a : Type = b;
var a = b;

<function-call-expression>;
detach handler; // event handler
raise this.Clicked(composition, args);

delete exp;
return [exp];
break;
continue;
throw exception;

if (exp) statement [else statement]
try if(x [: Type] = exp) statement [else statement]
while (exp) statement
do statement while (exp);
for(x [: Type] in xs) statement
for(x [: Type] in a to b) statement
try statement [catch(ex [: string])] statement [finally statement]