Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What would you change in C?

Name: Anonymous 2009-08-26 13:44

It's the time for the next revision of the C standard and for some reason they want your advice. What do you add, remove, rename, etc ?

Name: Anonymous 2009-08-26 13:46

Add OOP.

Name: Anonymous 2009-08-26 13:49

>>2
as a design criteria rather then a bolt-on

Name: Anonymous 2009-08-26 13:49

>>2
I LOVE YOU! I LOVE YOUR POST! I READ IT 5 TIMES! KEEP POSTING!

Name: Anonymous 2009-08-26 14:00

Inline Python support.

Name: Anonymous 2009-08-26 14:03

Add namespaces

Name: Anonymous 2009-08-26 14:08

>>6
Ding-ding-ding-ding-ding! We have a winner! I'm tired of writing "MyLib_MyFunc()" everywhere.

Name: Anonymous 2009-08-26 14:18

>>7
What syntax would you use? I'd be tempted to just steal Seppples', but I think you could probably get away with hacking the preprocessor to do it instead(using #export and #use or something similar)

Name: Anonymous 2009-08-26 14:27

* Remove pointers
* Add compulsory garbage collection, remove free()
* Get rid of the shitty format strings ("%d %s\n")
* Trash the preprocessor

Name: Anonymous 2009-08-26 14:28

Change the syntax so that all types are capitalized, and all other identifiers are lowercase. Or change the type declaration syntax altogether.

Name: Anonymous 2009-08-26 14:30

>>9
congratulations, you've invented the worst systems programming language ever to exist. I hope your happy.

Name: Anonymous 2009-08-26 14:32

>>10
For a second I almost said "LIKE JAVA?!" but then I realized U actually MENA HASKAL.

Name: Anonymous 2009-08-26 14:34

>>9
* Remove pointers
Why would you do that?

Name: Anonymous 2009-08-26 14:37

>>8
MyLib.h

#ifndef MYLIB_H
#define MYLIB_H

namespace MyLib
{
    void MyFunc();
}

#endif


MyLib.c

#include "MyLib.h"

namespace MyLib
{
    void MyFunc()
    {
    }
}


Client.c

#include <MyLib.h>
using namespace MyLib;

int main()
{
    MyFunc();
    // or explicitly
    MyLib.MyFunc();
    return 0;
}

Name: Anonymous 2009-08-26 14:40

>>14
So, just like Haskell.

Name: Anonymous 2009-08-26 14:49

>>13
Because he is a shitty programmer.

Name: Anonymous 2009-08-26 15:45

>>13
Cause all the kewl pr0gramm3r5 use references AMIRITE?

Name: Anonymous 2009-08-26 15:45

>>2
>>6
>>10
Also true modules, none of this #include "somefile.h" shit (at least not as the only way to split code between compilation units; I'd leave the preprocessor as it is).

Name: Anonymous 2009-08-26 15:50

>>13
Because he's an idiot. All four of his suggestions are shit.

Name: Anonymous 2009-08-26 20:33

some kind of built in dynamic array.

Name: Anonymous 2009-08-26 20:37

nothing

Name: Anonymous 2009-08-26 21:46

Lazy evaluation. Higher order functions. Currying. Algebraic data types.

Name: Anonymous 2009-08-26 21:52

I would remove most of the shit in C99 that nobody has implemented anyway. Other than that, C is perfect and changing it requires renaming the result because it isn't C. I will admit, however, that adding namespaces and function overloading would be nice.

Name: Anonymous 2009-08-26 21:54

>>23 here: I would also like to see someone implement function overloading by return type.

Name: Anonymous 2009-08-26 21:57

Macros that don't suck are the thing it needs most, but the problem with C is that it's not actually powerful enough to write macros in, so any macro system would need to be a completely different language. Ugh.

Name: Anonymous 2009-08-26 22:02

C is the most optimization-friendly language. That is the only thing I care about.

Name: Anonymous 2009-08-26 22:03

A ** exponent operator might be nice.

Name: Anonymous 2009-08-26 22:06

>>27
idiot

Name: Anonymous 2009-08-26 22:24

>>27
That would make it so that x ** y could either mean pow(x, y) or mul(x, *y). This ambiguity is unacceptable, because no compiler can tell the difference.

Name: Anonymous 2009-08-26 22:25

>>29
just use ^ instead.

Name: Anonymous 2009-08-26 22:29

>>30
^ is XOR which I think is a lot more useful than exponentation.

Name: Anonymous 2009-08-26 22:40

>>29
Personally I would rather have function calls than operators anyway.
div(add(neg(b), sqrt(sub(pow(b, 2), mul(4, mul(a, c))))), mul(2, a))

Name: Anonymous 2009-08-26 22:42

#deffine operators! oh wait we can do that already

Name: Anonymous 2009-08-26 22:56

>>32
Back to /scheme/, please.

Name: Anonymous 2009-08-26 23:10

>>34
/scheme/ is just a symlink to /prog/

Name: Anonymous 2009-08-27 1:38

>>30
What about ^^^?

Name: Anonymous 2009-08-27 3:28

>>24
C's type conversion rules are already enough of a pain to remember without adding even more confusion. I never liked overloaded function arguments either, for this exact same reason.

>>36
There's the question of why you'd want an exponentiation operator in a systems programming language in the first place. Use FORTRAN for maths please.

Name: Anonymous 2009-08-27 3:32

I'd like to add the following:

1) A universal way to link libraries, i.e:
#inclib("libc");

2) Standard GUI , like allegro etc, but as a standard c library.

3) Standard Sound , sort of the same as the above.

4) Allocation function, like malloc, but that you can choose the virtual offset, like VirtualAlloc on windows.

Name: Anonymous 2009-08-27 3:35

>>38
OHHHH, also a Standard C Library for multi threading and chmod etc.

Name: Anonymous 2009-08-27 3:39

>>1
D is the next revision of the C.

http://www.digitalmars.com/d/

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List