[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Re: [DotGNU]Architecture Neutral Distributed Format]

From: Marco Manfredini
Subject: [Fwd: Re: [DotGNU]Architecture Neutral Distributed Format]
Date: Wed, 08 Aug 2001 22:51:13 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.3) Gecko/20010801

[sorry Hans-Olof, i will probably learn this someday..]
Hans-Olof Danielsson wrote:
> Marco Manfredini <address@hidden> skrev:
>>Anyway, if undestand this right I find this strange. For example they
>>want the translator not to make assumptions about the target machine,
>>like about the number of bits in an long.
> The main difference between ANDF and conventional intermediate program
> forms is that ANDF represents an abstraction of high-level languages while
> the others like RTL typically represent an abstraction of the target
> architecture.
> The Producer translates from the high level language to ANDF.
> The Installer then maps ANDF to a suitable representation on the target
> machine.
> Depending on the target machine an long could then be 16 or
> 32 or 64 or ... bits. So it's the Installer that makes assumptions about
> the target machine not the translator ( Producer ) I would say.

Then I was reading that right. Do you know, how ANDF producers handle
the target dependecies in the source language?

For example, it is not difficult for me to understand, that only ANDF
knows the value of sizeof(long) and that the ANDF representation of

char grok[sizeof(long)];

evaluates during installation, determines that sizeof(long)=4 and emits
the instructions to allocate a 4-byte array of char.

But. My understanding stops when

char grok[sizeof(long)-5];

is involved. One one machine this could be produced (sizeof(long)==8)
one another not. This means that a semantic error occurs during the
installation step [i.e. without the sources involved or even available].

Moreover, there is no way to instantiate templates during production
which use sizes in any form:

template<int k> struct Frob { };
template<> struct Frob<8> { int gnik() {} }

Frob<sizeof(long)> x;

Only the installer can decide, if there is gnik or not..

This is probably less a problem, if ANDF-installation happens directly
after compilation or during the link step, because the problem occurs
with the developer, ANDF emits the problematic source line and he fixes
it. But I'm not sure, how this works, if modules are send across the
networks to assemble on the client computer. I am not sure if an
intermediate format that produces cryptic semantic diagnostics during
installation or runtime becomes widely popular....

In consequence we would need to skip the feature and produce ANDF with
fixed types..
Greetings, Marco

reply via email to

[Prev in Thread] Current Thread [Next in Thread]