Language Idea

Primitive Types

  • bool = one byte boolean
  • char = two byte unicode
  • byte = one byte
  • ubyte = one byte
  • short = two bytes
  • ushort = two bytes
  • int = four bytes
  • uint = four bytes
  • long = eight bytes
  • ulong = eight bytes
  • cent = maximum bytes
  • ucent = maximum bytes
  • ptrsize = depends on arch
  • uptrsize = depends on arch
  • half = two bytes
  • folat = four bytes
  • double = eight bytes
  • real = maximum bytes

Simple Types

Simple Types are Primitive Types, enums, structs, classes or aliases. Enums and aliases are strict to use, but it should be possible to cast them to compatibe types. The void is also a Primitive Type wich can only have the nothing value. Functions with void return can be used the way shown below.

enum First {
	one;
	two;
}

void bar(First one) {
	// somthing useful
}

void baz(First one) {
	// somthing useful
}

alias First Second;

void bar(Second one) {
	// something other
}

bar(First.one);
bar(Second.one);

baz(Second.one);
// no such method

void one() {
	// something
}

void two() {
	// something
}

void bar() {

	if(counter == 1)
		return one();

	if(cunter == 2)
		return two();
}

Memory Management

It should be possible to allocate memory on the heap. The usual new keyword should be used for that. The question is whether to use garbage collection. My idea is that a standard collector should be provided but only for instances constructed explicitly that way. This would be done by adding arguments to the new allocator. We might also want to provide methods for implementing custom allocators and using them.