PDA

Click to See Complete Forum and Search --> : Which is faster C++ or Pascal?


Dec 5th, 2000, 01:07 PM
I think C++ because its level is between Assembly and Turbo Pascal.

Bye

ccoder
Dec 5th, 2000, 02:40 PM
By faster, I assume that you are referring to execution speed. Another assumption is that you want to compare C++ with Object Pascal and not plain vanilla Pascal.

I cannot give you any specifics as to which is faster as I have not done any studies in this area. Back in the days of Turbo C 2.0, I did write a utility in both Turbo C and the then current version of Turbo Pascal. The C generated executable was 4 times the size of the Pascal executable.

One thing to keep in mind is that Turbo Pascal generates a lot of error checking code (bounds checking, etc.) unless you turn it off in the compiler options.

I'm not sure why stefano thinks that C++ is "between Assembly and Turbo Pascal". Both C++ and Pascal are high level languages that must be compiled to create an executable. The only difference would be the level of optimization that is built into the compiler and that can vary (within a language) from one compiler to another.

Vlatko
Dec 5th, 2000, 03:56 PM
Yes both C++ and pascal are High Level Languages but C++ is said to be at a little lower level than other HLL. C++ fills the gap between Assembly and HLL. C++ is faster than pascal, maybe not as much as from Basic but faster.

ccoder
Dec 5th, 2000, 04:39 PM
I have heard this claim for years, but I have never seen anything that that specifies how C/C++ is "between Assembly and HLL". I really would be interested in some input on the subject.

I worked on an Ada compiler in the early '80s as part of my CS degree. I found the subjects of language theory and compilers to be very interesting. Sometimes, I wish I had persued that line of work after school but it would have meant moving to "where the work is". I left the east coast for the mid-west, I didn't want to move back to a coast.

I'm sure the art of compiler design has probably changed since then but, based on what I do know, I still have to say that C/C++ are just HLLs like Pascal. Somebody, please set me straight.

parksie
Dec 5th, 2000, 05:03 PM
C++ and Pascal are basically at the same level, although C++ is slightly lower.

C++ is only faster than pascal because it's much easier to write faster C++ code, and the compilers tend to do much more optimising. Also, being lower level, you can "miss out" a large proportion of the checks that the Pascal compiler does.

Dec 5th, 2000, 08:25 PM
if you're asking this because you are wondering which one is better to develope in, I would go for C++, because it is the "standard" almost everyplace uses it... I don't think i have ever bought or used an app made in pascal...

HarryW
Dec 5th, 2000, 09:00 PM
Well Delphi is Pascal-based, so you probably have.

Dec 5th, 2000, 09:11 PM
Delphi is OO pascal....

and I have used delphi apps(inno-setup, http://www.jrsoftware.org)
but not plain pascal apps...

HarryW
Dec 5th, 2000, 09:39 PM
It's the same discinction as between C and C++. They are fundamentally the same language.

HarryW
Dec 5th, 2000, 09:39 PM
What am I doing? I'm not going to argue about this, it's petty.

Dec 5th, 2000, 11:01 PM
Ok, ok, i have decided to try and find out on my own. Here is what i learned. Pascal is smaller. There really is no difference in speed. C++ is way easier to read. And Assembly is the best overall. Thank you...