It is hard to create benchmarks to compare programming languages in
a fair way. To accomplish this it is necessary to use the same algorithm
and the same abstraction level for one test. This leads to strict rules:
Inline assembly or other inline code must not be used. The usage of
vector instructions, GPU computations and multiple threads is only
allowed if the benchmark story explicitely allows it. Furthermore the
standard libraries of the language should be used (not libraries from
somewhere in the internet).
The benchmark programs below use statements and expressions but also
standard library functions. These include container functions, sine, or
the random number generator. The standard library functions usually
come with the language, so they can be viewed as part of the language.
Programmers will usually use these library functions. So it is a
realistic approach to measure them as well.
- Eratosthenes
- Monte Carlo