For all those who believe that BASIC is a "slow language by nature", they should take a very close look at the executables that POWERBASIC for example creates, especially when it does number crunching. And then those people would be well adviced to remain silent forever afterwards.
It's the code the compiler generates and the used (runtime) libraries that cause the performance difference, not the source language itself.
But if you need to compare, then BlitzMax can only be compared to a strongly typed language that runs on a runtime system with garbage collection. Basically something like C#.NET, Java or Objective-C 2.0. Pascal, C and C++ are out of the question, because they do not have garbage collection (unless you are comparing the "managed" .NET versions of those languages).
By the way, since when is Pascal slower than C? Pascal and C are languages on almost exactly the same level with an almost identical featureset. Pascal just did not have pointer arithmetics, that's all. It did not keep Apple from writing many parts of the original Mac & Lisa operating systems and toolbox in Pascal.
And since when are Pascal compilers written in C? The Free Pascal compiler is written in Pascal, as the Mono Visual Basic compiler is written in Visual Basic and the Mono C# compiler is written in C#. The difference is that Free Pascal does not need any runtime systems that are written in a different language. As said above, Pascal is a language that can and has been used to write operating systems.
If somebody now wants to say something about the slowness of the good old UCSD Pascal... Then he or she should remember that UCSD Pascal used a virtual machine just like Java and C# do today. The difference being that the UCSD Pascal VM ran well enough on a 1 MHz 6502 CPU, when the first Java VM ran painfully slow even on a Pentium CPU when it was released.
But coming back to some of the benchmarks. I think that above two results measured by Lumooja speak for themselves:
Visual C++ 2005:
311
320
311
310
321
MinGW:
601
601
601
601
591
Those are both C++ compilers on the SAME machine, compiling the very SAME code in the very SAME programming language. And, interesting enough, BlitzMax even performs better than the GNU C++ compiler on that machine, even though BlitzMax itself was created in GNU C++:
BlitzMax:
586
581
591
582
586
But in the end, this entire discussion is just complete useless nonsense.
Productivity is much more important than used CPU cycles. Python is one of the most productive programming languages that are currently available, but it is also one of the slowest when it comes to runtime performance. However, that just does not matter in the end: It is still "fast enough" for any job.
Programmers are more expensive than computer hardware and CPU cycles., therefor what really matters is that it is much cheaper to get the code written and the job done with Python than it would be with a low level language like C++ or even Java or C#. Python code is also much more maintainable and much better readable than C/C++/Java/C#-code over time.
Enough said for tonight. ;-)
It's the code the compiler generates and the used (runtime) libraries that cause the performance difference, not the source language itself.
But if you need to compare, then BlitzMax can only be compared to a strongly typed language that runs on a runtime system with garbage collection. Basically something like C#.NET, Java or Objective-C 2.0. Pascal, C and C++ are out of the question, because they do not have garbage collection (unless you are comparing the "managed" .NET versions of those languages).
By the way, since when is Pascal slower than C? Pascal and C are languages on almost exactly the same level with an almost identical featureset. Pascal just did not have pointer arithmetics, that's all. It did not keep Apple from writing many parts of the original Mac & Lisa operating systems and toolbox in Pascal.
And since when are Pascal compilers written in C? The Free Pascal compiler is written in Pascal, as the Mono Visual Basic compiler is written in Visual Basic and the Mono C# compiler is written in C#. The difference is that Free Pascal does not need any runtime systems that are written in a different language. As said above, Pascal is a language that can and has been used to write operating systems.
If somebody now wants to say something about the slowness of the good old UCSD Pascal... Then he or she should remember that UCSD Pascal used a virtual machine just like Java and C# do today. The difference being that the UCSD Pascal VM ran well enough on a 1 MHz 6502 CPU, when the first Java VM ran painfully slow even on a Pentium CPU when it was released.
But coming back to some of the benchmarks. I think that above two results measured by Lumooja speak for themselves:
Visual C++ 2005:
311
320
311
310
321
MinGW:
601
601
601
601
591
Those are both C++ compilers on the SAME machine, compiling the very SAME code in the very SAME programming language. And, interesting enough, BlitzMax even performs better than the GNU C++ compiler on that machine, even though BlitzMax itself was created in GNU C++:
BlitzMax:
586
581
591
582
586
But in the end, this entire discussion is just complete useless nonsense.
Productivity is much more important than used CPU cycles. Python is one of the most productive programming languages that are currently available, but it is also one of the slowest when it comes to runtime performance. However, that just does not matter in the end: It is still "fast enough" for any job.
Programmers are more expensive than computer hardware and CPU cycles., therefor what really matters is that it is much cheaper to get the code written and the job done with Python than it would be with a low level language like C++ or even Java or C#. Python code is also much more maintainable and much better readable than C/C++/Java/C#-code over time.
Enough said for tonight. ;-)