Page 1 of 4
A Completeley Redesigned C library
Posted: Thu Jan 18, 2007 5:28 pm
by iammisc
Hi
My question to you is if you could redesign the entire C standard library, what new features would you include and how would you design it?
Posted: Thu Jan 18, 2007 6:19 pm
by Brynet-Inc
...Tiny misconception really.
There is not really one "C library".
Quite a few implement standard features from the
Single UNIX Specification and some other POSIX extensions, Systems like Linux for example adds various other functions and might be distributed with with one many different C libraries (
GNU libc/uclibc/Newlib).
Most of the BSD's have their own C library, Supporting most common functions, Some may know of OpenBSD's strlcpy/strlcat functions.
It really depends on the implementation, But I'm guessing a majority of people here write their own C library while adding any additional things as they see fit.
The member here named spix made a fork of RedHat's Newlib library and is adding various new functions and features for his Operating System named Mort.
Another member named solar is designing a public domain C library that will eventually support the full ISO 9899:1989 / 1999
C library framework.
Some people even rename functions entirely and make there own non-standard API
http://sourceforge.net/projects/pdclib/
http://sources.redhat.com/newlib/
http://www.uclibc.org/
http://www.gnu.org/software/libc/
http://www.mort-os.com/
Hope I helped
EDIT: Whoops forgot to mention Durand Miller's libUNIX, It's quite interesting.
http://djm.co.za/spoon/libUNIX.php
Posted: Thu Jan 18, 2007 6:24 pm
by iammisc
when i said C library i meant a system library along the lines of the current standard library but with completely different functions. Basically, if you were to write an operating system and a c library to go along with it how would you make it better than the current c library. Would you have new features? or maybe you would completely redesign it. This thread is just a gathering point for ideas.
Posted: Thu Jan 18, 2007 6:30 pm
by Brynet-Inc
iammisc wrote:when i said C library i meant a system library along the lines of the current standard library but with completely different functions. Basically, if you were to write an operating system and a c library to go along with it how would you make it better than the current c library. Would you have new features? or maybe you would completely redesign it. This thread is just a gathering point for ideas.
I don't quite see your point, There is no really common standard.. Some operating systems lack functions that others have.. Quite a few people here are writing their own C library and are usually aware of a large list of common functions they should implement, Most do add functions which are less common or are for their OS only.. Or review other libraries.
A good example of this is Microsoft's C library
While it has a few basic functions.. It's not the most
standard library around.
In reality it really depends on the programmers preference bud.
Posted: Thu Jan 18, 2007 6:34 pm
by iammisc
What features would you want in an operating system's C library.
Posted: Thu Jan 18, 2007 6:38 pm
by Brynet-Inc
I'm not sure.. I like standards.. but in any sense..
magic() - Undocumented secret function to make Brynet-Inc smarter.. hehe
Posted: Thu Jan 18, 2007 6:46 pm
by JackScott
I personally would want better names for the 'standard' functions. vsprintf() doesn't actually tell you that much about what it does until you study the manual...
Wait, does vsprintf() actually exist? Or is that fvprintf()? Who knows...
Posted: Thu Jan 18, 2007 8:19 pm
by Alboin
What about a C version of something like the C++ Boost library? Very high level C.
Posted: Thu Jan 18, 2007 9:11 pm
by Brynet-Inc
That's almost as sad as defining:
#define PLUS +
#define NEGATIVE -
#define GREATERTHAN >
#define LESSTHAN <
Posted: Thu Jan 18, 2007 10:18 pm
by Alboin
Brynet-Inc wrote:That's almost as sad as defining:
#define PLUS +
#define NEGATIVE -
#define GREATERTHAN >
#define LESSTHAN <
? What's wrong with the Boost libraries? They're well made, and cross platform. For high level coding, what else could you want?
Posted: Fri Jan 19, 2007 12:47 am
by Brynet-Inc
Anything that should be programmed can be done so in C or Assembly.. Anything that can't.. Shouldn't
Posted: Fri Jan 19, 2007 10:26 am
by nick8325
Brynet-Inc wrote:Anything that should be programmed can be done so in C or Assembly
Sure, and if you want to travel half-way across the world you can walk. It doesn't mean it's a good idea...
Posted: Fri Jan 19, 2007 10:43 am
by Brynet-Inc
nick8325 wrote:Brynet-Inc wrote:Anything that should be programmed can be done so in C or Assembly
Sure, and if you want to travel half-way across the world you can walk. It doesn't mean it's a good idea...
Who wants to travel?
boring...
Posted: Fri Jan 19, 2007 11:04 am
by nick8325
Brynet-Inc wrote:nick8325 wrote:Brynet-Inc wrote:Anything that should be programmed can be done so in C or Assembly
Sure, and if you want to travel half-way across the world you can walk. It doesn't mean it's a good idea...
Who wants to travel?
boring...
Posted: Fri Jan 19, 2007 12:18 pm
by Candy
Brynet-Inc wrote:nick8325 wrote:Brynet-Inc wrote:Anything that should be programmed can be done so in C or Assembly
Sure, and if you want to travel half-way across the world you can walk. It doesn't mean it's a good idea...
Who wants to travel?
boring...
Agree with nick8325 (that's one of the least original nicknames I've ever seen). If I can write intelligent C++ code that does something in 1000 lines and somebody else can write intelligent C code that does the same in 10000 lines, I'm still off better, especially on the maintenance level. Why use C if you can use assembly and why use assembly when you can use machine language? BA0A01B80900CD21EBFE51454424 (run as COM file in windows/dos).
[edit] Of course I screwed up the offsets. [/edit]