468,491 Members | 1,996 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,491 developers. It's quick & easy.

Best libc implementation

Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi

Oct 6 '06 #1
20 3237
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?
The one that comes with your platform.

Because it's there.

--
Ian Collins.
Oct 6 '06 #2


On Oct 6, 1:45 pm, "int main(void)" <dnu...@gmail.comwrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
I think it's glibc. ;-p

Oct 6 '06 #3
What do you mean by best ?

sorry for dumb question :)
--raxit
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
Oct 6 '06 #4
On Thu, 05 Oct 2006 22:45:46 -0700, int main(void) wrote:
Hi all,

What do you people think as the best libc implementation. I'm a newbie,
browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?
If you're a newbie to C and browsing to learn how certain problems are
solved, then definitely stay way from glibc. Not because it's poorly
written, but because it contains many difficult to understand--sometimes
clever, sometimes not--algorithms and data structures, not to mention the
I18N framework, GCC specific bits, and inline assembly. GNU code in
general is often difficult to read.

OpenBSD and NetBSD sport the most straight forward code I've seen. I
suspect FreeBSD and OpenSolaris probably fall in-between.

Then there are alternatives like ulibc and the like, but the old BSD code
has always seemed more intuitive to me.

Note that reading C library implementations isn't necessarily the best way
to introduce yourself to the wide body of C code out there. BSD binutils
might be better. Lua and ICU are significant bodies of code that have most
impressed me, Lua being 100% ISO/ANSI C. libtomcrypt is another well
written C project (all ISO/ANSI, excluding the optional optimized
routines).
Oct 6 '06 #5

raxitsheth2...@yahoo.co.in wrote:
What do you mean by best ?
Best in terms of speed, code quality etc.
When i browsed through some of those open source codes i found ones
implementation (of say strchr) was very much different from the other.
I know that there are some tradeoffs involved.
But i just wanted to know which libc is so much popular among you
guys.
One more thing i found is,
in libc folder each function is kept in a separate file.
Is there any reason for this ?
sorry for dumb question :)
--raxit
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
Oct 6 '06 #6

raxitsheth2...@yahoo.co.in wrote:
What do you mean by best ?
Best in terms of speed, code quality etc.
When i browsed through some of those open source codes i found ones
implementation (of say strchr) was very much different from the other.
I know that there are some tradeoffs involved.
But i just wanted to know which libc is so much popular among you
guys.
One more thing i found is,
in libc folder each function is kept in a separate file.
Is there any reason for this ?
sorry for dumb question :)
--raxit
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
Oct 6 '06 #7
int main(void) wrote:
I want to what is the best libc implementation and why ?
glibc is strong enough that IBM uses it on the BlueGene supercomputer.
Oct 6 '06 #8
William Ahern wrote:
On Thu, 05 Oct 2006 22:45:46 -0700, int main(void) wrote:

>>Hi all,

What do you people think as the best libc implementation. I'm a newbie,
browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?


If you're a newbie to C and browsing to learn how certain problems are
solved, then definitely stay way from glibc. Not because it's poorly
written, but because it contains many difficult to understand--sometimes
clever, sometimes not--algorithms and data structures, not to mention the
I18N framework, GCC specific bits, and inline assembly. GNU code in
general is often difficult to read.

OpenBSD and NetBSD sport the most straight forward code I've seen. I
suspect FreeBSD and OpenSolaris probably fall in-between.
OpenSolaris is very easy to follow, clear and well written with an
excellent source browser:

http://cvs.opensolaris.org/source/

--
Ian Collins.
Oct 6 '06 #9

"int main(void)" <dn****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>
raxitsheth2...@yahoo.co.in wrote:
What do you mean by best ?
Best in terms of speed, code quality etc.
As this post of mine showed, there are _many_ free compilers, most with
their own libc's:
http://groups.google.com/group/comp....ce45991e?hl=en
(I forgot Digital Mars http://www.digitalmars.com/ for the DOS and Windows
targets)

Personally, I like POSIX features whether it is GNU libc or DJ Delorie's
libc he created for DJGPP. This makes them better for porting *NIX
applications. On the other hand, OpenWatcom's libc produces faster code,
but isn't well suited to porting POSIX applications (yet) and many portions
of it aren't easy reading. The library that I found the easiest to read was
Mingw. Supposedly, Digital Mars outperforms them all for the target
platforms that it supports... Also, it is said that TenDRA is the most
pedantic regarding C compliance... (I can't confirm the last two as
truths...)
One more thing i found is,
in libc folder each function is kept in a separate file.
Is there any reason for this ?
I'd like to know too. I suspect it is for ease of maintenance (or perhaps
interfacing with the OS), but I have no proof of that. Personally, I'd
prefer _all_ stdio.h functions to be in stdio.c etc., but I've never seen
any library do it that way, _ever_.
Rod Pemberton
Oct 6 '06 #10
On 5 Oct 2006 22:45:46 -0700, "int main(void)" <dn****@gmail.com>
wrote:
>Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
This is just an educated guess, but since it's October, and The
Yankees are in the playoffs, I'd say that Derek Jeter has the best
libc implementation out there. I think he keeps it in his back pocket,
along with a myriad of other things, like chewing tobacco and a
batting glove. You would be well off to contact him about his libc
implementation--if it's anything like I suspect, it is one of the best
for speed and accuracy.

