========================================================
Native Language that directly maps to the instructions
========================================================

========================================================
Types
========================================================

int/uint (according to architecture bits)
int8/int16/int32/int64
uint8/uint16/uint32/uint64
float/double
char/bool
handle/pointer/function

<user-defined-type>

T*		// pointer, T cannot be a repeat type
T[x]	// array
T^		// handle

function (T1, T2, T3) [: R]

========================================================
Operators
========================================================

! ~ + -

* / %
+ -
<< >>
== != < > <= >=
^ & |
^^
&&
||

// op= satisfies forall T . T op U == T
= *= /= %= += -= <<= >>= ^= &= |= ^^= &&= ||=

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

op A
A op B
(A)

<expr>.field		// get field

pointer:
	<expr>*			// dereference
	<expr>->field	// get field
	<expr>[x]		// offset
	&<expr>			// get address of a left-value

handle:
	<expr>^			// dereference handle for struct type or header for repeat type
	<expr>->field	// get field
	<expr>[x]		// dereference repeat for repeat type

alloc T				// ptr_alloc
alloc T[x]			// ptr_alloc

new T				// gc_alloc
new T[x]			// gc_alloc_array
pin handle			// gc_pin
length(handle)		// gc_length

sizeof(T)
expr as T
function(args)

exception			// the current exception object of type handle in catch statements
null				// pointer, handle and function

// when dereferencing a handle, T^ returns T*, handle returns pointer

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

A = B;
A op= B;

free T;				// ptr_free
copy(dst, src);		// ptr_copy
unpin handle;		// gc_unpin

if (expression) statement [else statement]
loop statement
try statement catch statement finally statement

break;
continue;
return [expression];
throw [expression];

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

struct Type
{
	field : Type,
	...
}

repeat Type = HeaderType RepeatType;

var x : Type [= expression];

function (a1 : T1, a2 : T2) [: R] statement