Am Mon, 15 Jul 2019 12:40:50 +0000 schrieb Vladimir Panteleev:

> On Monday, 15 July 2019 at 12:36:14 UTC, Mike Franklin wrote:
>> Many of the implementations in `rt/array` are templates, so the entire
>> implementation should be available through object.d, not just
>> declarations.
> 
> The amount of templated code is still finite, otherwise you would have
> needed to include all of rt into the set of files to be made importable.

Which is due to the limited time available in GSoC. Right now, the 
implementations simply call typeid and forward to the TypeInfo based 
implementations. But all of these implementations are ultimately meant to 
be fully templated, and then you'll need access to lots of rt functions.

So why should we we now move the functions to core, so that we can later 
move them back to rt?

> 
>> In `core.internal`, I see utilities that appear to be intended for use
>> only within runtime, or "privately" imported by Phobos.
>>  I do not see implementations for fundamental language features
>> as can be found in `rt`.  The code in `rt/array` implementations for
>> fundamental language features, not utilities to be used privately with
>> druntime.
> 
> Please have a closer look:
> 
> - core.internal.hash contains the implementation of hashing routines
> used for associative arrays.
> - core.internal.arrayop contains the implementation of array vector
> operations. This one doesn't seem to be too far from your work in
> question.
> 

Both don't have any real dependencies. Maybe all the array implementation 
stuff could be moved to core, but until that happens moving only parts of 
the implementation seems to be a bad idea. Especially considering this:

>> "rt can import core, but core can't import rt." makes it pretty clear
>> to me.


It's probably a mistake that we even have both rt and core.internal. 
core.internal seems to be a much more recent addition (2013), probably 
inspired by std.internal. It's no wonder there's duplication and no 
clearly defined scope for the packages.

And why would anyone think it's a good idea not to install the rt 
headers? What do you gain from this, except from a few KB saved disk 
space?

-- 
Johannes

Reply via email to