www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Compile without generating code

reply Lewis <musicaljelly gmail.com> writes:
I was reading 
https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, 
which mentioned that the Rust compiler now has a mode to go 
through the motions of compiling and show errors, but without 
generating any code. This way you can do a much faster build 
while iterating until you have no compile errors, then do a 
single build with code generation once everything looks good.

I was wondering what people's thoughts on this was. I haven't 
gone digging through DMD's codebase recently. Is DMD set up in 
such a way that this would be feasible to implement? Does this 
even make sense with the way DMD generates code, or would it only 
work for a language like Rust that does a ton of compile-time 
checking?

DMD already compiles pretty fast, and this strikes me as a useful 
feature to further cement D's competitive edge with respect to 
compilation speed.
Jul 05 2017
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote:
 I was reading 
 https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, 
 which mentioned that the Rust compiler now has a mode to go 
 through the motions of compiling and show errors, but without 
 generating any code. This way you can do a much faster build 
 while iterating until you have no compile errors, then do a 
 single build with code generation once everything looks good.

 [...]
We already have it. use -o- and it'll disable codegen.
Jul 05 2017
next sibling parent Johannes Pfau <nospam example.com> writes:
Am Wed, 05 Jul 2017 22:05:53 +0000
schrieb Stefan Koch <uplink.coder googlemail.com>:

 On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote:
 I was reading 
 https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, 
 which mentioned that the Rust compiler now has a mode to go 
 through the motions of compiling and show errors, but without 
 generating any code. This way you can do a much faster build 
 while iterating until you have no compile errors, then do a 
 single build with code generation once everything looks good.

 [...]  
We already have it. use -o- and it'll disable codegen.
And GDC supports the standard -fsyntax-only GCC flag. -- Johannes
Jul 05 2017
prev sibling next sibling parent Lewis <musicaljelly gmail.com> writes:
On Wednesday, 5 July 2017 at 22:05:53 UTC, Stefan Koch wrote:
 On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote:
 I was reading 
 https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, which
mentioned that the Rust compiler now has a mode to go through the motions of
compiling and show errors, but without generating any code. This way you can do
a much faster build while iterating until you have no compile errors, then do a
single build with code generation once everything looks good.

 [...]
We already have it. use -o- and it'll disable codegen.
Well there you go, D is already ahead of the game. Thanks!
Jul 06 2017
prev sibling parent reply Suliman <evermind live.ru> writes:
On Wednesday, 5 July 2017 at 22:05:53 UTC, Stefan Koch wrote:
 On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote:
 I was reading 
 https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, which
mentioned that the Rust compiler now has a mode to go through the motions of
compiling and show errors, but without generating any code. This way you can do
a much faster build while iterating until you have no compile errors, then do a
single build with code generation once everything looks good.

 [...]
We already have it. use -o- and it'll disable codegen.
How to use this parameter with dub?
Jul 07 2017
next sibling parent bauss <jj_1337 live.dk> writes:
On Friday, 7 July 2017 at 11:14:40 UTC, Suliman wrote:
 On Wednesday, 5 July 2017 at 22:05:53 UTC, Stefan Koch wrote:
 On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote:
 I was reading 
 https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, which
mentioned that the Rust compiler now has a mode to go through the motions of
compiling and show errors, but without generating any code. This way you can do
a much faster build while iterating until you have no compile errors, then do a
single build with code generation once everything looks good.

 [...]
We already have it. use -o- and it'll disable codegen.
How to use this parameter with dub?
"buildOptions" with "syntaxOnly"
Jul 07 2017
prev sibling parent Moritz Maxeiner <moritz ucworks.org> writes:
On Friday, 7 July 2017 at 11:14:40 UTC, Suliman wrote:
 On Wednesday, 5 July 2017 at 22:05:53 UTC, Stefan Koch wrote:
 On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote:
 I was reading 
 https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, which
mentioned that the Rust compiler now has a mode to go through the motions of
compiling and show errors, but without generating any code. This way you can do
a much faster build while iterating until you have no compile errors, then do a
single build with code generation once everything looks good.

 [...]
We already have it. use -o- and it'll disable codegen.
How to use this parameter with dub?
Via `dflags` [1][2] [1] https://code.dlang.org/package-format?lang=json#build-settings [2] https://code.dlang.org/package-format?lang=sdl#build-settings
Jul 07 2017