www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Reviewing Phobos

reply Orgoton <arkangath gmail.com> writes:
I've been checking out the code of Phobos and I noticed it has the copyright
notice dating 2004 (at least on file.d which is the one I'm currently
reviewing). I've been only adding some documentation and arranging the code to
the format specified on http://www.digitalmars.com/d/dstyle.html but I've been
noticing some occasional "bool" instead of "bit". Also, naming conventions are
not followed (like isfile() instead of isFile()).

I'd hope I'd get an answer from someone from the D programming language
development team. Should I correct this name conventions as well, or shall I
leave them as they are, and only add Documentation lines and non-code altering
stuff like white spaces and indentation?

You can mail me an answer if you'd like or reply on the forums.

Thank a lot.
Feb 09 2007
next sibling parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Orgoton wrote:
 I've been noticing some occasional "bool" instead of "bit".
Don't you mean the other way around? "bit" is just an alias to "bool" created in order to not break too much code when the native bit type was removed from the language AFAIK...
Feb 09 2007
parent reply Orgoton <arkangath gmail.com> writes:
Frits van Bommel Wrote:

 Orgoton wrote:
 I've been noticing some occasional "bool" instead of "bit".
Don't you mean the other way around? "bit" is just an alias to "bool" created in order to not break too much code when the native bit type was removed from the language AFAIK...
Ups, I made a typo: not "bool" but "BOOL" (caps). Also, "1" is used instead "true" and "0" instead of "false".
Feb 09 2007
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Orgoton wrote:
 Frits van Bommel Wrote:
 
 Orgoton wrote:
 I've been noticing some occasional "bool" instead of "bit".
Don't you mean the other way around? "bit" is just an alias to "bool" created in order to not break too much code when the native bit type was removed from the language AFAIK...
Ups, I made a typo: not "bool" but "BOOL" (caps). Also, "1" is used instead "true" and "0" instead of "false".
Ah, that'd be in the windows-specific code, right? IIRC 'BOOL' is an alias of int used by Windows APIs because C doesn't have a real bool type (at least, it didn't until C99, after the APIs were created). So don't change those.
Feb 09 2007
prev sibling parent reply jcc7 <technocrat7 gmail.com> writes:
== Quote from Orgoton (arkangath gmail.com)'s article
 I've been checking out the code of Phobos and I noticed it has the copyright
notice dating 2004 (at least on file.d which is the one I'm currently reviewing). I've been only adding some documentation and arranging the code to the format specified on http://www.digitalmars.com/d/dstyle.html but I've been noticing some occasional "bool" instead of "bit". Also, naming conventions are not followed (like isfile() instead of isFile()).
 I'd hope I'd get an answer from someone from the D programming language
development team. Should I correct this name conventions as well, or shall I leave them as they are, and only add Documentation lines and non-code altering stuff like white spaces and indentation?
 You can mail me an answer if you'd like or reply on the forums.
 Thank a lot.
I think the one and only memeber of the "D programming language development team" is Walter Bright. If you want to be sure that you're not wasting your time with your improvements, you need to get a response from him. There's enough traffic on these newsgroups, so he may not even have read any of your posts on this topic yet. I think what your doing sounds valuable, but I suspect changing the names of functions in Phobos is going a lot farther than Walter would be willing to go. Consistency is great, but changing the capitalization does break code. It might be a great improvement, but I don't expect Walter to approve that. The design (or lack of design) of Phobos can be a controversial topic. For example, I think that the Tango project (http://www.dsource.org/projects/tango) was started because people being disappointed with Phobos. The Tango developers have already given up on getting Walter to improve Phobos -- they just want to replace Phobos altogether. Of course, I'm not involved in the development of Phobos or Tango, so what do I know. ;) jcc7
Feb 09 2007
parent reply Howard Berkey <howard well.com> writes:
jcc7 Wrote:

 The design (or lack of design) of Phobos can be a controversial topic. For
 example, I think that the Tango project (http://www.dsource.org/projects/tango)
 was started because people being disappointed with Phobos. The Tango developers
 have already given up on getting Walter to improve Phobos -- they just want to
 replace Phobos altogether.
 
 Of course, I'm not involved in the development of Phobos or Tango, so what do I
 know. ;)
 
 jcc7
I don't quite understand the comparison. Phobos is the D standard library. It should be as concise and powerful as possible, but it should not be a huge project necessarily. Tango, on the other hand, is a platform library. It is more in the vein of, say, the Boost C++ library, from my perspective. It can be much larger and filled with things you wouldn't normally expect in a good, small std lib. I could be totally wrong here, but that's how things look to me. Granted I have been developing in D for less than two months so take my opinions with a large grain of salt :)
Feb 09 2007
parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Howard Berkey wrote:
 Tango, on the other hand, is a platform library.  It is more in the vein of,
say, the Boost C++ library, from my perspective.  It can be much larger and
filled with things you wouldn't normally expect in a good, small std lib.
Boost doesn't replace the standard C++ library, it complements it. Big difference.
Feb 09 2007
parent reply Howard Berkey <howard well.com> writes:
Frits van Bommel Wrote:

 Howard Berkey wrote:
 Tango, on the other hand, is a platform library.  It is more in the vein of,
say, the Boost C++ library, from my perspective.  It can be much larger and
filled with things you wouldn't normally expect in a good, small std lib.
Boost doesn't replace the standard C++ library, it complements it. Big difference.
Ahh, I had misunderstood; I thought they were usable simultaneously. I didn't see anything that would prevent you from using them together at first glance.
Feb 09 2007
parent reply Sean Kelly <sean f4.ca> writes:
Howard Berkey wrote:
 Frits van Bommel Wrote:
 
 Howard Berkey wrote:
 Tango, on the other hand, is a platform library.  It is more in the vein of,
say,
 the Boost C++ library, from my perspective.  It can be much larger 
and filled with
 things you wouldn't normally expect in a good, small std lib.
Boost doesn't replace the standard C++ library, it complements it. Big difference.
Ahh, I had misunderstood; I thought they were usable simultaneously. I didn't see anything that would prevent you from using them together at first glance.
The runtime code. Unlike C++, D relies on a lot of 'hidden' functionality to support various language features. One of the original goals of Ares, and transitively for Tango, was to define a strict and logical separation between the core components of a D application: the compiler runtime code, the garbage collector, and the standard library itself. One benefit of such an approach is that it allows each kind of developer to do their job independently of the other. The compiler writer need only expose or call a specific set of predefined functions, and the same is true for someone crafting a garbage collector or a standard library. Each component is separately compilable and need only be linked to the user's executable to create a complete and working D application. This is discussed briefly in the Tango Advanced Configuration Guide: http://dsource.org/projects/tango/wiki/TopicAdvancedConfiguration So in essence, I believe Tango is three things: a well-defined standard for creating D language support code, a minimal and configurable user-level wrapper around this code (in the form tango.core.*), and a robust user library and development framework. The result is that the visible portion of Tango is completely separable from the Tango runtime. In fact, this is one reason Tango currently doesn't ship with a comprehensive static library (the other being technical issues with exposing template code from libraries). If you don't care about the user-level portion of Tango, you're free replace it or simply get rid of it entirely. Once the template issues are resolved a static library will be made available, but I do not personally believe it should ever be integrated with the runtime code, optimizing linker or no. The purposes of each are quite distinct, and they should remain that way :-) Sean
Feb 09 2007
parent reply Tomas Lindquist Olsen <tomas famolsen.dk> writes:
Sean Kelly wrote:

 One of the original
 goals of Ares, and transitively for Tango, was to define a strict and
 logical separation between the core components of a D application: the
 compiler runtime code, the garbage collector, and the standard library
 itself.
