Before the winter of 2013, I ran in the website of Euler Project and was amazed at the idea of solving common mathematical problems (often problems related to numbers, permutation and combination). I am not particularlly interesting in mathematics, but I spent weeks on it because the joy of solving problems was so great.
To make programming with mathematics less boring, I tried to utilize different programming languages: c++, c#; java; python, php, ruby. Sometimes, I solved the same problem with more than one language, or more with more than one way.
How to run
on windows cli, run:
you will get a solution.exe. Then, run
on your cli, run:
Performance of different languages
Try to solve the same mathematical problems in different programming languages, you can see the differences of execution are enormous.
For example, it became obvious to me that some languages specializing in web development, such as php, ruby, are slower in executing CPU and memory intensive programs, than other more general-purpose languages (c++,c#, python,java). Sometimes, it is simply not possible to get a result in a reasonable time scope.