Stewart Greenhill wrote:
> noch wrote:
>
>> There are no suitable for me oberon-2 compiler for linux yet.
>
> [...]
>
>> There are only two compilers which produce native code:
>> xds, oo2c.
>> xds doesn't do garbage collection for swapped data.
>> oo2c is mot useful, but it is not real compiler, just translator.
>
> [...]
>
>> So, I tell you I need oberon to pascal compiler more than pascal to
>> oberon because if I have no suitable compiler for programming, and I am
>> forced to use the best available: oo2c, that just making translation
>> from oberon to c code. So it will be a good solution write oberon
>> program, translate to pascal and compile it with kylix or better
>> freepascal compiler.
>
>
> I hope that you can see the irony in what you are suggesting. You don't
> like oo2c because its "just a translator", yet you consider and oberon
> to pascal translator a "good solution".
>
> Ultimately, all compilers are just translators. They take a source
> language and produce object code. Often there are many intermediate
> stages; sometimes there are none.
>
> oo2c has a higly modular internal structure, consisting of multiple
> intermediate stages. The parser builds an abstract syntax tree ("AST"),
> which is then converted into a SSA intermediate representation ("IR").
> OOC does extensive optimisation and transformation on the IR code. This
> includes data-flow analysis which allows it to pick up problems like
> uninitialised objects, and unused objects at compile time. It also
> allows certain "run-time" checks to be factored out at compile time,
> which is im****tant for achieving best performance for complex array and
> record manipulations. The IR code is then translated to assembley
> language. For ****tability OOC uses "C" as its assembley language, and
> "gcc" as its assembler.
>
> Alternatively, you could write your own native back-end to generate
> other kinds of output from the IR code. That would cost you a large
> amount of your time, and would not likely produce any benefit except
> perhaps some philosophical satisfaction. Indeed, OOC includes an
> experimental x86 back-end which I suspect was developed for that very
> reason. If you can write a better optimizer than OOC + gcc combined then
> you might gain something in terms of performance. If you have a large
> team of programmers available to do this, then you can make the compiler
> less dependent on external tools. But in terms of sup****ted platforms
> per programming hour you can't beat "C" output.
>
> Really, oo2c *is* a compiler by any reasonable definition of the term.
> Sure, it uses another program to generate the final object code, but
> then so do many other compilers (eg. gcc).
>
> Cheers,
> Stewart
Do you think it's feasible to replace the C generating backend of OOC by a
Pascal generating one?


|