It would be really nice if phobos and Tango could share the lowest levels. Compiler runtime code and garbage collector.
Feb 09 2007
next sibling parent reply Sean Kelly <sean f4.ca> writes:
Tomas Lindquist Olsen wrote:
 Sean Kelly wrote:
 
 One of the original
 goals of Ares, and transitively for Tango, was to define a strict and
 logical separation between the core components of a D application: the
 compiler runtime code, the garbage collector, and the standard library
 itself.
It would be really nice if phobos and Tango could share the lowest levels. Compiler runtime code and garbage collector.
I agree :-) Sean
Feb 10 2007
parent Howard Berkey <howard well.com> writes:
Sean Kelly Wrote:

 Tomas Lindquist Olsen wrote:
 Sean Kelly wrote:
 
 One of the original
 goals of Ares, and transitively for Tango, was to define a strict and
 logical separation between the core components of a D application: the
 compiler runtime code, the garbage collector, and the standard library
 itself.
It would be really nice if phobos and Tango could share the lowest levels. Compiler runtime code and garbage collector.
I agree :-) Sean
Me too, and thanks for the great response explaining things a couple posts back. I had naively assumed that the core runtime code was external to phobos but if I had not thought it through.
Feb 10 2007
prev sibling parent Lionello Lunesu <lio lunesu.remove.com> writes:
Tomas Lindquist Olsen wrote:
 Sean Kelly wrote:
 
 One of the original
 goals of Ares, and transitively for Tango, was to define a strict and
 logical separation between the core components of a D application: the
 compiler runtime code, the garbage collector, and the standard library
 itself.
It would be really nice if phobos and Tango could share the lowest levels. Compiler runtime code and garbage collector.
Yes, I hope this will happen, too.... L.
Feb 13 2007