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

Additions to C

Name: Anonymous 2009-11-10 4:15

What do you want in the next C standard? For me it's namespaces, damn they make libraries simple.

Name: Anonymous 2009-11-10 4:37

Anonymouse functions (standardize clang implementations).
Optional GC.
Templates.

Name: Anonymous 2009-11-10 4:43

Classes

Name: Anonymous 2009-11-10 5:10

Closures.

Name: Anonymous 2009-11-10 5:28

An IO class that makes IO easy.

Name: Anonymous 2009-11-10 5:36

>>5
C IO _is_ easy. C string manipulation is a royal pain in the ass, hence the need for sane template library with common containers.

>>3
Kind of. I'd be perfectly happy with classes but no inheritance whatsoever. Or maybe completely statically resolved inheritance only.

Name: Anonymous 2009-11-10 5:53

Native higher-order functions.

Name: Anonymous 2009-11-10 5:58

Namespaces.  Improve/widen the standard library.

Name: Anonymous 2009-11-10 6:09

a string type. that's all

Name: Anonymous 2009-11-10 6:40

FIOC

Name: Anonymous 2009-11-10 6:47

Higher order functions and lambda calculus.

Name: Anonymous 2009-11-10 7:10

Nothing, adding this shit you write will be like creating seeples out of it.

Name: Anonymous 2009-11-10 7:18

ONE WORD THE FORCED INDENTATION OF CODE

Name: Anonymous 2009-11-10 7:58

>>13
It wasn't one word.
HIBT?

Name: Anonymous 2009-11-10 10:56

>>12
not if it has GARBAGE COLLECTED PRIMITIVES

Name: Anonymous 2009-11-10 11:11

Enterprise-grade scalable virtual infrastructure leveraging JIT cloudsourced e-readiness.

Name: Anonymous 2009-11-10 11:34

Replace #includes and forward declaration with formal units and interfaces. Rip out half the syntax nobody uses. Trash free-form macros. Now you don't need to rely on $multi-billion companies to write parsers for you, and l33t fags can't write unreadable premature optimized code. It should also be easier to make an optimized compiler. Finally add arrays and strings as a native data types with bound checking, eliminating 90% of the bugs and security holes.

The sooner we can cut our losses with C, the sooner the software industry can start improving again.

Name: Anonymous 2009-11-10 11:36

>>16
You, sir, have a promising career ahead of you in Product Development and/or Marketing.

Suggest you...
- forget this faggot programming shit
- learn to schmooze it up like a pro
- network; not as in iBGP, OSPF, RIP and friend, more like the Old Boy Netork, the Bro Network, etc
- learn to play golf
- visit the Men's Warehouse for some tailored suits
- wonder what to do with all that money you'll be making (broad portfolios is these days especially, with a good position in precious/strategic metals)

The rest of us will still be here snickering at the Lispfags, wringing our hands at the FIOC, complaing about some shit or other, and generally being dorks here in Dilbertland

Name: Anonymous 2009-11-10 12:05

>>1
namespaces
Are an ugly hack. Stop giving your identifiers nondescript names, and you won't need them.

>>2
Optional GC
http://www.hpl.hp.com/personal/Hans_Boehm/gc/

Personally I'd like to see some native coroutine support, or at least yield(). At the moment I'm using some library for this, but it's quite clumsy and involves a lot of extra code on both the generator-function and the calling function.

int coroutine() range(int lo, int hi) {
    for (int n = lo; n <= hi; n++) {
        yield(n);
    }
    return EOF;
}

void something() {
    int coroutine() gen = range(1, 10);
    int value;
    while ((value = gen()) != EOF)
        printf("generated %d\n", value);
}


The sentinel value is the responsibility of the program, which might make some kinds of functions slightly more complicated, but would greatly simplify the implementation and would introduce minimal changes in the language. One could also conceivably make a coroutine(int), coroutine(char *), etc., much like Python, wherein the yield() returns the value passed via gen().

Name: Anonymous 2009-11-10 12:12

>>18
lol @ truth in /prague/

Name: Anonymous 2009-11-10 13:01

