• Welcome to Valhalla Legends Archive.
 

Which is better?

Started by Vamp, September 03, 2003, 06:49 PM

Previous topic - Next topic

Skywing

Quote from: Grok on October 27, 2003, 08:07 AM
Quote from: Skywing on October 27, 2003, 07:33 AM
That should not be a problem; the code should be portable between compilers as long as you didn't get suckered into using something like VCL.

IIRC, Borland had a library nomered as OWL, which maybe stood for Object Windows Library.  I'm assuming that was their 32-bit windows sdk, but I'm making a lot of assumptions here.
VCL is Borland's version of MFC.  Among other things, it's known for creating absolutely huge executables for even the most simple tasks.

Hostile

#16
Quote from: Grok on October 27, 2003, 08:07 AM
IIRC, Borland had a library nomered as OWL, which maybe stood for Object Windows Library.

And can you still see the Owl now, Grok? hehe

If I have to program in C++ I almost always use Visual C++ 6.0 EE, Visual C++.Net is basically just as nice but its pointless for the most average of applications. Unless you need some of the new technologies within it, or are going to buy a c++ compiler(since it will take longer for it to become outdated im sure, or perhaps sooner?) then don't bother. At work however we have the same but with the add-on of the Intel C++ Compiler 7.1 for Windows and Linux. Keep in mind we only have like 1 windows license and 1 for the linux compiler and ya for some reason the other guys in the office will use gcc. That compiler does make sense to learn if you ever think theres a slight chance you might become a consultant or the like at sometime because companies who need and dont yet have a compiler, often feel better if they don't have to pay for it.

PS: On a finishing note I would just like to point out that Grok uses double spaces after each sentance. We could all learn from him.   ;)
- Hostile is sexy.

Skywing

#17
Quote from: Hostile on November 01, 2003, 10:41 AM
Quote from: Grok on October 27, 2003, 08:07 AM
IIRC, Borland had a library nomered as OWL, which maybe stood for Object Windows Library.

And can you still see the Owl now, Grok? hehe

If I have to program in C++ I almost always use Visual C++ 6.0 EE, Visual C++.Net is basically just as nice but its pointless for the most average of applications. Unless you need some of the new technologies within it, or are going to buy a c++ compiler(since it will take longer for it to become outdated im sure, or perhaps sooner?) then don't bother. At work however we have the same but with the add-on of the Intel C++ Compiler 7.1 for Windows and Linux. Keep in mind we only have like 1 windows license and 1 for the linux compiler and ya for some reason the other guys in the office will use gcc. That compiler does make sense to learn if you ever think theres a slight chance you might become a consultant or the like at sometime because companies who need and dont yet have a compiler, often feel better if they don't have to pay for it.

PS: On a finishing note I would just like to point out that Grok uses double spaces after each sentance. We could all learn from him.   ;)
I gave Intel C++ a try.  There were some really annoying problems with it though, like generating code such that all stack variable accesses required a negative displacement, so you'd have stuff like mov eax, dword ptr [ebp+ffff3c10] all over.  This was so bad that it tended to make executables 3-4 times their size with cl.exe.

Additionally, I encountered some weird linker problems that I couldn't resolve when trying to use STL.

Needless to say, despite it's nice optimize-for-speed capabilities, I don't use it.

Adron

Quote from: Skywing on November 01, 2003, 12:25 PM

I gave Intel C++ a try.  There were some really annoying problems with it though, like generating code such that all stack variable accesses required a negative displacement, so you'd have stuff like mov eax, dword ptr [ebp+ffff3c10] all over.  This was so bad that it tended to make executables 3-4 times their size with cl.exe.

Isn't that the same size as any compiler would generate? Offsets are supposed to be sign-extended?

Also, it's normal to have negative displacement for stack variables and positive displacement for arguments when you're using a standard stack frame. See IDA's disassembly.

Skywing

#19
Quote from: Adron on November 01, 2003, 06:36 PM
Quote from: Skywing on November 01, 2003, 12:25 PM

I gave Intel C++ a try.  There were some really annoying problems with it though, like generating code such that all stack variable accesses required a negative displacement, so you'd have stuff like mov eax, dword ptr [ebp+ffff3c10] all over.  This was so bad that it tended to make executables 3-4 times their size with cl.exe.

Isn't that the same size as any compiler would generate? Offsets are supposed to be sign-extended?

Also, it's normal to have negative displacement for stack variables and positive displacement for arguments when you're using a standard stack frame. See IDA's disassembly.
The way it was generating code resulted in virtually all functions requiring four byte displacements for locals access.  It managed to turn a 30K program into a 400K one, and that's with dynamic linking to the runtime (release build, all debugging information off).  I verified this with disassembly, FYI.

Kp

Quote from: Adron on November 01, 2003, 06:36 PMIsn't that the same size as any compiler would generate? Offsets are supposed to be sign-extended?
As I understand it, the compiler was doing the sign-extension into a full 32 bits and writing *that* as the offset in the binary, as opposed to writing a byte with the sign bit set and trusting the CPU to sign extend it at run time.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Skywing

Quote from: Kp on November 01, 2003, 11:26 PM
Quote from: Adron on November 01, 2003, 06:36 PMIsn't that the same size as any compiler would generate? Offsets are supposed to be sign-extended?
As I understand it, the compiler was doing the sign-extension into a full 32 bits and writing *that* as the offset in the binary, as opposed to writing a byte with the sign bit set and trusting the CPU to sign extend it at run time.
Correct.  This is exactly what was happening.

Adron

Quote from: Kp on November 01, 2003, 11:26 PM
As I understand it, the compiler was doing the sign-extension into a full 32 bits and writing *that* as the offset in the binary, as opposed to writing a byte with the sign bit set and trusting the CPU to sign extend it at run time.

Ah. In that case, Skywing just gave a bad example. There's no way that his offset "mov eax, dword ptr [ebp+ffff3c10]" could fit into less than a full dword in any compiler.

muert0

#23
O.K. sorry to bring up an old post but are you all saying that visual c++ is the best compiler for windows.
Also, what are your favorite books?
To lazy for slackware.

Kp

Quote from: crashtestdummy on November 24, 2003, 05:18 AM
O.K. sorry to bring up an old post but are you all saying that visual c++ is the best compiler for windows.

I wouldn't say that, in part because it's an ambiguous statement.  Are you referring to VC++ 5 (eww), VC++ 6, or VC++ 7 (the ".Net" version)?  It's impossible for all three of them to be simultaneously best, and I would definitely suggest comparing what each of them offers/doesn't offer in both user interface and language extensions/compiler analysis.  From some of the output Skywing has showed me from VC++ 7, it seems to be very smart about code flow analysis.  On the other hand, the last time I checked, it was prone to occasionally generating incorrect executables from perfectly valid source code.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!