digitalmars.D - List of DMD dependency issue (which would be sloved by a task based
- Stefan Koch (21/21) Nov 22 2020 Hi Folks,
- Tim (6/12) Nov 22 2020 Here are some issues:
- Dennis (7/10) Nov 22 2020 Here's one:
- Stefan Koch (30/40) Nov 30 2020 Thanks for this example.
- Mr T. (21/21) Dec 03 2020 Here's one *not* depending on declaration order, an ambiguity bug:
- Stefan Koch (5/27) Dec 04 2020 This is a very interesting one.
- Stefan Koch (9/31) Dec 04 2020 SDC does detect the ambiguity.
- Timon Gehr (16/47) Dec 04 2020 So does my frontend (https://github.com/tgehr/d-compiler):
- user1234 (3/5) Dec 04 2020 why the hell have you not setup a CI with a daily automatic run.
- user1234 (2/7) Dec 04 2020 aka CRON
- Stefan Koch (7/36) Dec 04 2020 Unfortunately I was reading the output wrongly ...
Hi Folks, I'd like to have a list of dependency issues that dmd has which are caused by the ad-hoc dependency system used for semantic dependencies in dmd. And would be resolved by a system which schedules and pends resolve passes (a task or fiber based compilation as SDC uses) A nice example is: --- struct Foo { my_type index; } static if(true) { alias my_type = int; } --- from https://issues.dlang.org/show_bug.cgi?id=20905 Then there is: https://issues.dlang.org/show_bug.cgi?id=21380 Or the mind boggling: https://issues.dlang.org/show_bug.cgi?id=20443 I am sure we can find more crawling bugzilla
Nov 22 2020
On Sunday, 22 November 2020 at 13:57:39 UTC, Stefan Koch wrote:Hi Folks, I'd like to have a list of dependency issues that dmd has which are caused by the ad-hoc dependency system used for semantic dependencies in dmd. And would be resolved by a system which schedules and pends resolve passes (a task or fiber based compilation as SDC uses)Here are some issues: https://issues.dlang.org/show_bug.cgi?id=3743 https://issues.dlang.org/show_bug.cgi?id=16665 https://issues.dlang.org/show_bug.cgi?id=17883 https://issues.dlang.org/show_bug.cgi?id=19047
Nov 22 2020
On Sunday, 22 November 2020 at 13:57:39 UTC, Stefan Koch wrote:I'd like to have a list of dependency issues that dmd has which are caused by the ad-hoc dependency system used for semantic dependencies in dmd.Here's one: ``` immutable int a = b; mixin("immutable int b = 3;"); ``` https://issues.dlang.org/show_bug.cgi?id=9125
Nov 22 2020
On Sunday, 22 November 2020 at 15:08:30 UTC, Dennis wrote:On Sunday, 22 November 2020 at 13:57:39 UTC, Stefan Koch wrote:Thanks for this example. I crafted a slightly more complicated version --- import core.stdc.stdio; struct Foo { t x; } mixin("static if (true) { alias t = type; }"); mixin("alias type = short;"); void main() { printf("%d == 2\n".ptr, Foo.init.x.sizeof); } --- DMD will fail on this. Whereas SDC (https://github.com/sdc-developers/SDC) does compile it and outputs the string `2 == 2` it should be noted that SDC currently fails at the even more complicated: --- import core.stdc.stdio; struct Foo { t x; } static immutable TRUE = mixin("true"); static if (TRUE) mixin("alias type = short;"); mixin("static if (true) { alias t = type; }"); void main() { printf("%d == 2\n".ptr, Foo.init.x.sizeof); } ---I'd like to have a list of dependency issues that dmd has which are caused by the ad-hoc dependency system used for semantic dependencies in dmd.Here's one: ``` immutable int a = b; mixin("immutable int b = 3;"); ``` https://issues.dlang.org/show_bug.cgi?id=9125
Nov 30 2020
Here's one *not* depending on declaration order, an ambiguity bug: ---------------------------------- // main.d import ma; import mb; immutable X = Y; // no error! int main() { return 0; // return Y; // error: ma.Y conflicts with mb.Y } ---------------------------------- module ma; enum Y = 48; ---------------------------------- module mb; import main; //static if (true) // main.d: error on X: ma.Y conflicts with mb.Y static if (X == 48) // no error! enum Y = 64; ----------------------------------
Dec 03 2020
On Friday, 4 December 2020 at 07:20:38 UTC, Mr T. wrote:Here's one *not* depending on declaration order, an ambiguity bug: ---------------------------------- // main.d import ma; import mb; immutable X = Y; // no error! int main() { return 0; // return Y; // error: ma.Y conflicts with mb.Y } ---------------------------------- module ma; enum Y = 48; ---------------------------------- module mb; import main; //static if (true) // main.d: error on X: ma.Y conflicts with mb.Y static if (X == 48) // no error! enum Y = 64; ----------------------------------This is a very interesting one. I think that task-based on demand resolution could help in fixing this bug as well. Thanks for sharing.
Dec 04 2020
On Friday, 4 December 2020 at 07:20:38 UTC, Mr T. wrote:Here's one *not* depending on declaration order, an ambiguity bug: ---------------------------------- // main.d import ma; import mb; immutable X = Y; // no error! int main() { return 0; // return Y; // error: ma.Y conflicts with mb.Y } ---------------------------------- module ma; enum Y = 48; ---------------------------------- module mb; import main; //static if (true) // main.d: error on X: ma.Y conflicts with mb.Y static if (X == 48) // no error! enum Y = 64; ----------------------------------SDC does detect the ambiguity. uplink uplink-black:~/ambig$ ../d/SDC/bin/sdc main.d main.d:4:0: error: Already defined int main() { return 0; // return Even though the error message isn't great. I should probably fix it ;)
Dec 04 2020
On 04.12.20 09:38, Stefan Koch wrote:On Friday, 4 December 2020 at 07:20:38 UTC, Mr T. wrote:So does my frontend (https://github.com/tgehr/d-compiler): --- mb.d:5:10: error: declaration of 'Y' is invalid enum Y = 64; ^ main.d:4:15: note: this lookup should have resolved to it otherwise immutable X = Y; // no error! ^ --- Of course, it does not compile with versions of DMD newer than 2.060 due to, ironically, dependency issues. (Rainer once found a fix for the problem, but it caused some regressions.) There are various test cases here (many are for things other than dependency issues, but IIRC DMD chokes on quite a few of those too): https://github.com/tgehr/d-compiler/tree/master/testHere's one *not* depending on declaration order, an ambiguity bug: ---------------------------------- // main.d import ma; import mb; immutable X = Y; // no error! int main() { return 0; // return Y; // error: ma.Y conflicts with mb.Y } ---------------------------------- module ma; enum Y = 48; ---------------------------------- module mb; import main; //static if (true) // main.d: error on X: ma.Y conflicts with mb.Y static if (X == 48) // no error! enum Y = 64; ----------------------------------SDC does detect the ambiguity. uplink uplink-black:~/ambig$ ../d/SDC/bin/sdc main.d main.d:4:0: error: Already defined int main() { return 0; // return ...
Dec 04 2020
On Friday, 4 December 2020 at 10:05:57 UTC, Timon Gehr wrote:Of course, it does not compile with versions of DMD newer than 2.060 due to,why the hell have you not setup a CI with a daily automatic run. Your FE would be still alive today.
Dec 04 2020
On Friday, 4 December 2020 at 10:34:18 UTC, user1234 wrote:On Friday, 4 December 2020 at 10:05:57 UTC, Timon Gehr wrote:aka CRONOf course, it does not compile with versions of DMD newer than 2.060 due to,why the hell have you not setup a CI with a daily automatic run. Your FE would be still alive today.
Dec 04 2020
On Friday, 4 December 2020 at 10:05:57 UTC, Timon Gehr wrote:On 04.12.20 09:38, Stefan Koch wrote:Unfortunately I was reading the output wrongly ... SDC rejected the main function itself because the name was clashing with the module name `main` :-/ Your front-end is more strict on this than SDC or DMD are. Thanks for sharing your testcases. I'll have a look as soon as I can dedicate some appropriate time.On Friday, 4 December 2020 at 07:20:38 UTC, Mr T. wrote:So does my frontend (https://github.com/tgehr/d-compiler): --- mb.d:5:10: error: declaration of 'Y' is invalid enum Y = 64; ^ main.d:4:15: note: this lookup should have resolved to it otherwise immutable X = Y; // no error! ^ --- Of course, it does not compile with versions of DMD newer than 2.060 due to, ironically, dependency issues. (Rainer once found a fix for the problem, but it caused some regressions.) There are various test cases here (many are for things other than dependency issues, but IIRC DMD chokes on quite a few of those too): https://github.com/tgehr/d-compiler/tree/master/test[...]SDC does detect the ambiguity. uplink uplink-black:~/ambig$ ../d/SDC/bin/sdc main.d main.d:4:0: error: Already defined int main() { return 0; // return ...
Dec 04 2020