473,890 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Boost process and C

Hi,

Is there any group in the manner of the C++ Boost group that works on
the evolution of the C language? Or is there any group that performs an
equivalent function?

Thanks,
-vs

Apr 29 '06
335 11984
CBFalconer wrote:
Ian Collins wrote:
Robert Latest wrote:
On 2006-04-30, jacob navia <ja***@jacob.re mcomp.fr> wrote:

.... snip ...
Until they have to port it to a new environment. Then they will
see how easy is to port the libc. Basically you do not port it.

And the STL is easier to port?


I think the point was you don't have to, because it is part of the
language, the compiler vendor does this.

And, if you write the library in truly portable C, without any
silly extensions and/or entanglements, you just compile the library
module. All the compiler vendor need to do is meet the
specifications of the C standard.

I think the point of the original paragraph has been lost, the reason to
have a standard library is to remove the need for everyone to roll their
own and get newcomers producing useful applications faster. Sure there
are those of us with our own tried and trusted solutions, but that
doesn't help the newcomers.

The same thing happened with C++, before the standard there were many
incompatible commercial and private libraries, now most of these have
been replaced with standard implementations .

It's a win win situation, you can still use your own if you choose.

--
Ian Collins.
May 3 '06 #181
CBFalconer wrote:
we******@gmail. com wrote:
Ben Pfaff wrote: ... snip ...
No. I mean that some string operations can be expressed shorter
and with more clarity in Perl than in C. No new string library
will change this.

That's a pretty wishy washy premise on which to base an implied
disapproval of Bstrlib. Let me just guess that you haven't really
seriously taken a look at it.


The last time I took an (admittedly cursory) look at Bstrlib, I
found it cursed with non-portabilities


You perhaps would like to name one?
[...] and unwarrented assumptions,
Such as?
not to mention an interminable API.
It is not necessary to learn or use the entire API to use it
effectively. If it seems large you can blame the current crop of users
who have motivated all the extensions from its original base functions.
In each case I could not make a strong enough case to avoid each
functions' inclusion. You appear to be the only person obsessed with
this non-issue.
[...] This is a criticism very few can make of the standard C string operations.


The C standard says that whether or not "string literals" are writable
is platform specific. It doesn't even specify what wchar_t contains
-- for example, the WATCOM compiler supports the old UCS-2 in its 16
bit compilers, and UTF-32 in its 32 bit compilers (while not
implementing a properly functioning setlocale function). So much for
portability. Bstrlib is *designed* for portability (including semantic
behavior irrespective of platform).

Every C string function which writes makes the one unwarranted
assumption that it cannot make -- i.e., that the size of the buffer
that holds the destination will be large enough for whatever operation
it is doing. fgets() makes the assumption that the input stream is in
text mode, or that it doesn't read a '\0' or that you just don't care
about that case. Nearly every string function *assumes* that the
parameters are non-aliasing (that's worse than just an unwarranted
assumption -- its just degenerate in terms of functionality). It is
*assumed* that you don't make interleaved calls strtok on different
strings. And of course, the format of C strings *assumes* that '\0'
will never be considered part of a string's content -- this assumption
ends up permeating all system string APIs, for any platform that uses C
as its main implementation language.

In terms of API size, Bstrlib is about 80 base C functions (which
includes the stream API functions) and 18 macros (there are 22 "bonus"
functions for doing MIME parsing and other miscellaneous utilities, and
there is a C++ API). The string.h file for one of my compilers has
about 57 extern functions. Then we need to add
(f|s|v|vs|sn|vs n|vf|)printf, (f|)puts, (f|)gets, (s|)scanf, ato(f|i|l),
strto(d|l), which is 19 all by itself. Add in the wide characters and
you'll nearly double that count. Bstrlib is not drammatically more
"interminab le" than the standard C library.

And you just can't compare the size of the APIs to judge how easy it is
to use or understand. To know all of the undefined scenarios of the C
library functions, you have to do a function by function examination of
the standard. With Bstrlib, all you have to do is make sure each
parameter is well defined, you don't abuse the write protection, and
don't destroy a value if you use an alias of it later. So the effort
to understand each function is Bstrlib is far lower. The functions in
Bstrlib also tend, on average, to do a lot more per function -- so your
investment in understanding has a higher payoff. And the thing is open
source, so there is never any ambiguity about any Bstrlib function that
you cannot authoritatively figure out on your own.

