Re: Wrestling with phase 1 of a C compiler

Christopher F Clark <christopher.f.clark@compiler-resources.com>
Tue, 13 Sep 2022 14:55:18 +0300

          From comp.compilers

Related articles
Wrestling with phase 1 of a C compiler luser.droog@gmail.com (luser droog) (2022-09-07)
Re: Wrestling with phase 1 of a C compiler luser.droog@gmail.com (luser droog) (2022-09-09)
Re: Wrestling with phase 1 of a C compiler luser.droog@gmail.com (luser droog) (2022-09-11)
Wrestling with phase 1 of a C compiler christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-09-12)
Re: Wrestling with phase 1 of a C compiler gah4@u.washington.edu (gah4) (2022-09-12)
Re: Wrestling with phase 1 of a C compiler christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-09-13)
Re: Wrestling with phase 1 of a C compiler luser.droog@gmail.com (luser droog) (2022-09-14)
Re: Wrestling with phase 1 of a C compiler gah4@u.washington.edu (gah4) (2022-09-14)
Re: Wrestling with phase 1 of a C compiler luser.droog@gmail.com (luser droog) (2022-09-15)
| List of all articles for this month |

From: Christopher F Clark <christopher.f.clark@compiler-resources.com>
Newsgroups: comp.compilers
Date: Tue, 13 Sep 2022 14:55:18 +0300
Organization: Compilers Central
References: 22-09-001 22-09-004 22-09-005
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="31319"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, history, macros
Posted-Date: 14 Sep 2022 16:25:35 EDT

I never used the PL/I preprocessor myself. However, at my first job (at
SofTech), my mentor (Carl Martin) made some PL/I macros that *loosely*
translated a subset of Jovial into Multics PL/I. It was still PL/I
semantics, but Jovial syntax. That allowed us to write our Jovial
compilers in that subset of Jovial and get it working before it could
become self-hosting.


But notice that these were mostly minor syntactic changes and no error
checking, no semantic changes, etc. It was only used for one project and
one team and two compilers (one targeting Multics and the other
targeting the Interdata 8/32). So, the fact that it wasn't very robust
wasn't an issue.


This is very different than trying to make a functional library in an
imperative language.


----------


On a related note, I have heard stories from C++ compiler
implementors about the various template libraries that have been created
which attempt to do "Turing machine" style (NP-complete) computations via
types and parameters, where the users wonder why the compilation process
takes much longer than running the resultant program.


This is the kind of mess one makes when one sees a hammer and treats screws
as nails. Yes, with enough force you can pound a screw into wood (or a
wall) but the result is NOT a good fastener. Screws are threaded for a
reason and nails are not for the complementary reason. Different semantics.


I rarely create my own C++ templates nor Rust macros for that reason. It
is too easy to create things that look clever but are essentially
undecipherable. As the saying goes: "With great power comes great
responsibility."


Kind regards,
Chris


--
******************************************************************************


Chris Clark email: christopher.f.clark@compiler-resources.com
Compiler Resources, Inc. Web Site: http://world.std.com/~compres
23 Bailey Rd voice: (508) 435-5016
Berlin, MA 01503 USA twitter: @intel_chris
------------------------------------------------------------------------------


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.