Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1731

Re: New experimental back end for C/C++ compiler targeting CLI

Path csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Hans-Peter Diettrich <DrDiettrich1@netscape.net>
Newsgroups comp.compilers
Subject Re: New experimental back end for C/C++ compiler targeting CLI
Date Mon, 29 Aug 2016 10:28:10 +0200
Organization Compilers Central
Lines 32
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <16-08-009@comp.compilers> (permalink)
References <16-08-007@comp.compilers> <16-08-008@comp.compilers>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Info miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="91518"; mail-complaints-to="abuse@iecc.com"
Keywords code, translator
Posted-Date 29 Aug 2016 12:21:39 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:1731

Show key headers only | View raw


rockbrentwood@gmail.com schrieb:

> A really good source-to-source compiler should also be making proper
> adjustments to the comments. That may even entail a degree of natural language
> processing! Except for the "may" part.

Such problems occur only on source-to-source translation, where the
output should be human readable. A compilation into instructions of a
physical or virtual machine does not necessarily include comments, and
decompilation of executable code doesn't have to deal with comments at all.

Programming language translations are possible only for sufficiently
similar languages. If you look inside the "original VB" to MSIL
translation (not VB.NET), you'll find horrible constructs for the
implementation of the Basic ON ERROR... statements, even if both
languages are imperative.

In a source-to-source translation I'd not try to process comments,
except for structural parts like XML or doxygen tags.

In my C to Pascal converter I encountered many problems, not related to
control flow. I found most challenging the decisions, which parts of the
input should be "copied" unchanged, and which parts have to be
interpreted, i.e. must be broken down into more basic constructs. Even
if both language have equivalent control structures, like switch
statements, these may be semantically so different, that a direct
mapping is not always possible. The same for preprocessor statements -
can/should they be translated into equivalent high-level contstructs of
the target language, or do they have to be expanded before a translation?

DoDi

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

New experimental back end for C/C++ compiler targeting CLI Alexandre <alebencz@gmail.com> - 2016-08-25 10:40 -0300
  Re: New experimental back end for C/C++ compiler targeting CLI rockbrentwood@gmail.com - 2016-08-26 12:54 -0700
    Re: New experimental back end for C/C++ compiler targeting CLI Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2016-08-29 10:28 +0200
      Re: New experimental back end for C/C++ compiler targeting CLI BartC <bc@freeuk.com> - 2016-08-29 18:52 +0100
        Re: New experimental back end for C/C++ compiler targeting CLI Walter Banks <walter@bytecraft.com> - 2016-08-29 21:21 -0400
          Re: New experimental back end for C/C++ compiler targeting CLI Walter Banks <walter@bytecraft.com> - 2016-08-30 13:44 -0400
          Re: New experimental back end for C/C++ compiler targeting CLI BartC <bc@freeuk.com> - 2016-08-30 22:48 +0100
            Re: New experimental back end for C/C++ compiler targeting CLI Walter Banks <walter@bytecraft.com> - 2016-08-31 13:24 -0400
            Re: New experimental back end for C/C++ compiler targeting CLI Martin Ward <martin@gkc.org.uk> - 2016-09-06 18:09 +0100
        Re: New experimental back end for C/C++ compiler targeting CLI Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2016-08-30 13:13 +0200
    Re: New experimental back end for C/C++ compiler targeting CLI Walter Banks <walter@bytecraft.com> - 2016-08-29 13:15 -0400

csiph-web