This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
241
Announcements / Re: Bugtracker Act III Scene II
« on: June 26, 2010, 06:53:26 am »
Next thing should be OpenID support.
242
Announcements / Re: Battling
« on: June 19, 2010, 09:05:55 am »
Not sure how to deal with DLLs, but usually I'd compile my source code with option '-g', then call "gdb executablename", then use command "run" and then, after it crashed, "backtrace".
243
Announcements / Re: Battling
« on: June 18, 2010, 08:11:00 am »
Can't Ism compile in debug mode and then use gdb so she can tell you exactly where is ENIGMA segfaulting?
244
Tips, Tutorials, Examples / Re: Which should I use?
« on: June 10, 2010, 12:29:16 pm »
You're missing the [][] in all cases, not just the first.
In this case, all three are basically the same. However, note that when *calling* the function, there are differences(array vs &array. when using plain integers instead of int** or int[][] there's also the problem of using constants with reference members).
Finally, if instead of int[][] we were talking about some big data member, such as a huge class/struct, then using the * or & would be use less memory and would probably be faster.
In this case, all three are basically the same. However, note that when *calling* the function, there are differences(array vs &array. when using plain integers instead of int** or int[][] there's also the problem of using constants with reference members).
Finally, if instead of int[][] we were talking about some big data member, such as a huge class/struct, then using the * or & would be use less memory and would probably be faster.
245
Announcements / Re: Tentative Todo
« on: June 07, 2010, 02:30:00 pm »Quote
I just imagine the game and enigma reads my mind and makes my game better than I could've imagined.But does that fit in a single bit like Josh claimed?
246
Announcements / Re: Tentative Todo
« on: June 07, 2010, 01:19:12 pm »Quote
truly amazing (...) in a bitAre you going to announce that ENIGMA R4 is so efficient that games written in it can fill in a single bit?
247
Announcements / Re: Tentative Todo
« on: June 06, 2010, 12:02:19 pm »
If These is a type, wouldn't a typedef be better than a #define?
248
Quote
"Also, that same bloat can get in the way of adding new features to C++."Well, judging by the horrible ugly syntax of lambdas in C++0x, it would appear they don't have many options without introducing syntactical ambiguity.
Care to give an example? Lately it shouldn't appear the committees are having any trouble introducing new features to the language.
Quote
Singularity's one screen shot was so transparently propaganda-laden it made me sick.Well, Singularity's core innovation was being in pseudo-C#(I think it's not exactly C#, but I can't remember), so obviously there wasn't much impressive about it aside from that fact and, therefore, being written in C# was probably the only notable detail about Singularity.
Quote
Of course, C# is my least favorite example of such languages, and there are far better ways of accomplishing type safety that don't end up removing mad pointer tricks as a method of accomplishing something.That could be the root of our disagreements. C# is my favorite language(although I notably hate C# APIs).
BTW, C# has pointers. Both IntPtr(a nice safe way to deal with them) and ordinary *& C syntax. The first way is often used with P/Invokes. The second way requires the "unsafe" keyword to be used since, well, it's unsafe. I never needed to use the second syntax. The first syntax I only used for P/Invokes.
Quote
...Until you need to pass arguments that aren't strings.Well, Brainfuck has integers. It can represent any type C can. It can represent pointers(in fact, Brainfuck is designed on the concept of pointers), it can represent integers, floating point(see IEEE 754 for how to represent float in integers), it can represent characters and, with that, it can represent strings, structs and unions. So, basically, Brainfuck(with those few command extensions) could do anything.
249
Quote
As a language, C++ is fairly bloated. That bloat doesn't really get in your way unless you are trying to parse it. The output is typically far from bloated, though there are slight amounts of overhead if you utilize more than C would give you alone.The first sentence is pretty good. The bloat doesn't usually get in the way but it exists. Also, that same bloat can get in the way of adding new features to C++.
When a language has too many things in it, optimizing becomes problematic. Just look at the restrict keyword. Usually, adding features harms writing optimizers, and then you have to add yet more features to opt-out of features you don't need.
Quote
"Eventually, something will be written in C(the kernel, perhaps?). Heck, there are things that should really be written in C(or at least have a public C ABI), such as system libraries. However, this does not apply to applications."Please note that in this sentence, I was specifically referring to C, not C++. C++ ABI is stupid.
Quote
integrated circuitry designed to implement a garbage collectorI would need to see how it was being implemented, how efficient it was, what it lacked, if it was opt-in or opt-out, etc. etc. before jumping to conclusions.
Then again, different GCs often have different purposes. Some GCs are designed to be fast, others to be small, others to be simple, others are specifically designed for code locality. GCs are a fertile investigation field, and I'm not sure an integrated circuit would be the best way to implement GCs simply because GCs change and then we'd be stuck with an outdated one.
Your claim is that only C++ is used for big applications for reasons such as efficiency, power, or something like that. My claim is that C++ is used for big applications because when those big applications were started there was nothing better or because they were started as C.
Quote
Try opening a file.Ok. I can just add a few extra commands to Brainfuck. Say, ' to open file to write, " to open file to read, « to read from file and » to write to file.
Would this somehow convince you to use Brainfuck?
250
Proposals / Re: Recursion
« on: June 04, 2010, 04:49:14 pm »
By RetroX's definition, there are no infinite loops, then.
Also, kernels don't need to have main methods. They often have some sort of replacement, but the name "main" doesn't imply being the entry point in kernels.
Also, kernels don't need to have main methods. They often have some sort of replacement, but the name "main" doesn't imply being the entry point in kernels.
251
String reference counting is a type of garbage collection. So I guess that means C++ STL does have GC. Too bad it's so limited.
The number 1 reason C++ is so widely used is legacy.
Had Excel started been developed today, would its team still pick C?
Eventually, something will be written in C(the kernel, perhaps?). Heck, there are things that should really be written in C(or at least have a public C ABI), such as system libraries. However, this does not apply to applications.
The "go fast or go high level" is another false dichotomy fallacy.
Quote
You'll probably notice that the more the language does for you, the less large projects are successfully written in it.Are you seriously suggesting that languages such as C# are unable to deliver?
Quote
Either way, the majority of these posts is fluff. Every language has its purposes; I wouldn't want Geordi written in anything other than Haskell, because Haskell got the job done far faster and probably far more cleanly than C++ would have. It simply doesn't need that speed.Glad you will admit that.
Quote
Maybe some day, Microsoft will fix that.False dichotomy. If it is efficiency you want with some minimal high-level tools, then why are efforts such as D so rare and why have they all failed to get any success?
The number 1 reason C++ is so widely used is legacy.
Had Excel started been developed today, would its team still pick C?
Quote
If you want anything sizable that runs fast, you'll need something lower level at some pointWhich is why we have P/Invokes, JNIs and optimizers.
Eventually, something will be written in C(the kernel, perhaps?). Heck, there are things that should really be written in C(or at least have a public C ABI), such as system libraries. However, this does not apply to applications.
The "go fast or go high level" is another false dichotomy fallacy.
Quote
And since programmers get paid by the hourThen you should pick the most productive tool, which is definitively not C++.
Quote
I wouldn't have ENIGMA coded in any other way.Will you at least admit C++ has lots of legacy junk nobody needs anymore? Because that's what this discussion was about - the claim that C++ was bloated.
252
Quote
know what is a pointer and what is not, and that is impossible in C++.You disagree with this, Josh?
Tell me, how many variables are pointing to 0x043030FE in your program. You can't ever be sure in C++. In Java, you can.
So you're left with few options:
1. You use something like Pointer<T> instead of T*. It's ugly, you still need to figure out circular references(which somehow means you need the stack trace too, yet another problem C++ makes hard to solve). You can of course just have a simple reference counter and somehow hope nobody messes around with it. Possible and I've used this method before. Still, templates mean worse compile times, harder-to-read code, and it's still unable to deal with cyclic references.
2. You iterate through the whole memory and build a conservative memory collector. Less painful to handle since you can use ordinary pointers, but it's still vulnerable to circular references and it can't be sure whether something is a pointer or something else. Say, if an integer has value 0x043030FE for some unrelated reason, a leak occurs.
3. You use macros or something else to register the stack.
Code: [Select]
void myfunction(StackPosition& pos) {
pos.push();
Pointer<int> p(pos, new int(5));
pos.pop(); //p is released here
}
that plus several more tricks could possibly solve, but it's simply pain ugly and makes code readability worse.4. You use something like a C++ preprocessor to automatically generate solution 3 in a pretty way. At this point, you can barely call it C++.
Destructors are useful, and garbage collectors could be built to take advantage of them. However, while destructors can simplify some memory management, they aren't enough by themselves to replace GCs.
Quote
People get used to strings; I myself have become spoiled by them, and feel so every time I use them. C gave no way of returning new strings, save allocating them yourself. With C++, std::string is a great example of how the annoying bits are handled for you. String keeps its own reference count at the beginning of the char* in memory. When you return a string in C++, the constructor of the new string increments that count, the destructor of the old string then decrements it, and a string is returned with no manual allocation.Shame on them. They dared to automatically dispose of strings in C++? BUT THAT'S SO INEFFICIENT!!!
That aside, strings in C++ are often much better than const char*s, for similar reasons that GCs are often much better than manual memory freeing system.
Quote
Is it possible to get C++ to wipe all the memory management ickiness off your ass for you? No.Therefore, when it comes to wiping out the memory management ickiness, other languages are better.
Quote
Personally, all considered, I prefer it that way.For some use-cases, that indeed is the best way.
For most applications, memory management is not the problem we're trying to solve. We're trying to render a document, to figure out what 3D position the 2D mouse click refers to in the computer game or what GM version the read file refers to. In those cases, memory management is an obstacle.
Either way, regarding bloatness, a quote from one of Go's designers:
Quote
it wasn't enough to just add features to existing programming languages, because sometimes you can get more in the long run by taking things away.
253
Yes, I know. I have created a reference counter for my C++ code.
But the fact is, GCs for C++ will always have less quality than GCs of languages specifically designed to use GC.
Also, you can do anything you want in Brainfuck.
Finally, don't call somebody arguments invalid just because you're too closed-minded to understand them. Is this a fallacy? Not any more than your arguments, so you can't complain.
But the fact is, GCs for C++ will always have less quality than GCs of languages specifically designed to use GC.
Also, you can do anything you want in Brainfuck.
Finally, don't call somebody arguments invalid just because you're too closed-minded to understand them. Is this a fallacy? Not any more than your arguments, so you can't complain.
254
I have no doubt that if we could just forget legacy and design C++ from the bottom up, we could come up with something really good.
Unfortunately, C++ is not that language.
Even though I don't think C++'s feature set is needed for the vast majority of applications, one can actually see how it can be useful. But just not C++. C++ has so much legacy that adding anything to the language is painful.
Also, C++ isn't infinitively extensible. At some point, it's better to just design a C++-made VM and use something else. Garbage collection(yes, it is useful) is notably bad in C++. Although I heard they intend to add it to a later version, I just don't see any way to add it nicely.
Unfortunately, C++ is not that language.
Even though I don't think C++'s feature set is needed for the vast majority of applications, one can actually see how it can be useful. But just not C++. C++ has so much legacy that adding anything to the language is painful.
Also, C++ isn't infinitively extensible. At some point, it's better to just design a C++-made VM and use something else. Garbage collection(yes, it is useful) is notably bad in C++. Although I heard they intend to add it to a later version, I just don't see any way to add it nicely.
255
The "extra stuff" of Java is less than the "extra stuff" of C++. Although that gets a little ambiguous if you count the API.
Grouping functions in classes isn't bad. It's organized. If anything, it solves C++'s problem of having no decent auto-completion.
C++'s lack of basic "forced stuff" means it's horribly inconsistent.
But we weren't talking about C++'s inconsistencies and brain damages. We were talking about how bloated it is.
Grouping functions in classes isn't bad. It's organized. If anything, it solves C++'s problem of having no decent auto-completion.
C++'s lack of basic "forced stuff" means it's horribly inconsistent.
But we weren't talking about C++'s inconsistencies and brain damages. We were talking about how bloated it is.