D to Javascript converter (a hacked up dmd)

Adam D. Ruppe destructionator at gmail.com
Thu Mar 1 11:13:50 PST 2012


On Thursday, 1 March 2012 at 17:35:02 UTC, Andrei Alexandrescu 
wrote:
> The motivation sounds great. I think one area of focus going 
> forward might be defining precisely the subset of D supported 
> (e.g. I suppose pointer semantics would be difficult).

Right. I'm not sure exactly what is and is not @safe myself,
but I think *most* of it is realistic.

goto and pointers are the questionable ones right now. They
are solvable, but are they solvable in a way that I'm willing
to do? I don't want a while() { switch() { } } thing; the
code should look like javascript, not assembly.

Some integer semantics might be hard too. ubyte is ok, but byte
is different because 127+1 isn't as simple as x & 0xff

I'll have to think about that. Again, it surely *can*
be done, but I'd rather than an error than it generating
horribly inefficient javascript for simple operations.


But, everything else I've considered either already works
or is solvable with a little more time. It helps a lot
that dmd lowers a lot of the fancier things into simple
C-like constructs for me.


I just got scope guards working a few minutes ago, so
destructors can't be far behind.... then some bugs
on struct, and int math, goto, and pointer are the only
big rough spots left.


At least that I've thought of so far!


More information about the Digitalmars-d-announce mailing list