Compiler concept

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 12 19:38:57 PST 2016


On 13/12/2016 2:57 PM, Adam D. Ruppe wrote:
> On Tuesday, 13 December 2016 at 01:03:54 UTC, Ignacious wrote:
>> Would it be difficult to implement the following, or something with
>> similar capabilities, as a patch to dmd?
>
> It would be pretty hard to do with dmd because compiled code isn't
> designed for modification, but it wouldn't be too hard to do with an
> interpreter, which uses a tree of nodes already anyway. Dynamic (and JIT
> VM based) languages often use this kind of thing internally for
> optimizations and sometimes for self-modifying code.

As CTFE has proven, its do-able but we would be talking at least 6-9 
months worth of work.
With no way its going into upstream.

Not to mention we'd need a whole host of AST nodes in druntime.
So really not worth the effort.


More information about the Digitalmars-d mailing list