A Completeley Redesigned C library

Programming, for all ages and all languages.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

A Completeley Redesigned C library

Post 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?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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 :lol:

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
Last edited by Brynet-Inc on Thu Jan 18, 2007 6:27 pm, edited 1 time in total.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post 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.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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 :P While it has a few basic functions.. It's not the most standard library around. :wink:

In reality it really depends on the programmers preference bud.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

What features would you want in an operating system's C library.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

I'm not sure.. I like standards.. but in any sense..

magic() - Undocumented secret function to make Brynet-Inc smarter.. hehe
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Post 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...
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

What about a C version of something like the C++ Boost library? Very high level C.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

That's almost as sad as defining:

#define PLUS +
#define NEGATIVE -
#define GREATERTHAN >
#define LESSTHAN <

:roll:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

Brynet-Inc wrote:That's almost as sad as defining:

#define PLUS +
#define NEGATIVE -
#define GREATERTHAN >
#define LESSTHAN <

:roll:
? What's wrong with the Boost libraries? They're well made, and cross platform. For high level coding, what else could you want?
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Anything that should be programmed can be done so in C or Assembly.. Anything that can't.. Shouldn't :wink:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post 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...
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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? :wink: boring...
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post 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? :wink: boring...
:)
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post 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? :wink: 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]
Last edited by Candy on Fri Jan 19, 2007 3:35 pm, edited 1 time in total.
Post Reply