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


Groups > comp.compilers > #3030

Re: Are there "compiler generators"?

Path csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Thomas Koenig <tkoenig@netcologne.de>
Newsgroups comp.compilers
Subject Re: Are there "compiler generators"?
Date Sun, 29 May 2022 09:14:51 -0000 (UTC)
Organization news.netcologne.de
Lines 46
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <22-05-058@comp.compilers> (permalink)
References <22-05-054@comp.compilers>
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="54101"; mail-complaints-to="abuse@iecc.com"
Keywords tools
Posted-Date 29 May 2022 18:16:02 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:3030

Show key headers only | View raw


Roger L Costello <costello@mitre.org> schrieb:
> Is it still true in 2022--there are no compiler
> generators?

Consider what a compiler does can be roughly subdivided
into the follwing tasks:

a) Lexing, resulting in a stream of tokens
b) Parsing, resulting in an abstract syntax tree
c) Conversion into intermediate form, resulting in
   SSA (usually, these days)
d) Optimization of the SSA, resulting in modified SSA
e) Conversion into machine language, resulting in some
   internl representation of the machine language
f) Optimization of the machine language
g) Output to later stages (in assembler or in intermediate
   form)

Roughly speaking a)-c) is the front end, d) is the middle end and
e)-f) is the back end.

As our moderator writes,

> [There are certainly programs that will generate a combined lexer and parser
> but there's a lot more to a compiler. -John]

a) and b) are well covered.  For c), you would need a machine-
implementable description of the language semantics, and there is
no such thing in widespread use.  d) is a main component of today's
compilers, which is hand-crafted code.  e)-g) can be covered by
machine descriptions, that gcc and LLVM have (it is debatable if
these can be called generators).

So, assuming you can use gcc or LLVM, the main gap is c) - you
would need a formal semantic description, and it would have to
be written in a way that it can be translated automatically.
That might be doable if you design your own langue with that goal.

Defining a format for language semantics which is useful for a
reasonable subset of the multitude of languages in current use and
machine-translatable (a input to a "semantic front end generator",
if you will) will be _extremely_ hard.  Maybe starting with the
formal definition of Modula-2 and then thinking in two directions,
how could a semantic front end generator be built from that
description and and how could that format be extended to cover
other languages, could be the start of an approach.

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


Thread

Are there "compiler generators"? Roger L Costello <costello@mitre.org> - 2022-05-28 22:27 +0000
  Re: Are there "compiler generators"? "Robin Vowels" <robin51@dodo.com.au> - 2022-05-29 13:34 +1000
  Re: Are there "compiler generators"? Jan Ziak <0xe2.0x9a.0x9b@gmail.com> - 2022-05-28 23:52 -0700
  Re: Are there "compiler generators"? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-05-29 06:45 +0000
  Re: Are there "compiler generators"? Thomas Koenig <tkoenig@netcologne.de> - 2022-05-29 09:14 +0000
    Re: Are there "compiler generators"? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-05-30 14:53 +0200
      Re: Are there "compiler generators"? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-05-31 12:57 +0200
        Re: Are there "compiler generators"? gah4 <gah4@u.washington.edu> - 2022-05-31 16:55 -0700
          RE: Are there compiler generators? Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2022-06-01 14:07 +0300
  Re: Are there "compiler generators"? Martin Ward <martin@gkc.org.uk> - 2022-05-29 12:00 +0100
    Re: Are there "compiler generators"? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-05-30 07:35 +0000
  Re: Are there "compiler generators"? Fernando <pronesto@gmail.com> - 2022-05-29 05:00 -0700
  Re: Are there "compiler generators"? gah4 <gah4@u.washington.edu> - 2022-05-29 23:29 -0700
    Re: Are there "compiler generators"? mac <acolvin@efunct.com> - 2022-06-09 14:12 +0000
  Re: Are there "compiler generators"? Kaz Kylheku <480-992-1380@kylheku.com> - 2022-05-30 20:20 +0000

csiph-web