digitalmars.D - BetterC and CTFE mismatch
- Sebastiaan Koppe (6/6) Sep 26 2018 Right now I am building a betterC application and I would have
- Simen =?UTF-8?B?S2rDpnLDpXM=?= (8/14) Sep 26 2018 This is essentially an arbitrary restriction. The basic reason is
- Sebastiaan Koppe (6/12) Sep 26 2018 So anything I do at CTFE has to be betterC as well? That is a
- learnfirst1 (4/17) Sep 26 2018 You can call Non-BetterC function from import path. (not from the
- Steven Schveighoffer (8/21) Sep 26 2018 This is an artificial, and not really intended, limitation. Essentially,...
- Nicholas Wilson (5/18) Sep 26 2018 https://issues.dlang.org/show_bug.cgi?id=18472 is an open
- Sebastiaan Koppe (4/6) Sep 26 2018 I found https://issues.dlang.org/show_bug.cgi?id=19268 and I have
Right now I am building a betterC application and I would have expected to be able to use the D standard library in CTFE. It seems this is not the case. Can anyone explain why? It seems to be an arbitrary limitation. example: https://run.dlang.io/gist/8ee9456bfae061eba81c931999183e49?args=-betterC
Sep 26 2018
On Wednesday, 26 September 2018 at 08:06:27 UTC, Sebastiaan Koppe wrote:Right now I am building a betterC application and I would have expected to be able to use the D standard library in CTFE. It seems this is not the case. Can anyone explain why? It seems to be an arbitrary limitation. example: https://run.dlang.io/gist/8ee9456bfae061eba81c931999183e49?args=-betterCThis is essentially an arbitrary restriction. The basic reason is if a function is compiled (even just for CTFE), it ends up in the object files, and you've asked for only betterC functions to end up in the object files. -- Simen
Sep 26 2018
On Wednesday, 26 September 2018 at 08:22:26 UTC, Simen Kjærås wrote:This is essentially an arbitrary restriction. The basic reason is if a function is compiled (even just for CTFE), it ends up in the object files, and you've asked for only betterC functions to end up in the object files. -- SimenSo anything I do at CTFE has to be betterC as well? That is a bummer. I'll try to workaround this, but I would like to see this fixed. Is there anything I can do to move this forward?
Sep 26 2018
On Wednesday, 26 September 2018 at 09:08:06 UTC, Sebastiaan Koppe wrote:On Wednesday, 26 September 2018 at 08:22:26 UTC, Simen Kjærås wrote:You can call Non-BetterC function from import path. (not from the source code, but in the import path).This is essentially an arbitrary restriction. The basic reason is if a function is compiled (even just for CTFE), it ends up in the object files, and you've asked for only betterC functions to end up in the object files. -- SimenSo anything I do at CTFE has to be betterC as well? That is a bummer. I'll try to workaround this, but I would like to see this fixed. Is there anything I can do to move this forward?
Sep 26 2018
On 9/26/18 5:08 AM, Sebastiaan Koppe wrote:On Wednesday, 26 September 2018 at 08:22:26 UTC, Simen Kjærås wrote:This is an artificial, and not really intended, limitation. Essentially, CTFE has to be a real function. If it's defined, it's expected to be callable from runtime as well as CTFE. But I can't see why, if you don't call from runtime, it should matter. I think this has to do with the places betterC is enforced in the compiler.This is essentially an arbitrary restriction. The basic reason is if a function is compiled (even just for CTFE), it ends up in the object files, and you've asked for only betterC functions to end up in the object files. -- SimenSo anything I do at CTFE has to be betterC as well? That is a bummer.I'll try to workaround this, but I would like to see this fixed. Is there anything I can do to move this forward?I'd suggest a bug report if one hasn't been made. -Steve
Sep 26 2018
On Wednesday, 26 September 2018 at 12:51:57 UTC, Steven Schveighoffer wrote:https://issues.dlang.org/show_bug.cgi?id=18472 is an open regression on 2.078. Doesn't cover all use cases of what Sebastiaan might want though.So anything I do at CTFE has to be betterC as well? That is a bummer.This is an artificial, and not really intended, limitation. Essentially, CTFE has to be a real function. If it's defined, it's expected to be callable from runtime as well as CTFE. But I can't see why, if you don't call from runtime, it should matter. I think this has to do with the places betterC is enforced in the compiler.I'll try to workaround this, but I would like to see this fixed. Is there anything I can do to move this forward?I'd suggest a bug report if one hasn't been made. -Steve
Sep 26 2018
On Wednesday, 26 September 2018 at 12:51:57 UTC, Steven Schveighoffer wrote:I'd suggest a bug report if one hasn't been made. -SteveI found https://issues.dlang.org/show_bug.cgi?id=19268 and I have appended my case there.
Sep 26 2018