D.NET

Status: Inactive

I have received a number of inquiries about my old D.NET project with people wanting the source code or wondering when I will finish it. I have decided that it was time to put it all to rest and perhaps pass the torch, along with what knowledge I have acquired during the project in hopes that someone else will do it right.

First off, I no longer have the code. I lost it in a HDD crash, so please do not e-mail me for it anymore.

Secondly, I wouldn't give it even if I had it, because it so badly mangled the D front-end, and was so poorly designed in general, that I could not advocate its use, even for a learning tool.

I will, however, point anyone interested in the general direction for how to use NET's Compiler namespace to generate assemblies. This is far from a comprehensive analysis, but it should at least give you enough to get started. Much of the rest can be learned from the myriad MSDN articles available online.

The basic process for creating a .NET assembly is this: (If you can't follow this, then take a few programming classes or read some tutorials before you try this, because you'll have no hope otherwise)

Instantiate the AssemblyBuilder class

Use it to create new ModuleBuilder instances

In each module, you can use the various other *Builder classes to create the framework for the module (VariableBuilder, FunctionBuilder, ClassBuilder, etc)

Okay, so I don't remember enough of the details to help more than that. Basically, start with the AssemblyBuilder and read the MSDN notes.

The biggest advice I have to offer is not to build it directly in the front-end, but rather implement the stubs in the front-end to build an input file that you can then pass to the assembly generator code.

I hope this helps. .NET is really too wonderful a concept for D to ignore, so I hope someone decides to take this up again.

D.NET is a D compiler that I'm writing (I'd call it a back-end, except that it's reaching the point where I'm almost forking the front-end because I've had to modify it so much).

D.NET compiles standard D code into MSIL which is the .NET intermediate language used to create .NET compatible assemblies. The assemblies generated by D.NET are usable in other .NET languages such as Managed C++, C#, VB.NET, ASP.NET, etc.

Since I'm currently moving and I'm not sure if I'll be able to have my webserver running in my new home, the Python/D and D.NET websites are in a state of flux.

I have set up a web forward to point to my temporary site for now and it will then forward to my new permanant site once I have one, but if you're looking for information about Python/D or D.NET, check out:

Currently all I have uploaded is an in-progress article I'm writing discussing the nuances of working with D.NET, but I plan to have a full-blown site up and running once I get moved and have my desktop computer set up again.

Until then, enjoy the work in progress that'll be updated frequently over the next few days

Actually, that link is relatively worthless at the moment, since my normal webserver (with all my files) is currently sitting unplugged beside me ready for when I move.

But, to answer your question, yes. I've already written most of a D.NET compiler. I'm refactoring it right now to make it easier to apply bug fixes to DMD directly to D.NET as they both use the same basic front-end code. Once that's completed, there are only a scant few more features I need to implement (inline IL, templates, foreach, etc.) before a beta is released.

Continue to monitor that link, however, as it will change to reflect my real D.NET site once I'm done moving next week.

Thanks to the mild excitement displayed over the D.NET project, I've found my second wind on the project and the first thing I did was to overhaul the way arrays and slices are handled to put them in line with the D style of slicing.

I've uploaded a new version of D.NET that does proper slicing as well as a new version of my test file to show you what I've tested and what works for sure. They can be found (respectively) at:

Just a note if you haven't tried D.NET yet, at the moment it requires the VC++ 2005 Express Beta from Microsoft, and will continue to until I can figure out how to get VC8 to build it to work with the VC7 or VC7.1 runtimes.