Who can make Phobos faster to import?

Joakim dlang at joakim.fea.st
Tue Dec 26 15:38:14 UTC 2017


On Tuesday, 26 December 2017 at 13:27:38 UTC, RazvanN wrote:
> On Thursday, 21 December 2017 at 03:31:16 UTC, Joakim wrote:
>> On Wednesday, 20 December 2017 at 18:21:33 UTC, Andrei 
>> Alexandrescu wrote:
>>> A tool (call it depend - heh) to automate that would be 
>>> awesome. For example, this run would make all imported names 
>>> explicit:
>>>
>>> depend --explicit *.d
>>>
>>> This run would push all imports down to the innermost scope 
>>> of usage:
>>>
>>> depend --pushdown *.d
>>>
>>>
>>> Andrei
>>
>> I'm on it.  I tried using a version of Seb's frontend library 
>> yesterday but with the standard dmd main and tried running it 
>> on std.stdio, but it asserted in asmSemantic because of an asm 
>> block somewhere in druntime, so I'm back to using a tweaked 
>> full dmd with the backend simply disabled again:
>
> I ran into the same issue. The problem was that currently the 
> frontend
> doesn't set the version identifiers. There's a PR which tries 
> to fix it [1],
> but if you want to go back at using the compiler library via 
> Seb's interface
> you just have to call this method [2] in the initialization 
> step.

I doubt that's it, as I noted I was running the standard dmd main 
from mars.d.  More likely it tries to run asmSemantic on an asm 
block in core.atomic and asserts because that function's stubbed 
out when there's no backend.

> Anyway I am working on this sort of tool also, so maybe we can 
> unite our efforts.

As in the `depend` import-scoping tool that Andrei wanted above?  
If so, that'd be great, as you know the frontend much better than 
me.  I've been meaning to investigate how to extract a scope tree 
from the frontend, as I've never done much with dmd.

Let me know how far you've gotten and what you want it to do 
initially, and maybe I can pitch in with your effort.


More information about the Digitalmars-d mailing list