digitalmars.D - That one last frontend feature to obsolete rebuild
- Gregor Richards (19/19) Mar 12 2008 Believe it or not, I'd really like to obsolete rebuild. I'd love to have...
- Bill Baxter (8/28) Mar 12 2008 Sounds great to me. I was pondering just the other day why Rebuild
- Gregor Richards (7/38) Mar 12 2008 I don't quite agree, because IMHO dying on unrecognized pragmas is a
- Bill Baxter (4/42) Mar 12 2008 I see. I thought they were just ignored currently.
- BCS (3/16) Mar 13 2008 how about a -pragma-print-ignore=foobar that would print out but
- Simen Kjaeraas (16/35) Mar 13 2008 While I agree it's not quite as elegant, couldn't
- Gregor Richards (5/54) Mar 13 2008 This is how I would have done it in the first place if I didn't have the...
Believe it or not, I'd really like to obsolete rebuild. I'd love to have a tiny little script that just reads the output of [g]dmd -v and gets the list of files (and everything else) from that. At this point, I'm very close to being able to accomplish this feat, as the recent(ish) addition of outputting every file that's imported got my 90% of the way there, but there's one problem. rebuild supports nonstandard pragmas, and the compiler chokes on them. I would like to see a flag (-print-unsupported-pragmas or something else obscure, doesn't need to be short or simple) that changed the frontend's default behavior from choking on unrecognized pragmas to printing them out with the verbose output, e.g.: pragma link "(argument to the pragma)" Clearly this wouldn't work for pragmas which wrap declarations, but for simple pragmas it would - and simple pragmas are all I need, and probably all that most frontend-extending tools would need. With this one, comparably simple change, I could scrap rebuild and write a simple script that would be incapable of becoming outdated. Heck, if you'd like, I could even write it and submit a patch :) - Gregor Richards
Mar 12 2008
Gregor Richards wrote:Believe it or not, I'd really like to obsolete rebuild. I'd love to have a tiny little script that just reads the output of [g]dmd -v and gets the list of files (and everything else) from that. At this point, I'm very close to being able to accomplish this feat, as the recent(ish) addition of outputting every file that's imported got my 90% of the way there, but there's one problem. rebuild supports nonstandard pragmas, and the compiler chokes on them. I would like to see a flag (-print-unsupported-pragmas or something else obscure, doesn't need to be short or simple) that changed the frontend's default behavior from choking on unrecognized pragmas to printing them out with the verbose output, e.g.: pragma link "(argument to the pragma)" Clearly this wouldn't work for pragmas which wrap declarations, but for simple pragmas it would - and simple pragmas are all I need, and probably all that most frontend-extending tools would need. With this one, comparably simple change, I could scrap rebuild and write a simple script that would be incapable of becoming outdated. Heck, if you'd like, I could even write it and submit a patch :)Sounds great to me. I was pondering just the other day why Rebuild hasn't switched to using the -v output rather than embedding the entire DMD front end. So pragmas are the only thing, huh? One little thing -- I'd say just enhance -v output all pragmas. No new switch. Tools that don't need them will just ignore them, tools which do can grep for the ones they care about. --bb
Mar 12 2008
Bill Baxter wrote:Gregor Richards wrote:I don't quite agree, because IMHO dying on unrecognized pragmas is a good thing. e.g. I use some GCC property, then compile with DMD, and maybe I have to do something special since that pragma is unsupported. I'd rather have it tell me so I can go "d'oh! Needs version (GNU)" than just silently ignore it. - Gregor RichardsBelieve it or not, I'd really like to obsolete rebuild. I'd love to have a tiny little script that just reads the output of [g]dmd -v and gets the list of files (and everything else) from that. At this point, I'm very close to being able to accomplish this feat, as the recent(ish) addition of outputting every file that's imported got my 90% of the way there, but there's one problem. rebuild supports nonstandard pragmas, and the compiler chokes on them. I would like to see a flag (-print-unsupported-pragmas or something else obscure, doesn't need to be short or simple) that changed the frontend's default behavior from choking on unrecognized pragmas to printing them out with the verbose output, e.g.: pragma link "(argument to the pragma)" Clearly this wouldn't work for pragmas which wrap declarations, but for simple pragmas it would - and simple pragmas are all I need, and probably all that most frontend-extending tools would need. With this one, comparably simple change, I could scrap rebuild and write a simple script that would be incapable of becoming outdated. Heck, if you'd like, I could even write it and submit a patch :)Sounds great to me. I was pondering just the other day why Rebuild hasn't switched to using the -v output rather than embedding the entire DMD front end. So pragmas are the only thing, huh? One little thing -- I'd say just enhance -v output all pragmas. No new switch. Tools that don't need them will just ignore them, tools which do can grep for the ones they care about. --bb
Mar 12 2008
Gregor Richards wrote:Bill Baxter wrote:I see. I thought they were just ignored currently. Now I understand why you require the version(build) around it. --bbGregor Richards wrote:I don't quite agree, because IMHO dying on unrecognized pragmas is a good thing. e.g. I use some GCC property, then compile with DMD, and maybe I have to do something special since that pragma is unsupported. I'd rather have it tell me so I can go "d'oh! Needs version (GNU)" than just silently ignore it.Believe it or not, I'd really like to obsolete rebuild. I'd love to have a tiny little script that just reads the output of [g]dmd -v and gets the list of files (and everything else) from that. At this point, I'm very close to being able to accomplish this feat, as the recent(ish) addition of outputting every file that's imported got my 90% of the way there, but there's one problem. rebuild supports nonstandard pragmas, and the compiler chokes on them. I would like to see a flag (-print-unsupported-pragmas or something else obscure, doesn't need to be short or simple) that changed the frontend's default behavior from choking on unrecognized pragmas to printing them out with the verbose output, e.g.: pragma link "(argument to the pragma)" Clearly this wouldn't work for pragmas which wrap declarations, but for simple pragmas it would - and simple pragmas are all I need, and probably all that most frontend-extending tools would need. With this one, comparably simple change, I could scrap rebuild and write a simple script that would be incapable of becoming outdated. Heck, if you'd like, I could even write it and submit a patch :)Sounds great to me. I was pondering just the other day why Rebuild hasn't switched to using the -v output rather than embedding the entire DMD front end. So pragmas are the only thing, huh? One little thing -- I'd say just enhance -v output all pragmas. No new switch. Tools that don't need them will just ignore them, tools which do can grep for the ones they care about. --bb
Mar 12 2008
Bill Baxter wrote:Gregor Richards wrote:how about a -pragma-print-ignore=foobar that would print out but otherwise ignore pragma(foobar, ...)I don't quite agree, because IMHO dying on unrecognized pragmas is a good thing. e.g. I use some GCC property, then compile with DMD, and maybe I have to do something special since that pragma is unsupported. I'd rather have it tell me so I can go "d'oh! Needs version (GNU)" than just silently ignore it.I see. I thought they were just ignored currently. Now I understand why you require the version(build) around it. --bb
Mar 13 2008
On Wed, 12 Mar 2008 20:51:39 +0100, Gregor Richards <Richards codu.org> wrote:Believe it or not, I'd really like to obsolete rebuild. I'd love to have a tiny little script that just reads the output of [g]dmd -v and gets the list of files (and everything else) from that. At this point, I'm very close to being able to accomplish this feat, as the recent(ish) addition of outputting every file that's imported got my 90% of the way there, but there's one problem. rebuild supports nonstandard pragmas, and the compiler chokes on them. I would like to see a flag (-print-unsupported-pragmas or something else obscure, doesn't need to be short or simple) that changed the frontend's default behavior from choking on unrecognized pragmas to printing them out with the verbose output, e.g.: pragma link "(argument to the pragma)" Clearly this wouldn't work for pragmas which wrap declarations, but for simple pragmas it would - and simple pragmas are all I need, and probably all that most frontend-extending tools would need. With this one, comparably simple change, I could scrap rebuild and write a simple script that would be incapable of becoming outdated. Heck, if you'd like, I could even write it and submit a patch :) - Gregor RichardsWhile I agree it's not quite as elegant, couldn't pragma(msg, "rebuild link\t\"argument\""); do what you want? To make it prettier (and ensure that things are formatted correctly) you could even create a function like this: string rebuildPragma(string type, string argument) { return "rebuild " ~ type ~ "\t\"" ~ argument ~ "\""; } and used like this: pragma(msg, rebuildPragma("link", "argument")); Such a function would require another import, of course. Are there any other problems with such an approach? --Simen
Mar 13 2008
Simen Kjaeraas wrote:On Wed, 12 Mar 2008 20:51:39 +0100, Gregor Richards <Richards codu.org> wrote:This is how I would have done it in the first place if I didn't have the legacy of bud compatibility. However, to maintain backwards compatibility, I can't use this method. - Gregor RichardsBelieve it or not, I'd really like to obsolete rebuild. I'd love to have a tiny little script that just reads the output of [g]dmd -v and gets the list of files (and everything else) from that. At this point, I'm very close to being able to accomplish this feat, as the recent(ish) addition of outputting every file that's imported got my 90% of the way there, but there's one problem. rebuild supports nonstandard pragmas, and the compiler chokes on them. I would like to see a flag (-print-unsupported-pragmas or something else obscure, doesn't need to be short or simple) that changed the frontend's default behavior from choking on unrecognized pragmas to printing them out with the verbose output, e.g.: pragma link "(argument to the pragma)" Clearly this wouldn't work for pragmas which wrap declarations, but for simple pragmas it would - and simple pragmas are all I need, and probably all that most frontend-extending tools would need. With this one, comparably simple change, I could scrap rebuild and write a simple script that would be incapable of becoming outdated. Heck, if you'd like, I could even write it and submit a patch :) - Gregor RichardsWhile I agree it's not quite as elegant, couldn't pragma(msg, "rebuild link\t\"argument\""); do what you want? To make it prettier (and ensure that things are formatted correctly) you could even create a function like this: string rebuildPragma(string type, string argument) { return "rebuild " ~ type ~ "\t\"" ~ argument ~ "\""; } and used like this: pragma(msg, rebuildPragma("link", "argument")); Such a function would require another import, of course. Are there any other problems with such an approach? --Simen
Mar 13 2008