Re: What's lacking: a good intermediate form




"Robbert Haarman" <comp.lang.misc@xxxxxxxxxxxxx> wrote in message
news:20090307120724.GK3942@xxxxxxxxxxxxxxxxxxxxxxx
On Fri, Mar 06, 2009 at 06:22:03PM -0800, James Harris wrote:

I think this may be on the right track but translation through SSAs is
optional isn't it, and part of the optimisation process? IRs in
general seem to be either

* too low level,
* too high level, or
* too language specific - or at least they have to include features
which are geared to supporting particular language components.

I don't think we should be looking at a single IR to fit every
situation. This is not how compilers I know work, either. They go
through multiple intermediate representations.

I think the frontend and backend change. Directly opposing your "point'.


For example, the source code is parsed to an abstract syntax tree (first
IR), then this syntax tree is annotated with type information (second
IR),

No, still trying to get to the IR (THE IR?).

then various transformations and optimizations are performed which
may or may not result in new IRs,

Irrelevant.

then there is a stage where the
program is represented as a number of low-level operations,

You should be a lawyer. But one shot in the head. (You bet I have actual
examples).

but not tied
to a specific platform yet (another IR), and that is eventually
elaborated to yield machine code (sometimes going through a number of
IRs).

Too many political "assumptions".


Generally, the progress is from language-specific

More politics.

and high
level to language-agnostic and high level, from there to
platform-agnostic and low level, and finally to platform-specific and
low level.

Surely there is a bullet in your future. :P

It makes sense to have different IRs for each stage.

You attemp to use "IR" to your own accomodation. Start a separate thread.

See also
my earlier post mentioning multiple intermediate languages.

A good IR should be truly independent of either source language or
target.

It depends what the goal of the intermediate representation is. For an
IR to be as widely usable as possible, yes, you are right.

It's a "stupid" statement (read attempt to gather the stupid). Uncontextual
and simply noise. You categorize it wrongly grasshopper.


With that in mind here's a suggestion for an IR: Use quadruples

Separate thread: what are quadruples. Don't litter my thread with your
propaganda.

Tony


.



Relevant Pages

  • Re: "Ravenscar-like" profile for C/C++
    ... > ADA Ravenscar is a restricted subset of the ADA language that has been ... The whole language is designed for maximum run-time/space ... "C-style operations with low level stuff ... C-style array the C++ high level sort(template) is applied. ...
    (comp.lang.c)
  • Re: "Ravenscar-like" profile for C/C++
    ... > ADA Ravenscar is a restricted subset of the ADA language that has been ... The whole language is designed for maximum run-time/space ... "C-style operations with low level stuff ... C-style array the C++ high level sort(template) is applied. ...
    (comp.lang.cpp)
  • Re: too much OOP ?
    ... You claimed SQL being at a extremly low level of abstraction. ... I said that designing it in terms of records is low level. ... then that language would be low-level. ... complexity of the language constructs. ...
    (comp.object)
  • Re: Java or C++?
    ... > One approach, taken by Oberon, is to isolate the low level code in ... > "For system-level programming, Oberon offers the pseudo module SYSTEM, ... The C language also has that concept. ... inherently unsafe by their being compiled with the command "cc". ...
    (comp.programming)
  • Re: Randall, Any HLA Updates Planned?
    ... I like the language in ... Not too low level but not too high level either. ... major changes in it. ...
    (alt.lang.asm)