On Tuesday, 27 January 2015 at 03:54:09 UTC, Zach the Mystic wrote:
On Tuesday, 27 January 2015 at 03:33:15 UTC, Jonathan Marler wrote:
This has come up before. I believe if was at DConf 2014 that Walter answered this question. If I remember, the gist was that Walter didn't like the idea that the compiler could rewrite a user's code, he seemed kinda "creeped" out to think that a compiler would do this. Then someone suggested the compiler could generate some type of awk expression that the programmer could run to modify the code. Anyway, just relaying what I remember.

It's only creepy if it doesn't work. And the compiler doesn't need to change the code itself - it merely needs to tell you exactly what to do to fix it.

I've thought about this some more. The way I would do it is have the compiler store all files which need to be fixed. Output the list in another file of a different type. Have dfix be able to read that file and automatically fix all files listed. Or just generate a D script to do just that (no need for a whole different file format. Literally just output "dfix.d", which has all the filenames built right into the script, and tell the user to 'dmd -run dfix.d'. Now you have a very clear intermediate step between compilation and user-activated step.

Not a bad idea.  Maybe this will be less "creepy" to others :)

+1 (what do others think?)

Reply via email to