digitalmars.D - Make rt.util.utf publicly available
- Eduard Staniloiu (13/13) Dec 03 2018 Hello, everyone.
- bauss (7/20) Dec 03 2018 I think the reason behind the duplications is that the runtime
- John Colvin (3/11) Dec 03 2018 Phobos definitely depends on druntime, druntime definitely
- Eduard Staniloiu (2/15) Dec 05 2018 This is also my reasoning on the matter.
- Jonathan M Davis (17/28) Dec 03 2018 At the moment, I can't remember the exact reasoning behind why the rt st...
- Eduard Staniloiu (8/25) Dec 05 2018 Thanks.
- Jacob Carlborg (5/7) Dec 10 2018 The "rt" package is for internal usage by the compiler or druntime.
Hello, everyone. I've been looking over Phobos' `std.utf` and druntime's `rt.util.utf` as there is some code duplication and I would like to start removing that. I want to be able to import some of the existing druntime functionality in Phobos, so we can remove the duplication: ex. isValidDchar, toUTF*, etc. I'm not able to do so, since, as far as I can tell, the `rt` is private: it's not part of the `druntime/import/` folder. Could you please tell me what's the reasoning behind this decision and what would be the course of action going forward? Thank you, Edi
Dec 03 2018
On Monday, 3 December 2018 at 10:40:03 UTC, Eduard Staniloiu wrote:Hello, everyone. I've been looking over Phobos' `std.utf` and druntime's `rt.util.utf` as there is some code duplication and I would like to start removing that. I want to be able to import some of the existing druntime functionality in Phobos, so we can remove the duplication: ex. isValidDchar, toUTF*, etc. I'm not able to do so, since, as far as I can tell, the `rt` is private: it's not part of the `druntime/import/` folder. Could you please tell me what's the reasoning behind this decision and what would be the course of action going forward? Thank you, EdiI think the reason behind the duplications is that the runtime shouldn't be dependent on Phobos and Phobos shouldn't be dependent on the runtime. At least if I remember correctly about other duplications existing.
Dec 03 2018
On Monday, 3 December 2018 at 10:50:07 UTC, bauss wrote:On Monday, 3 December 2018 at 10:40:03 UTC, Eduard Staniloiu wrote:Phobos definitely depends on druntime, druntime definitely doesn't depend on Phobos[...]I think the reason behind the duplications is that the runtime shouldn't be dependent on Phobos and Phobos shouldn't be dependent on the runtime. At least if I remember correctly about other duplications existing.
Dec 03 2018
On Monday, 3 December 2018 at 12:56:01 UTC, John Colvin wrote:On Monday, 3 December 2018 at 10:50:07 UTC, bauss wrote:This is also my reasoning on the matter.On Monday, 3 December 2018 at 10:40:03 UTC, Eduard Staniloiu wrote:Phobos definitely depends on druntime, druntime definitely doesn't depend on Phobos[...]I think the reason behind the duplications is that the runtime shouldn't be dependent on Phobos and Phobos shouldn't be dependent on the runtime. At least if I remember correctly about other duplications existing.
Dec 05 2018
On Monday, December 3, 2018 3:40:03 AM MST Eduard Staniloiu via Digitalmars- d wrote:Hello, everyone. I've been looking over Phobos' `std.utf` and druntime's `rt.util.utf` as there is some code duplication and I would like to start removing that. I want to be able to import some of the existing druntime functionality in Phobos, so we can remove the duplication: ex. isValidDchar, toUTF*, etc. I'm not able to do so, since, as far as I can tell, the `rt` is private: it's not part of the `druntime/import/` folder. Could you please tell me what's the reasoning behind this decision and what would be the course of action going forward?At the moment, I can't remember the exact reasoning behind why the rt stuff is separate, but if you want to consolidate its utf stuff so that Phobos can import it, then just move it into core.internal.utf and have the rt stuff import it. That being said, this is not a simple case of druntime copying Phobos or vice versa like it was with some traits. I don't know how close the internals are in terms of the resultant logic when operating on arrays, but std.utf's version of things is very much generic, operating on ranges, not arrays specifically, and it uses some stuff from Phobos (especially in its tests), making consolidating the code far less straightforward. So, while I don't disagree that consolidating that code so that druntime and Phobos are guaranteed to use the same logic for arrays is desirable, you're going to need to be very careful about how you go about it if you want to make Phobos depend on druntime in this case. - Jonathan M Davis
Dec 03 2018
On Monday, 3 December 2018 at 17:02:30 UTC, Jonathan M Davis wrote:At the moment, I can't remember the exact reasoning behind why the rt stuff is separate, but if you want to consolidate its utf stuff so that Phobos can import it, then just move it into core.internal.utf and have the rt stuff import it. That being said, this is not a simple case of druntime copying Phobos or vice versa like it was with some traits. I don't know how close the internals are in terms of the resultant logic when operating on arrays, but std.utf's version of things is very much generic, operating on ranges, not arrays specifically, and it uses some stuff from Phobos (especially in its tests), making consolidating the code far less straightforward. So, while I don't disagree that consolidating that code so that druntime and Phobos are guaranteed to use the same logic for arrays is desirable, you're going to need to be very careful about how you go about it if you want to make Phobos depend on druntime in this case. - Jonathan M DavisThanks. I'll take this course of action. The plan is to have Phobos import the common sub-set of functionality, that is present in druntime. Cheers, Edi
Dec 05 2018
On 2018-12-03 11:40, Eduard Staniloiu wrote:Could you please tell me what's the reasoning behind this decision and what would be the course of action going forward?The "rt" package is for internal usage by the compiler or druntime. "core" is for external users. -- /Jacob Carlborg
Dec 10 2018