What is missing
missing operators:
||, &&, |, &, <<, >>, >>>, ^, ~
all op=
missing unary: !, ~, &, ++, --
public/private
import alias
root lookup(like .x to get first declared x in scope)
arrays/strings
dynamic arrays
inline arrays ( [x,y] gives a int[2] )
support the more advanced stuff (~=, slices etc.)
- either by generating llvm code, or by calling user defined functions
like dmd
imaginary and complex types
structs
methods
static members/methods
operator overloading
classes
inheritance
a default object.d with "class Object" in it
override
abstract
interface
delegates
in/out/ref
function pointers
complex numbers
alias
templates
First the simplest form:
---
template Foo(T) {
T x;
T foo(int x) { ... }
}
Foo!(long).foo(2);
---
Then slowly add features.
The alias trick (template Foo(T) { alias T[10] Foo; }) allowing Foo!(int)
to be used as int[10].
The same with vars:
---
template Foo(T) {
const int Foo = ...
}
---
directly templated functions (bool foo(T)(T x) { ... })
implicit instantiation of those (only for functions, not types)
specialization (and argument deduction)
get the two previous working together if possible
CTFE
requires const - D2 og D1 const system or can we get away with some mix
needs an interpreter for a subset of the language
1. Use LLVM to do it, might be faster to develop but might also make it
extra work to make sure only the allowed stuff is executed
2. Interpreter working directly on the ast (or as part of it)
probably easiest way to get it running and make sure we only
execute the legal subset
3. Make an actual VM
most work & best result?
associative arrays
extern(C)