>>17
Rip out half the syntax nobody uses
Such as?
Now you don't need to rely on $multi-billion companies to write parsers for you
0/10 because everybody uses free compilers (ie. gcc, and anything GNU is certainly not a "multi-billion dollar company")
and l33t fags can't write unreadable premature optimized code
Eh, stupid people will write stupid code no matter what we do to the language.
Finally add arrays and strings as a native data types with bound checking, eliminating 90% of the bugs and security holes.
I can actually agree with this, but ONLY if the current way of using strings/etc. is still allowed and existing code isn't broken (considering how much software is already written in C I doubt they will ever standardize something that would break legacy code)

Name: Anonymous 2009-11-10 13:31

>>1,19
Wtf? Namespaces are not a hack. This doesn't result from non-descript names; virtually all widespread C libraries manually namespace their functions (png_, sqlite3_, etc.; a notable exception is zlib). They have to do this regardless of how 'descript' their names are. Do you really want all of libpng's functions available to your linker without the png_ prefix?

Namespaces would be nice, but I doubt it will ever happen. There's just no way to add it in a backwards compatible way; it requires name mangling. Anyway, having to add a short prefix to all your functions is hardly a big deal, and it doesn't hinder code readability too much.

>>3,6
C already has these things. Embarrasingly, C structs are better than C++ classes, because by forward declaring structs they allow real information hiding without causing massive recompilation of dependencies when a class changes.

There are provisions in the type aliasing rules which allow inheritance and polymorphism; this is how Python's object model is implemented. You can add function pointers for virtual functions, which is hardly more difficult than its C++ counterpart, and has many advantages; there aren't bizarre "member-function pointers", you have more control over how the vtable is assembled, etc. The only thing C doesn't do is automatic pointer conversions up the inheritance tree, which in my opinion is A Good Thing.

>>6
C string manipulation is a royal pain in the ass, hence the need for sane template library with common containers.
Um, epic fail? Why the fuck do you need *templates* for a string library? There are excellent string libraries for C that don't rely on templates at all, like bstring.

>>19
would greatly simplify the implementation and would introduce minimal changes in the language
Minimal changes, really? Didn't knuth say coroutines would require eliminating the concept of a stack? Seems it would take a shitload of work; converting all local variables of coroutine functions into thread-local globals, etc.

Even if the changes are minimal, no compilers currently support this, and no one is really asking for it. Adding it to C1X would actually hinder its uptake; people wouldn't bother with C1X because they wouldn't want to implement the harder parts like this.

>>19
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
A library for GC is not equivalent to built-in compiler-supported GC because the library doesn't know whether something is actually a pointer. If a random bit pattern happens to look like a pointer, the GC has to assume it's a pointer so the memory survives longer than it should; entire trees fail to be reclaimed because of this. It also prevents heap compaction because you can't move memory, which is a fairly critical part of modern GCs in performance-tuned languages like *shudder* Java.

That said, I don't think C needs GC. Memory management in C programs is not that difficult because it doesn't have exceptions, threading, etc. When you add a threading library things can get complicated, but threads are evil; they should be as isolated as possible to begin with. Freely available malloc() implementations these days are extremely fast and good at preventing fragmentation. Nothing says you have to use the platform's malloc(); it's easy to replace with a better one.

Personally, what I'd like to see is standardized syntax and required support for many function and variable attributes in use (not the dllexport/dllimport types, but rather the ones that affect code generation, i.e. structure packing).

I'd also like to see some commonly used, but technically illegal, idioms be standardized, like using a union for type aliasing.

What I *DON'T* want to see is microsoft's 'safe' versions of stdlib functions making it into the standard, like the incredible bullshit that is memcpy_s. Unfortunately this is apparently one of the standard committee's priorities for C1X.

Name: Anonymous 2009-11-10 13:40

Remove complex numbers.  Why the fuck were they worrying about that garbage when there are so many better things they could be fixing with C?

>What I *DON'T* want to see is microsoft's 'safe' versions of stdlib functions making it into the standard, like the incredible bullshit that is memcpy_s. Unfortunately this is apparently one of the standard committee's priorities for C1X.
Seconded.  I wish there was something I could do about it.

Name: Anonymous 2009-11-10 13:56

>>22
microsoft

safe

HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH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HAHAHAHAHAHAHAHAHAHA

Name: Anonymous 2009-11-10 14:05

