On C/C++ undefined behaviours

SK sk at metrokings.com
Fri Aug 20 20:36:28 PDT 2010


On Fri, Aug 20, 2010 at 7:07 PM, Walter Bright
<newshound2 at digitalmars.com> wrote:
> SK wrote:
>>
>> On Fri, Aug 20, 2010 at 4:16 PM, Walter Bright
>> <newshound2 at digitalmars.com> wrote:
>>>
>>> And frankly, it's retarded to compile the same program over and over,
>>> every
>>> time you use it.
>>
>> How about IBM's TIMI?  My understanding is that it's a hybrid approach
>> that gives you machine independence with a one-time recompilation that
>> is stored back into the executable.  Or something like that.
>
> Beats me, I've never heard of it.
>

Then to make this more concrete, what if D had an option to suspend
compilation after the front-end finished?  The resulting executable
contains the abstract RTL blobs and the compiler backend, which
finishes the job for the specific platform on which the executable is
launched.  The final binary is cached for subsequent launches.  You
get good machine independence and the approach provides performance
wins for operations like vectorizing where you don't know in advance
what kind of SSE support you'll find.

Hypothetically, why not?

I dug around and found this:
http://www.itjungle.com/tfh/tfh082007-printer01.html

>From the article.
Without getting too technical, here's what happens on the OS/400 and
i5/OS platform when you create applications, which explains the
problem customers ran into in 1995 and which IBM wants them to avoid
in 2008. A programmer writes an application in say, RPG. They run it
through a compiler, either using the Original Program Model (OPM) or
the Integrated Language Environment (ILE) compilers, and the code
compiles so they can run it. Or, rather, that is what it looks like to
the programmer. What is really happening is that this application is
compiled into an intermediate stage, which some IBMers have called RPG
templates (in the case of RPG applications). These templates have a
property called observability, which in essence means they are
compiled to the TIMI layer. These intermediate templates are then used
by the TIMI layer on an actual piece of hardware with a specific
processor and instruction set to compile the application to run on
that specific processor. TIMI compiles these RPG templates down to
actual compiled code behind the scenes the first time an application
runs, and because the code was originally compiled to the TIMI layer,
there is no need to change the source code. Only the object code
changes, which end users never had access to anyway because only TIMI
can reach down there. This is the brilliant way that IBM has preserved
customers' vast investments in RPG, COBOL, and other applications over
the years


More information about the Digitalmars-d mailing list