D - Downside of the absence of headers
- Mik Mifflin (9/9) Feb 21 2004 Many programmers loathe to document their code. When looking at
- SpookyET (8/17) Feb 21 2004 In .net is even better, assemblies (.exe, .dll) have metadata about the ...
- Mik Mifflin (4/26) Feb 21 2004 I thought we just went over this... D is not .net
-
Ben Hinkle
(18/18)
Feb 21 2004
"Mik Mifflin"
wrote in message - Walter (16/33) Feb 21 2004 a
- Matthew (8/44) Feb 21 2004 is
- Mik Mifflin (8/16) Feb 21 2004 Sorry, I should have made myself more clear. I was looking for a progra...
- J C Calvarese (22/39) Feb 22 2004 I'm not sure that someone has written quite what you're looking for, but...
-
Walter
(3/6)
Feb 22 2004
Some have argued that I don't need to try
. - J C Calvarese (7/15) Feb 22 2004 LOL!
- C (15/32) Feb 22 2004 You can use dtags , it comes with DIDE but its standalone. It doesnt =
- Matthew (8/25) Feb 21 2004 a
- J Anderson (4/12) Feb 21 2004 What about doxygen?
Many programmers loathe to document their code. When looking at undocumented C++ code, it's easy enough to open up a header file to get a good idea of what a class does and how it works. Though, it's not so easy in D. Sun Java (which also has no header files, for the Java impaired) has the javap program, which allows you to take a peek into classes, and is a handy way to get the interface and even private methods and variables. Has anyone written a parser to dump the interface of a D class? -- - Mik Mifflin
Feb 21 2004
In .net is even better, assemblies (.exe, .dll) have metadata about the types (including comments about those properties/methods (xml documentation)) (just like in mp3s). And you can look at those super easy, there are apps for that. On Sat, 21 Feb 2004 19:56:19 -0500, Mik Mifflin <mik42 NOadelphiaSPAM.net> wrote:Many programmers loathe to document their code. When looking at undocumented C++ code, it's easy enough to open up a header file to get a good idea of what a class does and how it works. Though, it's not so easy in D. Sun Java (which also has no header files, for the Java impaired) has the javap program, which allows you to take a peek into classes, and is a handy way to get the interface and even private methods and variables. Has anyone written a parser to dump the interface of a D class?-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Feb 21 2004
SpookyET wrote:In .net is even better, assemblies (.exe, .dll) have metadata about the types (including comments about those properties/methods (xml documentation)) (just like in mp3s). And you can look at those super easy, there are apps for that. On Sat, 21 Feb 2004 19:56:19 -0500, Mik Mifflin <mik42 NOadelphiaSPAM.net> wrote:I thought we just went over this... D is not .net -- - Mik MifflinMany programmers loathe to document their code. When looking at undocumented C++ code, it's easy enough to open up a header file to get a good idea of what a class does and how it works. Though, it's not so easy in D. Sun Java (which also has no header files, for the Java impaired) has the javap program, which allows you to take a peek into classes, and is a handy way to get the interface and even private methods and variables. Has anyone written a parser to dump the interface of a D class?
Feb 21 2004
closed minded. On Sat, 21 Feb 2004 20:19:11 -0500, Mik Mifflin <mik42 NOadelphiaSPAM.net> wrote:SpookyET wrote:-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/In .net is even better, assemblies (.exe, .dll) have metadata about the types (including comments about those properties/methods (xml documentation)) (just like in mp3s). And you can look at those super easy, there are apps for that. On Sat, 21 Feb 2004 19:56:19 -0500, Mik Mifflin <mik42 NOadelphiaSPAM.net> wrote:I thought we just went over this... D is not .netMany programmers loathe to document their code. When looking at undocumented C++ code, it's easy enough to open up a header file to get a good idea of what a class does and how it works. Though, it's not so easy in D. Sun Java (which also has no header files, for the Java impaired) has the javap program, which allows you to take a peek into classes, and is a handy way to get the interface and even private methods and variables. Has anyone written a parser to dump the interface of a D class?
Feb 21 2004
"SpookyET" wrote...beclosed minded.At the same time, one could easily argued you're the one who's closed minded here... One has to consider what's good and bad about a feature and it's implication on the rest of the language before one decide to include it. Otherwise, you'll just end up with something unusable even if all the indivual features have its merit. KTC -- Experience is a good school but the fees are high. - Heinrich Heine
Feb 22 2004
"Mik Mifflin" <mik42 NOadelphiaSPAM.net> wrote in message news:c18unj$7fq$1 digitaldaemon.com... | Many programmers loathe to document their code. When looking at | undocumented C++ code, it's easy enough to open up a header file to get a | good idea of what a class does and how it works. Though, it's not so easy | in D. Sun Java (which also has no header files, for the Java impaired) has | the javap program, which allows you to take a peek into classes, and is a | handy way to get the interface and even private methods and variables. | | Has anyone written a parser to dump the interface of a D class? I don't think so. This would be a good spot to have a D grammar available. At least one that could parse declarations. Note javap works on class files, not source files, so I'm not too clear on what you are asking for: to strip out declarations from D source or to disassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it. -Ben
Feb 21 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:c191js$dsn$1 digitaldaemon.com..."Mik Mifflin" <mik42 NOadelphiaSPAM.net> wrote in message news:c18unj$7fq$1 digitaldaemon.com... | Many programmers loathe to document their code. When looking at | undocumented C++ code, it's easy enough to open up a header file to geta| good idea of what a class does and how it works. Though, it's not soeasy| in D. Sun Java (which also has no header files, for the Java impaired)has| the javap program, which allows you to take a peek into classes, and isa| handy way to get the interface and even private methods and variables. | | Has anyone written a parser to dump the interface of a D class? I don't think so. This would be a good spot to have a D grammar available. At least one that could parse declarations. Note javap works on class files, not source files, so I'm not too clear on what you are asking for: to strip out declarations from D source or to disassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it.There's no practical way to disassemble object files into declarations. But have - Design by Contract. For example, instead of: // Input: s is 'a' or 'b' void foo(char s); we have: void foo(char s) in { assert(s == 'a' || s == 'b'); } This works better because comments are invariably out of date, wrong, incomplete, or missing. There's no ambiguity in the contract, and since it gets executed, it is guaranteed correct.
Feb 21 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:c191js$dsn$1 digitaldaemon.com...get"Mik Mifflin" <mik42 NOadelphiaSPAM.net> wrote in message news:c18unj$7fq$1 digitaldaemon.com... | Many programmers loathe to document their code. When looking at | undocumented C++ code, it's easy enough to open up a header file toaimpaired)| good idea of what a class does and how it works. Though, it's not soeasy| in D. Sun Java (which also has no header files, for the Javahasis| the javap program, which allows you to take a peek into classes, andaavailable.| handy way to get the interface and even private methods and variables. | | Has anyone written a parser to dump the interface of a D class? I don't think so. This would be a good spot to have a D grammartoAt least one that could parse declarations. Note javap works on class files, not source files, so I'm not too clear on what you are asking for: to strip out declarations from D source orButdisassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it.There's no practical way to disassemble object files into declarations.have - Design by Contract. For example, instead of: // Input: s is 'a' or 'b' void foo(char s); we have: void foo(char s) in { assert(s == 'a' || s == 'b'); } This works better because comments are invariably out of date, wrong, incomplete, or missing. There's no ambiguity in the contract, and since it gets executed, it is guaranteed correct.This is true as far as it goes, but it's not that far. You still need documentation. (As I'm sure you know ...)
Feb 21 2004
Ben Hinkle wrote:Note javap works on class files, not source files, so I'm not too clear on what you are asking for: to strip out declarations from D source or to disassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it. -BenSorry, I should have made myself more clear. I was looking for a program to parse d source and dump out the public methods and variables of classes. I haven't written a parser in a long while, but to write a small parser to recognize classes and public identifiers wouldn't be too difficult, if I understand correctly. So.. I take it no program exists yet? -- - Mik Mifflin
Feb 21 2004
Mik Mifflin wrote:Ben Hinkle wrote:I'm not sure that someone has written quite what you're looking for, but you may be able to benefit from some similar projects: *** dig (http://groups.yahoo.com/group/d_lab/) *** net\BurtonRadons\digc\dfiler.d I think this file is supposed to make a .d file DOxygen friendly net\BurtonRadons\digc\strip.d This file is susposed to remove whitespace and function bodies. It mostly works, but it does seem let some parts of the function seep through. It may be easy to fix, but I haven't dug into it to fix it. *** d2html *** Turns a .d source code into syntax-highlighed .html file. http://jcc_7.tripod.com/d/ *** Dependency Checker *** http://www.wikiservice.at/d/wiki.cgi?LarsIvarIgesund *** \dmd\src\dmd\ *** Since Walter has released the source to the DMD front-end, you may be able to find some help there. It's written in C++, but Walter didn't try to obfuscate it. -- Justin http://jcc_7.tripod.com/d/Note javap works on class files, not source files, so I'm not too clear on what you are asking for: to strip out declarations from D source or to disassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it. -BenSorry, I should have made myself more clear. I was looking for a program to parse d source and dump out the public methods and variables of classes. I haven't written a parser in a long while, but to write a small parser to recognize classes and public identifiers wouldn't be too difficult, if I understand correctly. So.. I take it no program exists yet?
Feb 22 2004
"J C Calvarese" <jcc7 cox.net> wrote in message news:c1b0fb$13pq$1 digitaldaemon.com...Since Walter has released the source to the DMD front-end, you may be able to find some help there. It's written in C++, but Walter didn't try to obfuscate it.Some have argued that I don't need to try <g>.
Feb 22 2004
Walter wrote:"J C Calvarese" <jcc7 cox.net> wrote in message news:c1b0fb$13pq$1 digitaldaemon.com...LOL! I guess I shouldn't even have mentioned that. Obviously, I meant that the code seems clear to me (not that I pretend to program in C++). -- Justin http://jcc_7.tripod.com/d/Since Walter has released the source to the DMD front-end, you may be able to find some help there. It's written in C++, but Walter didn't try to obfuscate it.Some have argued that I don't need to try <g>.
Feb 22 2004
You can use dtags , it comes with DIDE but its standalone. It doesnt = recognize templates but I can give you the source, its just a matter of = adding a TEMPLATE type and handling it in the analyseParens function. The flags I use are -u --fields=3D+SainKm --language-force=3Dd C On Sat, 21 Feb 2004 21:56:12 -0500, Mik Mifflin <mik42 NOadelphiaSPAM.ne= t> = wrote:Ben Hinkle wrote:arNote javap works on class files, not source files, so I'm not too cle=r =on what you are asking for: to strip out declarations from D source o=to disassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it. -BenSorry, I should have made myself more clear. I was looking for a =program to parse d source and dump out the public methods and variables of =classes. I haven't written a parser in a long while, but to write a small parser =torecognize classes and public identifiers wouldn't be too difficult, if=Iunderstand correctly. So.. I take it no program exists yet?-- = Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Feb 22 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:c191js$dsn$1 digitaldaemon.com..."Mik Mifflin" <mik42 NOadelphiaSPAM.net> wrote in message news:c18unj$7fq$1 digitaldaemon.com... | Many programmers loathe to document their code. When looking at | undocumented C++ code, it's easy enough to open up a header file to geta| good idea of what a class does and how it works. Though, it's not soeasy| in D. Sun Java (which also has no header files, for the Java impaired)has| the javap program, which allows you to take a peek into classes, and isa| handy way to get the interface and even private methods and variables. | | Has anyone written a parser to dump the interface of a D class? I don't think so. This would be a good spot to have a D grammar available. At least one that could parse declarations. Note javap works on class files, not source files, so I'm not too clear on what you are asking for: to strip out declarations from D source or to disassemble some compiled code to get the original D source. While programmers might be loathe to document code they sure should document APIs - otherwise no-one will want to use it.Quite true. If the code itself doesn't have the minimum - a la Doxygen or JavaDoc - then it's not worth using. QED
Feb 21 2004
Mik Mifflin wrote:Many programmers loathe to document their code. When looking at undocumented C++ code, it's easy enough to open up a header file to get a good idea of what a class does and how it works. Though, it's not so easy in D. Sun Java (which also has no header files, for the Java impaired) has the javap program, which allows you to take a peek into classes, and is a handy way to get the interface and even private methods and variables. Has anyone written a parser to dump the interface of a D class?What about doxygen? -- -Anderson: http://badmama.com.au/~anderson/
Feb 21 2004