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


Groups > comp.compilers > #2727

Re: Are transpiling techniques different than compiling techniques?

From "Detlef Meyer-Eltz" <Meyer-Eltz@t-online.de>
Newsgroups comp.compilers
Subject Re: Are transpiling techniques different than compiling techniques?
Date 2021-10-12 11:34 +0200
Organization Compilers Central
Message-ID <21-10-019@comp.compilers> (permalink)
References <21-10-017@comp.compilers>

Show all headers | View raw


I'm working for years on the Delphi to C++ translater "Delphi2Cpp",
without beeing aware, that this kind of software is called a "transpiler".

https://www.texttransformer.com/Delphi2Cpp_en.html
<https://www.texttransformer.com/Delphi2Cpp_en.html>

What might come close to a special transpiler technique are "rewrite
rules" of syntax trees. But I use a naive approach with no mysterious
transpiler theory in the background. I shortly describe the steps that
are done during conversion:

1. the Delphi source code is pre-processed according to the set conditions
2. the resulting reduced code is parsed to build a syntax tree
3. the syntax tree is pre-processed to calculate some information needed
for the output.
4. the syntax tree is output as C++ code

For the first two steps an own parser generator called "TextTransformer"
is used. The first step can be regarded as a kind of
compilation/"transpilation" of its own. An example for the third step is
the calculation of the variables that have to be passed to
sub-functions, when nested functions are unbundled. A lot of manual work
has to be done for the fourth step. Numerous special cases have to be
hard-coded there, as there is no simple deduction relationship between
the source language and the target language. Some Delphi constructs
cannot be converted at all. But C++ is more powerful than Delphi, so
that many Delphi constructs can be reconstructed or simulated in C++. A
converter the other way round would be quite poor. The power of a
language could be part of a transpiler theory.

In contrast to a compiler, which has to be fast because it is used over
and over again in the development of software, the speed of the
tranpiler does not matter: ideally, it only has to be used once to do
its job.


Detlef


Am 11.10.2021 um 15:26 schrieb Roger L Costello:
> Hi Folks,
>
> Today I learned a new word: transpiling

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


Thread

Are transpiling techniques different than compiling techniques? Roger L Costello <costello@mitre.org> - 2021-10-11 13:26 +0000
  Re: Are transpiling techniques different than compiling techniques? Kartik Agaram <ak@akkartik.com> - 2021-10-11 11:23 -0700
    Re: Are transpiling techniques different than compiling techniques? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2021-10-12 20:05 +0200
    Re: Are transpiling techniques different than compiling techniques? Kaz Kylheku <480-992-1380@kylheku.com> - 2021-10-16 17:16 +0000
      Re: Are transpiling techniques different than compiling techniques? Thomas Koenig <tkoenig@netcologne.de> - 2021-10-16 20:22 +0000
      Re: Are transpiling techniques different than compiling techniques? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2021-10-16 23:55 +0200
        Re: Are transpiling techniques different than compiling techniques? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2021-10-17 07:02 +0200
          Re: Are transpiling techniques different than compiling techniques? gah4 <gah4@u.washington.edu> - 2021-10-17 15:01 -0700
  Re: Are transpiling techniques different than compiling techniques? "Detlef Meyer-Eltz" <Meyer-Eltz@t-online.de> - 2021-10-12 11:34 +0200
    Re: Are transpiling techniques different than compiling techniques? jan van katwijk <j.vankatwijk@gmail.com> - 2021-10-12 17:59 +0200
    Re: Are transpiling techniques different than compiling techniques? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2021-10-12 20:19 +0200
    Re: Are transpiling techniques different than compiling techniques? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2021-10-14 00:33 +0300
    Re: Are transpiling techniques different than compiling techniques? Kaz Kylheku <480-992-1380@kylheku.com> - 2021-10-16 17:26 +0000
      Re: Are transpiling techniques different than compiling techniques? gah4 <gah4@u.washington.edu> - 2021-10-17 08:37 -0700

csiph-web