Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: Are there "compiler generators"? Date: Wed, 1 Jun 2022 14:02:02 -0700 (PDT) Organization: Compilers Central Lines: 41 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-06-005@comp.compilers> References: <22-06-003@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="96736"; mail-complaints-to="abuse@iecc.com" Keywords: tools Posted-Date: 02 Jun 2022 18:02:42 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-06-003@comp.compilers> Xref: csiph.com comp.compilers:3043 On Wednesday, June 1, 2022 at 10:24:49 AM UTC-7, Roger L Costello wrote: (snip) > So a compiler can be generated declaratively by using a set of > declarative generator tools, e.g., Flex for lexical analysis, Bison > for syntax/semantic analysis, and Iburg for code generation. (snip, our moderator mentioned) > [I expect that someone has used lex, yacc, and iburg in the same > compiler sometime in the past 30 years. But that doesn't mean that > they combine into a compiler generator any more than a saw, a hammer, > and a paintbrush combine into a house generator. They're tools, each > does what it does. -John] There are now 3D printed houses, such as using computer controlled concrete pouring devices. One could accept a computerized design for a house, and then generate it in concrete. (I think you still need to do the interior finishing the old way.) One could write a system around flex, bison, and iburg, that would accept as input a description of the language, and the output machine instructions, that would call flex, bison, and iburg as needed. The description could be a slightly higher level, or as flex/bison input with minimal wrapper. (Maybe not so much optimization, as that tends to be more specialized. It could be useful as a first compiler for a new machine.) Many imperative languages are similar enough in structure that it might almost work. It might be especially interesting for those wanting to make small changes to existing languages. Well, I would choose a higher level language than the usual C for output of lexer and parser. A language with just the operations needed for a target compiler. One could, then, use the code generator not only for the output from the generated compiler, but for the compiler itself. (Assume it is for a new machine, with no compilers yet.)