So I don't know what you last looked at, because you are just plain
wrong.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 3 '06 #182
Keith Thompson wrote:
we******@gmail. com writes:
Ian Collins wrote:
Where would you draw the line on topicality?
My interpretation is [...] Potential improvements?
To which the familliar refrain is "if you don't like the features of C,
use some other language".


If you don't like the features of C, you can either:

(1) Do without, or

(2) Use some other language that provides those features, or

(3) Use a C compiler that implements those features as an extension
(thus tying your code to that specific implementation) , or

(4) Push to have the new features added to the next revision of the C
standard, and then wait for the new standard to be published, and
then wait for implementations to support the new standard. If
you're *very* lucky, this might take as little as a decade.

If you think the standardization process is too slow, you can discuss
it in comp.std.c.


Its not just slow -- its *WRONG*. They add things that shouldn't be
added, and they rarely remove things, even things where there simply is
no question that they need to be removed.
[...] If you know of an alternative other than the ones
I've mentioned (and they've *all* been mentioned here), feel free to
suggest it.


How about doing what the GMP authors did, what Hans Boehm did with his
Boehm garbage collector, and what I've done in my own priviate
libraries (a self debuging heap with sub-heaps with fast mass-free
capabilities, coroutines, etc.)? Just *do it* and shake your head at
the standards committee who are of no help. (Then there is the Walter
Bright/Jacob Navia solution -- but I don't have the energy to build my
own compiler.)

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 3 '06 #183
<we******@gmail .com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
[...] If you know of an alternative other than the ones
I've mentioned (and they've *all* been mentioned here), feel free to
suggest it.


How about doing what the GMP authors did, what Hans Boehm did with his
Boehm garbage collector, and what I've done in my own priviate
libraries (a self debuging heap with sub-heaps with fast mass-free
capabilities, coroutines, etc.)? Just *do it* and shake your head at
the standards committee who are of no help. (Then there is the Walter
Bright/Jacob Navia solution -- but I don't have the energy to build my
own compiler.)


For once we are in agreement. Standardization works best when it
*codifies existing practice*. Absent existing practice, standards
committees indulge in speculative invention. Even if that invention
is done well it may not have much of a market.

So if you think you know how to evolve C, *just do it*. Build a
following and your bright new addition will be an obvious candidate
for a future DR, or revision of the C Standard. And meanwhile you
don't have to wait a decade for those stodgy old, uh, committee
members to do the obvious.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
May 3 '06 #184
On 2006-05-02, Keith Thompson <ks***@mib.or g> wrote:
If you don't like the features of C, you can either:


[ suggestions (1) through (4) snipped ]

(5) Write a compiler that supports the needed features,
preferably for a popular platform with a wide user
base such as Windows, and make it available for free.

If people like the language extensions, they will become popular
quickly and make it into other implementations as well, thus
creating what is known as a "de facto standard". No need to wait
for an ISO committee.

robert
May 3 '06 #185
On Tue, 02 May 2006 -0400, CBFalconer <cb********@yah oo.com> wrote:
jacob navia wrote:
Robert Latest a écrit :... snip ...

Why not? This way the language itself is kept lean and simple,


Lean and simple?

Assembler is even leaner and is much simpler.


Please post the source code to the last project you wrote in
assembler, and which ported unchanged to, say, an 8080, an 8051, an
8086, a 6800, a68000, an IBM 360/370, a PDP11, an HP3000. I trust
it ran to completion, and produced the same output on all systems
for the same input.


"Please post the source code to the last project you wrote in"
some portable C code more complex than
"#include <stdio.h>
int main(void){prin tf("Hello World\n"); return 0;}"
I won't insist on any more than the above selection. Note that I
even omitted a PIC and the Rabbit and the 6502. I will even let
you pick the (available) OS for each machine. However I do expect
more than a single 'halt' instruction.

May 3 '06 #186
we******@gmail. com wrote:
CBFalconer wrote:

.... snip ...

The last time I took an (admittedly cursory) look at Bstrlib, I
found it cursed with non-portabilities


You perhaps would like to name one?


