DMD v1.0 (again)

Wolfgang Draxinger wdraxinger at darkstargames.de
Thu Mar 23 17:14:34 PST 2006


Kyle Furlong wrote:

> Why don't we try and be definitive about what needs to get done
> before a 1.0 release? Walter may contribute his list as well.
> (this is really what I'm looking for) <g>

* 64 Bit support. That's a must. Or better: Arbitrary register
length support. This of course means, that the ABI is built
around the native length of pointers, pointer differences, etc.

Wishes for D v1.1:

* Eventually it may be good to have types like int8 int64 etc
built into the language. In other languages (C/C++) this is done
using a lot of ugly typedefs, or the compiler introduces types
like __int8 which are then typedefed. Why not build this into
the language? It won't break existing code, too (at least it
doesn't "alias int int32; alias uint uint32;)"

* It would be great to have RTTI without the same dirty tricks as
performed in C++ (deriving everything from a common CObject
class, etc). Make RTTI Information avaliable by introducing
static and dynamic properties.

* I'd like to have classes, interfaces and modules have
a .inferface property (eventually name it a bit different to
avoid clash with "normal" interfaces), that gives a data
structure describing all methods and properties of a class and
it's inheritance hierachy. The inheritance hierachy could be
exposed by a property .super which has itself an .interface
property and .super property. Just have a look at the dir(...)
command of the python language and you get the idea. This
capability of self description would make it much easier to
expose classes to foreign modules loaded by dynamic loaders or
being integrated into component systems or make it avaliable to
script interpreters. I think of the following:

import rtti; // get the types for RTTI

foreach(rtti.method method, this.methods)
{
        script_language_module.add_function(method.name, method.params);
}

method.params would be an array describing each parameter,
eventually having a reference to other RTTI information again.

Up to today no language, that creates compiled binary code has
this feature. Only .net managed code is the closest thing to
have this, but it's not native but gets converted to native code
by a JIT compiler at runtime.

* The other way would be cool, too, i.e. create a typed delegate
from supplied method information. This delegate may then be used
as callback or similair stuff. Through RTTI there is type safety
and giving a mismatching delegate raises an exception. At the
current state such delegates must be defined at compile time.
Runtime function creation can be done with some dirty hacks, but
still requires predefining the types. Normally this involves an
associative array of an intermediary class that does the stack
building and variadic functions. However this is not runtime
safe. So such a class should be able to provide RTTI
information.

* By the way .net: D is IMHO an ideal language to support .net.
Eventually we should try to add CLI output to the compilers for
it.

-- 
Wolfgang Draxinger




More information about the Digitalmars-d mailing list