Take care
--
jay
Oct 6 '06 #11
int main(void) <dn****@gmail.comkirjoitti 06.10.2006:
in libc folder each function is kept in a separate file.
Is there any reason for this ?
Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.

Oct 6 '06 #12
Antti-Juhani Kaijanaho wrote:
int main(void) <dn****@gmail.comkirjoitti 06.10.2006:
> in libc folder each function is kept in a separate file.
Is there any reason for this ?


Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.
Surely not.

A library is supplied as a single object, individual object files are
not provided.

--
Ian Collins.
Oct 6 '06 #13
Ian Collins <ia******@hotmail.comkirjoitti 06.10.2006:
Antti-Juhani Kaijanaho wrote:
>Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.
Surely not.

A library is supplied as a single object, individual object files are
not provided.
The traditional format for Unix static libraries is an ar archive
containing object files.

Oct 6 '06 #14
>Some implementations (for example Unix under static linking) are able to
>avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.
Surely not.

A library is supplied as a single object, individual object files are
not provided.
A library used for static linking on every version of UNIX I have
used (Including UNIX v6, UNIX v7, BSD UNIX 4.1 (Vax), FreeBSD,
System VR4, Microsoft Xenix, etc.) constructs a *.a library out of
a bunch of *.o files with a command like:

ar cv libfoo.a *.o
with or without also running
ranlib libfoo.a

and you can extract the original object files with:

ar xv libfoo.a

Although the linker may object to it, the 'ar' program on many
systems will also tolerate other types of files (like source code),
and in that regard it can often be used as a poor, slow replacement
for tar or cpio (archives created by these are NOT compatible with
each other).

The above does not apply to shared libraries (*.so) which are the
default on the more recent systems.

Oct 6 '06 #15
(previous attributions lost)
Gordon Burditt wrote:
>>>Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.

Surely not.

A library is supplied as a single object, individual object files are
not provided.


A library used for static linking on every version of UNIX I have
used (Including UNIX v6, UNIX v7, BSD UNIX 4.1 (Vax), FreeBSD,
System VR4, Microsoft Xenix, etc.) constructs a *.a library out of
a bunch of *.o files with a command like:

ar cv libfoo.a *.o
with or without also running
ranlib libfoo.a

and you can extract the original object files with:

ar xv libfoo.a
Ah, it's been a long time since I used ar and ranlib.

Cheers,

--
Ian Collins.
Oct 6 '06 #16
jmcgill <jm*****@email.arizona.eduwrites:
int main(void) wrote:
> I want to what is the best libc implementation and why ?

glibc is strong enough that IBM uses it on the BlueGene supercomputer.
That's not surprising; the system runs SuSE Linux (or GNU/Linux if you
prefer).

I think most of the speed-critical code that runs on such a system
isn't dependent on the C standard library anyway; most of it is
probably floating-point computations.

--
Keith Thompson (The_Other_Keith) 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.
Oct 6 '06 #17
"int main(void)" wrote:
>
What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various
libc implementation.
I want to what is the best libc implementation and why ?
No such beast. The library is implementation specific.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
Oct 7 '06 #18
Keith Thompson <ks***@mib.orgskriver:
jmcgill <jm*****@email.arizona.eduwrites:
>int main(void) wrote:
>> I want to what is the best libc implementation and why ?

glibc is strong enough that IBM uses it on the BlueGene supercomputer.

That's not surprising; the system runs SuSE Linux (or GNU/Linux if you
prefer).

I think most of the speed-critical code that runs on such a system
isn't dependent on the C standard library anyway; most of it is
probably floating-point computations.
I would be suppriced if any code from libc is involved in the
speed-critical parts of any program running on a super-computer. If
speed matters, you tend to work hard you getting the most out of your
code. Buffering is extreamly critical. You can also note that IBM sais
that libc only is used to gain POSIX compliance on there special
kernel. (For computational nodes.) For speed, the linpack and MPI
implenenations are probaly more intressting. (Small changes in LinPack
often moves supercomputers up and down on the top500 list.)

/ Balp
--
http://anders.arnholm.nu/ Keep on Balping
Oct 10 '06 #19
jmcgill wrote:
int main(void) wrote:
> I want to what is the best libc implementation and why ?

glibc is strong enough that IBM uses it on the BlueGene supercomputer.
It has however some of the messiest source code around.

Zealots will have many arguments why it is neccesary to
organize it like they do, none of which convinced me..
Oct 10 '06 #20
=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?= <NO*@Utel.nowrote:
jmcgill wrote:
int main(void) wrote:
I want to what is the best libc implementation and why ?
glibc is strong enough that IBM uses it on the BlueGene supercomputer.

It has however some of the messiest source code around.

Zealots will have many arguments why it is neccesary to
organize it like they do, none of which convinced me..
Hah. It's not necessary; it's merely inevitable. Unfortunately.

Richard
Oct 10 '06 #21

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Timo Benk | last post: by
6 posts views Thread by Affan Syed | last post: by
25 posts views Thread by Roger | last post: by
reply views Thread by jason.pirok | last post: by
4 posts views Thread by raashid bhatt | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.