What's wrong with Microsoft's "safe" libc equivalents? There's quite a few functions which are outright unsafe or can lead to bugs, and all Microsoft's "safe" functions provide is a way to limit things like buffer size to prevent many overflows, however there are plenty of such functions already in libc, and some of Microsoft's functions are just plain redundant, but not all of them.

Name: Anonymous 2009-11-10 14:23

>>1-25,27-
Use C++.

Name: Anonymous 2009-11-10 14:32

ADD LIST PROCESSING.

Name: Anonymous 2009-11-10 14:35

>>25,26
I lol'd

Name: Anonymous 2009-11-10 14:36

>>22
C doesn't have threading
what.

Name: Anonymous 2009-11-10 16:03

>>22
Seems it would take a shitload of work; converting all local variables of coroutine functions into thread-local globals, etc.
Globals, what?! You stuff the coroutine's state inside the stack frame of the function that calls it (within something(), in my example). The compiler could insert whatever boilerplate is needed to make this work, so that the programmer no longer needs to. At the moment, I have to make structs for any coroutine I write, and pass these around. This is annoying.

The point is, coroutines have already been implemented several times at the library level, they have been proven useful by the numerous other languages that support such a feature, it would not be thoroughly difficult to add in compiler support for the feature, and it would make for much cleaner code for applications that currently rely on libraries to accomplish the same thing (not to mention applications which use kludges to work around the lack of natively supported coroutines).

Name: Anonymous 2009-11-10 16:04

>>29
I believe they're talking about vanilla ANSI C's standard library. On any modern platform, C is capable of threading, networking, exceptin handling, and many other things, in non-standard, but well documented(extensions) ways. Effectively, you can do practically anything imaginable with third party libraries or libraries you build yourself, they're just not standardized.

This is a fairly common type of whining present in many languages which have been standardized in one form or the other. For example, Common Lisp is sntadardized and has a pretty rich standard library, but at that time threading, networking, FFI were not considered things on which people could agree on a common ground or were considered things which would reduce the chance of portability of the language to all kinds of obscure platforms, so they were never included in the standard. Now you see people say/whine that you can't do all kinds of low-level things in CL, when you have de-facto portable libraries for doing FFI, threading, networking. (De-facto means that someone spent some time to write a thin portability layer on top of whatever many of the popular implementations probide under the hood(documented) for doing these kinds of things). Practically, you can write your code using these libraries and achieve full portability, but people will still while because it's not engraved in the golden standard that every implementation must obey, lest they be deemed non-conforming.

Name: >>31 2009-11-10 16:07

...damn, I sure made a lot of typos in that post. That's what I get for typing while half-asleep and being too lazy to double check what I wrote.

Name: Anonymous 2009-11-10 16:15

>>32
That's what I get for being a lazy nigger.

FTFY

Name: Anonymous 2009-11-10 16:16

>>30
You stuff the coroutine's state inside the stack frame of the function that calls it (within something(), in my example).
Isn't this quite a limitation that normal coroutine support doesn't have? Why does each call to a coroutine have to happen from the same function? Why can't several different functions call a coroutine? Why can't the coroutine be thread-safe?

No, to implement coroutines properly you need to do what Knuth said; get rid of the stack.

Name: Anonymous 2009-11-10 16:23

>>31
Well, POSIX is a fine standard.

Name: Anonymous 2009-11-10 16:24

>>34
Well, sure, it could be allocated and memcpy'd and so on, in much the same way as any other stack variable.

Name: Anonymous 2009-11-10 16:35

>>25
They are all stupid. For instance strcpy_s and strcat_s already have strncpy and strncat. memcpy already has a length argument in it; what the fuck is the point of adding another in memcpy_s? And printf_s, supposed to be safe, doesn't actually do anything at all except not print if a format character is unrecognized. Nevermind the fact that printf is hideously unsafe with dynamic format strings and printf_s does nothing to alleviate that.

Tell me a single one of these _s functions that is actually useful.

Name: Anonymous 2009-11-10 16:36

>>36
Is it really native coroutine support if you have to pass around the function's state yourself?

Name: Anonymous 2009-11-10 17:12

>>37
I just looked up memcpy_s because I was curious. Seriously, WTF?!?!

Name: Anonymous 2009-11-10 17:55

>>39
"WTF"? Surely, you haven't seen strncpy_s - that's just plainly fucking ridiculous.

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