I took another 2 minute look, and was immediately struck by the use
of int for sizes, rather than size_t. This limits reliably
available string length to 32767. I did find an explanation and
justification for this. Conceded, such a size is probably adequate
for most usage, but the restriction is not present in standard C
strings.

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/>
Also see <http://www.safalra.com/special/googlegroupsrep ly/>
May 3 '06 #187
P.J. Plauger wrote:
<we******@gmail .com> wrote in message
[...] If you know of an alternative other than the ones
I've mentioned (and they've *all* been mentioned here), feel free to
suggest it.
How about doing what the GMP authors did, what Hans Boehm did with his
Boehm garbage collector, and what I've done in my own priviate
libraries (a self debuging heap with sub-heaps with fast mass-free
capabilities, coroutines, etc.)? Just *do it* and shake your head at
the standards committee who are of no help. (Then there is the Walter
Bright/Jacob Navia solution -- but I don't have the energy to build my
own compiler.)


For once we are in agreement. Standardization works best when it
*codifies existing practice*.


Ooooh! You mean like TR 24731? Are you sure that you are codifying
actual existing practice?
[...] Absent existing practice, standards
committees indulge in speculative invention.
You mean like complex numbers (but specifically excluding Gaussian
integers)?
[...] Even if that invention
is done well it may not have much of a market.

So if you think you know how to evolve C, *just do it*. Build a
following and your bright new addition will be an obvious candidate
for a future DR, or revision of the C Standard.
You know, debugging heaps have been around for ever (speaking of
*market*). strlcat, strlcpy, and strtok_r have been around for some
time (certainly from well before 1999), and have had plenty of pickup
in certain environments. The C standard didn't pick them up, why would
they pick up any other useful, successful extension? I don't buy your
claim, because its not consistent with observed reality.

You might also like to observe the efforts of Bjarne Stroustrup, Guido
van Rostum and Roberto Ierusalimschy. These people have garnered a
significant market following that has gone completely unnoticed by the
Standards committee.
[...] And meanwhile you
don't have to wait a decade for those stodgy old, uh, committee
members to do the obvious.


As I posted elsewhere, I am thinking more of the word "flawed" than old
or stodgy.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 3 '06 #188
CBFalconer wrote:
we******@gmail. com wrote:
CBFalconer wrote: ... snip ...
The last time I took an (admittedly cursory) look at Bstrlib, I
found it cursed with non-portabilities


You perhaps would like to name one?


I took another 2 minute look, and was immediately struck by the use
of int for sizes, rather than size_t. This limits reliably
available string length to 32767.


Using size_t is also not any more *portable* than using int. Any lack
of portability is merely a reflection of the lack of the intrinsic
non-portability of the language itself. size_t can only reliably
contain values as high as 65535 -- so you are saying this difference in
limits (between 32k and 64k) embodies a significant universe of string
manipulation to warrant a claim against Bstrlib's portability?
[...] I did find an explanation and
justification for this. Conceded, such a size is probably adequate
for most usage, but the restriction is not present in standard C
strings.


Your going to need to conceed on more grounds than that. There is a
reason many UNIX systems tried to add a ssize_t type, and why TR 24731
has added rsize_t to their extension. (As a side note, I strongly
suspect the Microsoft, in fact, added this whole rsize_t thing to TR
24731 when they realized that Bstrlib, or things like it, actually has
far better real world safety because its use of ints for string
lengths.) Using a long would be incorrect since there are some systems
where a long value can exceed a size_t value (and thus lead to falsely
sized mallocs.) There is also the matter of trying to codify read-only
and constant strings and detecting errors efficiently (negative lengths
fit the bill.) Using ints is the best choice because at worst its
giving up things (super-long strings) that nobody cares about, it
allows in an efficient way for all desirable encoding scenarios, and it
avoids any wrap around anomolies causing under-allocations. If I tried
to use size_t I would give up a significant amount of safety and design
features (or else I would have to put more entries into the header,
making it less efficient).

Hundreds of people have downloaded Bstrlib and seriously looked at it
already. I've gotten plenty of feedback over its lifetime which has
lead to its evolution (so its not like it hasn't already had
significant review). You, of all people, are not going find any
serious flaw in it by perusing it for 2 minutes.

"Cursed with non-portabilities" indeed ...

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 3 '06 #189
we******@gmail. com writes:
CBFalconer wrote:
we******@gmail. com wrote:
> CBFalconer wrote: ... snip ...
>> The last time I took an (admittedly cursory) look at Bstrlib, I
>> found it cursed with non-portabilities
>
> You perhaps would like to name one?


