D to Javascript converter (a hacked up dmd)

Daniel Murphy yebblies at nospamgmail.com
Mon Feb 27 19:06:09 PST 2012


"Adam D. Ruppe" <destructionator at gmail.com> wrote in message 
news:cjalubgkkdpdacsigxic at forum.dlang.org...
> On Monday, 27 February 2012 at 11:32:52 UTC, Daniel Murphy wrote:
>> How come you didn't do this as a proper fork/branch of dmd?
>
> At first, I downloaded a zip of your fork just to take a
> look at it - I had no intention of actually modifying it.
>
> But, then I started to play around and never cleaned
> stuff up.
>
> /home/me/d/toys/yebblies-dmd-7723455/src
>
> That's the name of the directory where it lives on
> my computer :)
>
>
> I pushed it up to github last night right before
> making the ng post as a last-minute decision, figuring
> github would make it easier for people to look at.
>
>
> Redoing it as a proper fork won't be that hard; most the
> changes are in the one microd.c file anyway. Maybe I
> will next weekend.
>

Cool, please do.

>> It's also not too hard to strip out the backend if you want to 
>> redistribute
>> the binary.  (stub out e2ir,s2ir,glue,toobj,iasm and remove the backend 
>> specific stuff from main)
>
> Cool. I took a quick look at doing that but just horribly
> broke my build.
>
> Isn't parts of ctfe implemented in glue.c though? I don't
> see it obviously in there, but I thought I saw something
> about that once.

It really shouldn't be.
The big things I'm aware of that are in the wrong place in the compiler are 
that overrides are verified when building the vtables in the glue layer, 
finding 'this' inside functions is done in the glue, and a couple of things 
are done too early (array ops, associative array re-writes).

You can pretty much just delete, e2ir, s2ir, and a couple of others, then 
kill everything that calls them up until main. (warning - requires reading 
linker speak)  The main reason I left the glue layer intact in my branch is 
because I was constantly referring to them for the more complex parts of 
microD.

I had a branch somewhere where I did this, but I don't think it survived. 




More information about the Digitalmars-d-announce mailing list