[r-t] Writing method display software

Richard Smith richard at ex-parrot.com
Sun Nov 29 15:28:40 UTC 2015


Richard Johnston wrote:

> As someone brougfht up iin the procedural age of computing, I have to
> admit that his interesting discussion of modern programming languages
> had provoked the repeated thought - but what machine level code do
> they generate and is it efficient? :-)

The question is moot for Python as its interpretted, and it 
is hard to compare C++ with Scala as one compiles to native 
machine code and the other to Java bytecode.  C++ used to 
have a bad reputation for producing inefficient machine 
code.  This was largely because idiomatic C++ relies heavily 
on inlining, and 15 years ago the inliners in most compilers 
were simply not up to the task.  This is no longer the case.

But if you don't like the assembly the compiler produces, 
you can write your own.  A lot of the ringing code I write 
involves a tight inner loop being executed trillions of 
times.  (Trillions is not an exaggeration: in the 7-part 
Erin search I ran last week, I estimate the recurse function 
at the heart of the search was executed between 1 and 10 
trillion times.  I didn't get the code to count, because the 
very act of counting would have slowed the code noticably.) 
If I don't like the assembler my compiler produced, I can 
tweak it by hand, or even completely rewrite it.  I 
sometimes do that, but it's increasingly uncommon.

RAS




More information about the ringing-theory mailing list