I took another 2 minute look, and was immediately struck by the use
of int for sizes, rather than size_t. This limits reliably
available string length to 32767.


Using size_t is also not any more *portable* than using int. Any lack
of portability is merely a reflection of the lack of the intrinsic
non-portability of the language itself. size_t can only reliably
contain values as high as 65535 -- so you are saying this difference in
limits (between 32k and 64k) embodies a significant universe of string
manipulation to warrant a claim against Bstrlib's portability?


Yes.

I can't speak for Chuck, but size_t can reliably contain the size of
any object that the system can create. That's what it's for. If the
maximum value of size_t is 65535, then the system isn't going to be
able to create objects bigger than 65535 bytes.

It's entirely possible to have a conforming implementation in which
int is 16 bits, but size_t is 32 bits. On such a system, using int to
represents sizes needlessly sacrifices the ability to handle objects
bigger than 32767 bytes. For that matter, it's conceivable (but
unlikely) that size_t could be smaller than int.

[...] Hundreds of people have downloaded Bstrlib and seriously looked at it
already. I've gotten plenty of feedback over its lifetime which has
lead to its evolution (so its not like it hasn't already had
significant review). You, of all people, are not going find any
serious flaw in it by perusing it for 2 minutes.

"Cursed with non-portabilities" indeed ...


Do you have any figures on the number of people who have looked at it
briefly, rejected it because it's too complex, and not bothered to
mention it to you? I'm not saying there are a lot of such people
(obviously I don't have any such figures myself), but I don't think
you can exclude the possibility that it's a common thing.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 3 '06 #190

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
5415
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++ language. A C++ interface installation IS ABOUT THE C++ LANGUAGE! The language does not possess the ability to handle even simple file directory manipulation. Those wise people that created it did not take care of it. So, BOOST is a portable...
205
10775
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
17
1908
by: Howard Gardner | last post by:
/* If I am using boost, then how should I write this program? As it sits, this program is using SFINAE to determine whether or not a type supports particular syntax. I suspect that there is functionality in boost to do this. I have found mpl::has_xxx, which I suspect of being part of the solution. I've also found type_traits::has_nothrow_constructor
2
6637
by: smith4894 | last post by:
{ not sure you're aware of that but there are the newsgroups for all major operating systems. you might want to try asking in the forum 'comp.os.linux.development.apps', since memory-mapped files are not a language-supported structure, they are platform-specific. -mod } I'm trying to use boost serialization to serialize/deserialize data to and from a mmap'd file. I have my own ostream/istream classes that essentially read/write bytes...
5
2400
by: linyanhung | last post by:
I used a boost multi thread in VS 2005 on a Duo Core PC, and made a two thread process. The code is something like this: #include <boost/thread/thread.hpp> void fun1() { //do something
8
6220
by: Matt England | last post by:
My team currently using Boost Threads, but we are considering switching to ZThreads. (We seek cross-platform, C++ multithreading capabilities in an external library.) ZThread(s): http://zthread.sourceforge.net/ http://www.inf.uni-konstanz.de/dbis/members/vinnik/zsim/doc/ Can anyone share their ZThreads experience, either good, bad, or
2
2417
by: ironpingwin | last post by:
Hi! I'd like to make few threads which will run in the same time in C++. I try to use boost library v 1.34.1 (it can't be newest, because I compile on remote machine, which is not administrated by me). In this version there isn't detach() function. How to run functions from two different class in the same time?
13
4543
by: brad | last post by:
Still learning C++. I'm writing some regex using boost. It works great. Only thing is... this code seems slow to me compared to equivelent Perl and Python. I'm sure I'm doing something incorrect. Any tips? #include <boost/regex.hpp> #include <iostream> // g++ numbers.cpp -o numbers -I/usr/local/include/boost-1_35 /usr/local/lib/libboost_regex-gcc41-mt-s.a // g++ numbers.cpp -o numbers.exe
5
3596
by: ameyav | last post by:
Hi All, I am converting some C code into C++ code. The objective is to improve throughput. I have some code written in C which serially parses through a list of files, opens each one of them, processes the data and closes the file. All the files are processed one by one. The obvious performance bottleneck that i could think of is the wasted cpu cycles for file i/o. *My solution* was to spawn multiple threads to do the file i/o. For...
0
9970
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11207
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10794
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10896
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9612
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.