Last update July 18, 2009

DDot Net



Difference (last change) (no other diffs, normal page display)

Added: 2a3,4
[[text][title=NOTE:]This is an older project unrelated to the D.NET Compiler.]


D.NET    

NOTE:
This is an older project unrelated to the D.NET Compiler.

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)

  1. Instantiate the AssemblyBuilder class
  2. Use it to create new ModuleBuilder instances
  3. 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.

Best of luck,

Déja Augustine

(from NG:digitalmars.D/30873)

Table of contents of this page
D.NET   
Status: Inactive   
Home Page   
System Requirements   
Related Newsgroup Posts   
Related Discussion   
Related Link   
Comments   

Home Page    


System Requirements    

  • D.NET requires Microsoft's VC++ 2005 Express Beta to be installed. (Apparently, D.NET is incompatible with the VC++ 2005 Beta 2. Unless you've previously downloaded the first Beta, you probably can't run the D.Net compiler.)

Related Newsgroup Posts    

Below are some excerpts from posts related to a project by Deja Augustine to create a D compiler that produces MSIL.


From NG:digitalmars.D/6898:

I would simply like to add that if the code gods smile upon me, D will soon be able to interop with .NET while still maintaining it's current compatibility with C-linked binaries.

D.NET is turning out to be much closer to Managed D than D# which I think we can all agree is for the best.


From NG:digitalmars.D/7852:

To all of you out there waiting with bated breath for D.NET, you may now breathe a little easier knowing that the project is finally making some headway.

A few things to note:

  1. Since the .NET CLR supports global variables and functions, it's not necessary to wrap everything in classes ala C#
  2. The import statement has been modified so that if it doesn't find a D module, it looks for assemblies.
  3. The compiler automatically imports mscorlib, and all classes automatically derive from [mscorlib]System.Object

From NG:digitalmars.D/8015:

Since this project is progressing quickly, I've decided that the best way to show updated progress is to actually link to my test file.

I've put in a few comments in describing some of the things that may not be obvious, but most of it should be.

At the end of the file is the output generated by the program.

http://www.scratch-ware.net/D/main.d.txt


From NG:digitalmars.D/8187:

http://www.scratch-ware.net/D/main.html

Here's the code test file that I'm using to test out D.NET. Someone was nice enough to point out that I can make it pretty using SciTE and thus I have done so.


From NG:digitalmars.D/8211:

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.


From NG:digitalmars.D/8364:

I've reached the point in D.NET where I'm playing around with calling native D code from .NET. I'm running into an interesting dilema, as I cannot figure out what D is expecting.


From NG:digitalmars.D/8398:

No problem, just use the extern (C) calling convention in your D code that you want to interface with .NET. No need for wrappers.


From NG:digitalmars.D/9033:

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:

http://dnet.scratch-ware.net/

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


From NG:digitalmars.D/9400:

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.


From NG:digitalmars.D/10398:

Since I don't know how long it'll be before I have a proper beta up and running I've decided to release what I have so far with a very simple caveat:

"This software carries NO guarentees whatsoever, implied or explicit. Use at your own risk."

Check out http://dnet.scratch-ware.net/ for the download.


From NG:digitalmars.D/10577:

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.


From NG:digitalmars.D/10843:

D.NET 0.101.91

Even though it's a relatively minor update, I thought it noteworthy to point out that D.NET's front-end source has been sync'd up to DMD 0.101.


From NG:digitalmars.D/20732:

I apologize for the long period of down-time on my server. As soon as the DNS updates, you should be able to access all of my D project files from:

http://d.scratch-ware.net/

Enjoy!

Deja

(latest version is called D.NET Compiler v0.102.95 Alpha)


Related Discussion    


Related Link    


Comments    

Deja, I was wondering if you could try to compile D.NET with Mono. -- CarlosSantander

... but D.NET is written in C++, right? In that case it wouldn't be possible. -- CarlosSantander


FolderProjects

FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: July 18, 2009 6:00 (diff))