>>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:
Anonymous2009-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:
Anonymous2009-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.
>>13
Cause all the kewl pr0gramm3r5 use references AMIRITE?
Name:
Anonymous2009-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).
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.
>>23 here: I would also like to see someone implement function overloading by return type.
Name:
Anonymous2009-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:
Anonymous2009-08-26 22:02
C is the most optimization-friendly language. That is the only thing I care about.
>>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.
>>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:
Anonymous2009-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:
Anonymous2009-08-27 3:35
>>38
OHHHH, also a Standard C Library for multi threading and chmod etc.
>>51
i think bound checked arrays would conflict with malloc() and such.
Name:
Anonymous2009-08-28 12:44
I would make bumping part of the C standard
Name:
Anonymous2009-08-28 13:57
>>54
No. When allocating a bound-checked array, you pass malloc() the size of the actual data, plus the size of a pointer to the last element. Or just the length of the data, I suppose, if you can manage a type system that handles it well enough. That way, it's one contiguous block of memory that you can free() whenever needed.
There should still be "raw" arrays so programmers can shoot their toes off, but there should also be a typesafe foreach loop of some sort to give them the opportunity not to pump their shoes full of lead.
Name:
Anonymous2009-08-28 14:32
>>52
Yes, everyone can agree that BASIC is terrible, but you don't like Pascal's syntax? Seriously?
>>59
Pascal has AIDSful semantics. It adheres too closely to the philosophy of structured programming, which is basically a misguided attempt to implement an FP-style data flow in an imperative context.
>>63
Actually, >>62-chan makes an eerie sort of sense. Structured programming restricts you to one straightforward control flow through any given procedure, including one return statement. It's basically an elaboration on "GOTO considered harmful"
OOP in its purest form is just one way to abstract. It may work for some types of programs (window managers, games, large frameworks,...), but for others it may be unneeded. OOP is good when it's not forced and suits the problem domain, but at the same time you can use it or implement it without the language having support for it. You can write in an OOP manner in C, by just designing data structures and making functions which operate on them. Add some tagging/inheritance mechanism using the structures fields and you have OOP. On more capable languages like Lisp-based languages, it's possible to implement OOP in the language itself, even though CL has CLOS in the standard, but actually implementing a simple message passing interface can be done in a page or two of code. I think that CLOS' way of not forcing methods to be connected with data structures gives you what's best of OOP: extensibility, without actually having to forcibly link that method to some data structure. That way generic operators can be designed which work with all kinds of objects. The most common example of such an operator would be generic arithmethic operations:
(+ fixnum fixnum)
(+ fixnum integer)
(+ bignum bignum)
(+ bignum integer ... bignum) and so on, the actual result's type depends on the input's actual data.
What I'm getting at is that OOP is not bad by itself, and it should be used where it provides some advantage, but it should never be forced or unnecessarily restricted by other concepts. If you keep OOP as just a generic way to extend functions and keep structures with (single or multiple) inheritance of fields/slots separate, then it's fine.
What's called OOP in these days, C++, Java, is nothing more than a forced combination between the concept of method and structures with inheritance, which by itself is a common usage of OOP, but as a general concept it's bad and just leads to people inventing patterns to work around this forced limitation.
>>68
Lua did OOP right in my opinion, by implementing inheritance as a simple assignment of metatables containing methods and data. This is a vast improvement over strict OOP because it can flex when you need it to without complicated polymorphism or more obscure methods of using OOP to solve problems that are almost, but not quite, perfectly suited to OOP. When the problem fits well in the domain, great; when it doesn't, that's fine, too.
Name:
Anonymous2009-08-29 2:14
>>72
OOP design is fucking easy when you use UML. I have absolutely no problem using Java or C++ when I write my code because I code it to my system design. It sounds like you write code without any formal system design. Hacking non-trivial systems in this manner is a waste of time and gives you problems just as you describe.
Name:
Anonymous2009-08-29 2:22
>>73
fuck, I'm supposed to draw a bunch of diagrams every time I write a program? Fuck OOP.
>>74
Exactly. Draw a bunch of boxes, write some labels in them, and then complete with arrows. It is fucking easy and removes any doubt about the class logic.
UML leverages core skillsets and world-class diagrams to provide clients worldwide with robust, scalable, modern turnkey implementations of flexible, personalized, cutting-edge Internet-enabled e-business application product suite e-solution architectures that accelerate response to customer and real-world market demands and reliably adapt to evolving technology needs, seamlessly and efficiently integrating and synchronizing with their existing legacy infrastructure, enhancing the e-readiness capabilities of their e-commerce production environments across the enterprise while giving them a critical competitive advantage and taking them to the next level.
Name:
Anonymous2009-08-29 5:48
More precisely and usefully defined semantics for "volatile", memory barriers, multithreading and similar things a modern systems programming language needs.
Rules for the more arcane shit in the language rewritten so they're understandable by normal people.
Name:
Anonymous2009-08-29 14:33
I'm not sitting down and drawing some fucking complicated diagrams every time I write code
Name:
Anonymous2009-08-29 15:14
All I want is to be able to evaluate C expressions at the command prompt. Is there a way I can do this on my Macintosh™?
>>86
Order of evaluation has nothing to do with this.
Name:
Anonymous2009-08-29 17:04
case statements shouldn't require constants. const should create compile time constants. a real type system, so things like int string = "string"; or
sin("string"); are not possible. No goto statement.
Name:
Anonymous2009-08-29 17:20
[MC Ren]
Yeah nigga, MC Ren up in this motherfucker
(West West y'all)
Yeah, L.A. niggaz
L.A. niggaz rule the world nigga
Y'all niggaz gotta recognize, yaknahmsayin?
Niggaz don't wanna peep game, yaknahmsayin?
But this shit come all the way back around here
My nigga Dre, droppin heat box on y'all bitch-ass
Yaknahmsayin? You gotta recognize
L.A. niggaz, connected all over the
motherfuckin world, nigga
Recognize this *grabs dick*
[Time Bomb]
Now in my younger days I used to sport a rag
Backpack full of cans plus a four-four mag
G'd from the feet up
Blued up from the sewer's how I grew up
Loc'n, smokin and drinkin til we threw up (threw up)
At Leimert Park, taggin, hittin fools up
Ditchin my class, just to fuck yo' school up
You don't wanna blast, nigga tuck yo' tool up
But don't sleep, y'all niggaz quick to shoot you
Now there's another motherfucker with no future
But Time Bomb much smoother when I
manuever, dope like Cuba
Got em jumpin *King T starts speakin, indecipherable*
[King T]
I'm comin "Straight Outta
Compton" with a loose cannon
Smoke big green, call it Bruce Banner
Watch your manners, at last another
blast from the top notch
From way back with the pop rocks, I pop lock witcha
Picture this, Dr. Dre twistin wit Tha Liks
and Hittman bought a fix
Don't trip, it's a Time Bomb in this bitch
Here it tick tick tick tick *BOOM*
Wait a minute it's on, I tell it like a true mackadelic
Weed and cocaine sold seperate, check it
From sundown to sunup -- clown done run up
The Aftermath'll be two in your gut, nigga what?
We roll deep, smoke on weed drink and pack heat
Requirements for survival each day -- in L.A.!
It don't stop, we still mash in hot pursuit from the cops
Analyze why we act this way -- in L.A.!
[Hittman]
Gimme that mic fool, it's a West coast jack move
They call me Hitt - cause I spit like gats do
cock me back
Bust caps for my max crew, at Fairfax
who used to wear Air Max shoes, that's true
But I grew up where niggaz jack you, harass you
Blast you, for that set you claim (where you from?)
Mash on you for your turkish chain, C.K. B.K.
Blued up or flame, I ran wit a gang
I helped niggaz get, jacked for they Dana Dane's
My pants hang below my waistline
I look humble wanna rumble? (yeah yeah)
I bang though, like Vince Carter from the baseline
don't waste my time
Fuck a scrap in killa Cali, AK's and 9's
One-time's, sunshines, and fine-ass bitches
Hawaiian thai, drive-by, six-fo's on switches
[Xzibit]
I was raised in the hood called WHAT-THE-DIF'
Where the brothers in the hood, refused to go Hollywood
Slugs for the fuck of it
Anybody hatin on us can suck a dick
If I catch you touchin mine you catch a
flatline, dead on the floor
Better than yours, drivin away gettin head from a whore
It's AvireX-to-the-Z
Fuckin with me might get you banned from TV,
cassette and CD it's all mine the
whole nine the right time
Multiply, we don't die, the streets don't lie
What, so neither do I, I'm bad for your health
like puttin a pistol up to your face and blastin yourself
[Defari]
Five in the mornin, burglars at my do'
Glock forty-five in my dresser drawer
Let em come in BLAOW he see the thunder roll
Roll with niggaz, who by fifths by the fo'
and bruise by the case
SLAP YOU in the face with the bass, Dr. Dre laced
Likwit Kings wit Sedans and gold rings
Haters fold the style, but can't find no openings
Chorus
[Outro]
In L.A.
Name:
Anonymous2009-08-29 17:34
>>88
As soon as you want a real type system, you're outside the realm of what C is actually for. (Although, you're still inside the realm of what C gets abused for.)
No goto statement.
Having goto in C isn't harming anybody. If newbie/retarded programmers accidentally use it then so be it; inexperienced people will make mistakes like that no matter what you take out of the language. I don't think you have any idea what you're talking about. case statements shouldn't require constants.
This I might actually agree with. Someone correct me if I'm wrong to think so.
Alef is/was a language developed at Bell Labs. It's basically C but with more coolish stuff and some cleaning up. It's also a Jewish letter equivalent to A or Alpha.
>>117
In a nutshell:
1. You have to game the runtime in order to make sure scheduling is done effectively.
2. I have a collection of dynamically allocated channels I need to poll. The official solution is to spawn a number of goroutines to select on them in static groups because the existing select is O(1) and it would be a shame not to use that, or alter its behavior to cover new areas.
3. It's a concurrent language without a whit of tail call elimination.
4. The near elimination of semicolons is a compromise between the stupid and the unnecessary. It's a flippant decision.
I could go on, but honestly I'd probably STFU if just the above was fixed. #1-3 are dealbreakers, #4 is just supremely annoying.
Name:
Anonymous2010-04-29 11:40
>>92
I thought that's how switch statements are optimized by the compiler. I could be wrong here.
>>92,120
As >>120 speculates using constants produces much faster code. I remind myself of this every time I am inconvenienced by it. (The problem isn't so much evaluating a matching expr here or there, it's in eliminating it when it doesn't match--you might as well if-else if- cascade performance-wise. There's also the issue of expression overlap which muddies the notion of a switch, but that's just a nit.)
There’s this thing that’s alwasy bothered me… Why in the world do I have to end a struct or enum declaration with a semicolon? The declaration is already enclosed in curly braces, no need for anything more than that.
Make all numbers binary by default, the only other allowable numeric format/representation will be base64
Name:
Anonymous2010-04-29 16:58
>>126
You should try Common Lisp.
You can do this just by setting or binding *read-base*/*print-base* to 16 and maybe *print-radix* to t(only set those that you want. print is for output generated by your application, read is for read input, which also includes the source code which is to be compiled. *print-radix* will allow the base to be included in the output, #x for hexadecimal). I used to try setting them both to 16, but that proved to be a bad idea, some variables got treated as numbers (think of :a,b,c,d,e,f,ab,deadbeef,fade,babe, etc). It's best that hexadecimal numbers be prefixed by something, so that that they don't conflict with normal indentifiers. So currently, I don't rebind/set *read-base* unless I absolutely need it, and I know it would be safe. I do however set *print-base* to 16 and *print-radix* to t, as I prefer numbers to be printed in hex by default.
Make all numbers hexadecimal by default, and digital only if you put 0d in front of them.
so numbers would be analog unless they have 0d in front of them?
Name:
Anonymous2010-04-30 8:38
The only thing C needs, really, is native quaternion support.
Name:
Anonymous2010-04-30 9:16
>>134
I also miss unicode support and/or TeX-like markup, so I could name my variables \psi and \lambda and my editor would show them as proper symbols, ideally even storing them in the file as such (i.e. UTF-8 encoded). Without this C just feels slightly antiquated and inadequate for my specific requirements.
Name:
Anonymous2010-04-30 9:36
Little thing with a few example includes I'd like to see:
Also, this is mostly taken from C++ and Python /********
** ++C **
********/
// OOP
class board {
init:
// I like the 'init:' header, but this will
// need to be changed in order to work properly
initclass(int boardCols, int boardRows) {
int boardX = boardCols;
int boardY = boardRows;
}
private: //As C++, but can use vars from init:
int boardX;
int boardY;
public: //As C++, but can use vars from init:
bool board[boardX][boardY];
>>135
IIRC there's nothing in the standard that says that source files can't be UTF-8, and your "TeX-like markup" is an editor misfeature, not part of the language.
Name:
Anonymous2010-04-30 10:49
>>136
Several of these features ruin C for the tasks where it's the most useful.
If you want a high level language, start with Python, Lisp, or Haskell.
add directx to the standard lib so u can use it to make games
make it so u dont have to remember the ; everywhere, when its a new line it should now what i mean lol.
>>144
integral types of specific sizes are specified in C99's stdint.h
also, not sure why you would need binary literals; hex representation is so much nicer and I can do the conversions in my head