Re: D
"Paul Hsieh" <qed@pobox.co m> wrote in message
news:796f488f.0 307100037.44517 83b@posting.goo gle.com...[color=blue]
>
> Well, he's asking for libraries and safety, and has pointed out the
> buffer overflow problem related to safety -- that's an obvious queue
> my "better string library":
>
> http://bstring.sourceforge.net/
>
> The point of the bstring library, especially in comparison to the
> numerous other string libraries out there, is that its high
> performance, it carries absolutely no extra baggage with it, while
> remaining totally interoperable with the char * buffer style strings.[/color]
There is no buffer overflow problem in the C++ standard library and
std::string is also interoperable with char *.
[color=blue]
> As to his comment about GC, I have thought about it, but I can't think
> of a way to implement it properly with high performance *and* support
> the typical malloc/free paradigm at the same time.[/color]
Check .NET. It has interesting GC mechanisms.
[color=blue]
> Even if you could
> make it work, the fact that C/C++ still cannot *guarantee* prevention
> of buffer overflows leading to undefined behavior, add a GC background
> thread and this is likely to manifest itself in programing errors that
> are *truly* impossible to debug.[/color]
C & C++ are different languages. In C++ code you can guarantee buffer
overlofw protection by using the standard library facilities. I suggest you
read "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne
Stroustrup (the creator of C++), *cover to cover*.
[color=blue]
> Some C/C++ programmers are also used
> to the idea that "encoded pointers" shouldn't lead to unexpected
> behavior (though most C-based GC solutions fail when you do things
> like this.)
>
> The real goal of GC is eliminate the memory leaks, and simplify code
> somewhat. So as an alternative to GC, why not just significantly
> extend the heap management semantics? So many programmers write their
> own "debug wrappers" for malloc/realloc/free anyhow, why not just
> decide on a one useful set of very general extensions, provide sample
> code for the vendors to use, and add it to the language standard. I
> have some ideas here that have worked very well for me in practice, if
> the C++ people are truly open to these ideas.[/color]
You need a slow, thoroughh read of TC++PL 3 (see above). :-)
--
Ioannis
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
"Paul Hsieh" <qed@pobox.co m> wrote in message
news:796f488f.0 307100037.44517 83b@posting.goo gle.com...[color=blue]
>
> Well, he's asking for libraries and safety, and has pointed out the
> buffer overflow problem related to safety -- that's an obvious queue
> my "better string library":
>
> http://bstring.sourceforge.net/
>
> The point of the bstring library, especially in comparison to the
> numerous other string libraries out there, is that its high
> performance, it carries absolutely no extra baggage with it, while
> remaining totally interoperable with the char * buffer style strings.[/color]
There is no buffer overflow problem in the C++ standard library and
std::string is also interoperable with char *.
[color=blue]
> As to his comment about GC, I have thought about it, but I can't think
> of a way to implement it properly with high performance *and* support
> the typical malloc/free paradigm at the same time.[/color]
Check .NET. It has interesting GC mechanisms.
[color=blue]
> Even if you could
> make it work, the fact that C/C++ still cannot *guarantee* prevention
> of buffer overflows leading to undefined behavior, add a GC background
> thread and this is likely to manifest itself in programing errors that
> are *truly* impossible to debug.[/color]
C & C++ are different languages. In C++ code you can guarantee buffer
overlofw protection by using the standard library facilities. I suggest you
read "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne
Stroustrup (the creator of C++), *cover to cover*.
[color=blue]
> Some C/C++ programmers are also used
> to the idea that "encoded pointers" shouldn't lead to unexpected
> behavior (though most C-based GC solutions fail when you do things
> like this.)
>
> The real goal of GC is eliminate the memory leaks, and simplify code
> somewhat. So as an alternative to GC, why not just significantly
> extend the heap management semantics? So many programmers write their
> own "debug wrappers" for malloc/realloc/free anyhow, why not just
> decide on a one useful set of very general extensions, provide sample
> code for the vendors to use, and add it to the language standard. I
> have some ideas here that have worked very well for me in practice, if
> the C++ people are truly open to these ideas.[/color]
You need a slow, thoroughh read of TC++PL 3 (see above). :-)
--
Ioannis
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Comment