digitalmars.D.learn - Write file at compile time?
- Inquie (3/3) Apr 02 2017 I would like to write the output of a manifest constant at
- Basile B. (2/5) Apr 02 2017 No.
- Meta (2/5) Apr 03 2017 D does not allow IO at compile time for security reasons.
- Inquie (3/8) Apr 03 2017 what if I don't care about security reasons? I'm only needing it
- Stefan Koch (5/14) Apr 03 2017 there is --vcg-ast.
- Stefan Koch (3/18) Apr 03 2017 sorry -vcg-ast.
- Adam D. Ruppe (4/6) Apr 03 2017 Why does it have to be at compile time then? Just run an ordinary
- Inquie (22/28) Apr 03 2017 Because it the code doesn't compile one has to copy and paste the
- Stefan Koch (3/13) Apr 04 2017 If you're fine with a custom dmd build, please open an issue on
I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?
Apr 02 2017
On Sunday, 2 April 2017 at 19:42:52 UTC, Inquie wrote:I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?No.
Apr 02 2017
On Sunday, 2 April 2017 at 19:42:52 UTC, Inquie wrote:I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?D does not allow IO at compile time for security reasons.
Apr 03 2017
On Monday, 3 April 2017 at 19:06:01 UTC, Meta wrote:On Sunday, 2 April 2017 at 19:42:52 UTC, Inquie wrote:what if I don't care about security reasons? I'm only needing it for developmental purposes.I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?D does not allow IO at compile time for security reasons.
Apr 03 2017
On Monday, 3 April 2017 at 19:25:35 UTC, Inquie wrote:On Monday, 3 April 2017 at 19:06:01 UTC, Meta wrote:there is --vcg-ast. In the ~master version of dmd. it gives you everything lowered and expanded. given your code compiles.On Sunday, 2 April 2017 at 19:42:52 UTC, Inquie wrote:what if I don't care about security reasons? I'm only needing it for developmental purposes.I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?D does not allow IO at compile time for security reasons.
Apr 03 2017
On Monday, 3 April 2017 at 19:32:40 UTC, Stefan Koch wrote:On Monday, 3 April 2017 at 19:25:35 UTC, Inquie wrote:sorry -vcg-ast. use it and look for {yourfilename}.cgOn Monday, 3 April 2017 at 19:06:01 UTC, Meta wrote:there is --vcg-ast. In the ~master version of dmd. it gives you everything lowered and expanded. given your code compiles.On Sunday, 2 April 2017 at 19:42:52 UTC, Inquie wrote:what if I don't care about security reasons? I'm only needing it for developmental purposes.I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?D does not allow IO at compile time for security reasons.
Apr 03 2017
On Monday, 3 April 2017 at 19:25:35 UTC, Inquie wrote:what if I don't care about security reasons? I'm only needing it for developmental purposes.Why does it have to be at compile time then? Just run an ordinary runtime program as part of your develop process; run a helper file in your makefile before compiling it.
Apr 03 2017
On Monday, 3 April 2017 at 19:34:36 UTC, Adam D. Ruppe wrote:On Monday, 3 April 2017 at 19:25:35 UTC, Inquie wrote:Because it the code doesn't compile one has to copy and paste the pragma output to a d file and compile it to find the errors. It is useful to help debug mixins. Since D is pretty sorry at giving useful information for mixins it is easier to write the mixins out to disk in a d file then input them back in to the program. A simple static switch can alternate between the two. If we could output at compile time then we could 1. compile 2. flip switch 3. compile and get useful error messages rather than 1. compile 2. copy pragma to do 3. flip switch 4. compile and get useful error messages the pragma copy is, by far, the slowest step here and the others can be automated to basically happen in one step(although, I guess with some work one could automate the copying of the pragma too but it is not as robust). Would be much easier to simply have the ability to write to disk instead of the console.what if I don't care about security reasons? I'm only needing it for developmental purposes.Why does it have to be at compile time then? Just run an ordinary runtime program as part of your develop process; run a helper file in your makefile before compiling it.
Apr 03 2017
On Monday, 3 April 2017 at 21:20:41 UTC, Inquie wrote:On Monday, 3 April 2017 at 19:34:36 UTC, Adam D. Ruppe wrote:If you're fine with a custom dmd build, please open an issue on my dmd repo.[...]Because it the code doesn't compile one has to copy and paste the pragma output to a d file and compile it to find the errors. It is useful to help debug mixins. Since D is pretty sorry at giving useful information for mixins it is easier to write the mixins out to disk in a d file then input them back in to the program. A simple static switch can alternate between the two. If we could output at compile time then we could [...]
Apr 04 2017