There is almost no use in that inlining, because Ruby is still about 100x slower than C++ and Java. Well, even JavaScript is much faster now. |
Um, that was
C code, not Ruby, as you should have realized if you read it. Your point is moot. As I see it there are two cases:
Case 1. You care about efficiency - You're doing games, or computing some mathematical problem, or working on some very slow computer inside a toaster or space probe, or making a OS.
In this case, you would use C or C++ or Fortran - some compiled language. The main flaw in C++ in this area is the slowness of STL compared to hand-written stuff. But sometimes you care a bit less about run speed just to increase development speed a bit. These languages are somewhat strict and have a lot of syntax, but they have mature, industrial-strength toolchains to compile and run directly on the metal (well, except for microcode, but let's ignore that for now).
Case 2. You don't care about efficiency - You're making a web applet, a simple desktop application, or a very basic game.
In this case, you would use a scripting language like Perl, Ruby, or Python. These languages are slower than C et al., but they make up for it by being easy to use and having no boilerplate, as this example which works in all three shows:
print "Hello, World!";
Java falls into the middle, which is empty.