Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Kaz Kylheku <480-992-1380@kylheku.com> Newsgroups: comp.compilers Subject: Re: What programming languages are simply abstractions on top of another programming language? Date: Wed, 22 Jun 2022 01:31:41 -0000 (UTC) Organization: A noiseless patient Spider Lines: 48 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-06-067@comp.compilers> References: <22-06-047@comp.compilers> Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="24906"; mail-complaints-to="abuse@iecc.com" Keywords: macros Posted-Date: 21 Jun 2022 21:48:57 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:3089 On 2022-06-18, Roger L Costello wrote: > Hi Folks, > > I am reading "Software Tools" by Kernighan and Plauger. One of the things that > I've learned is that Ratfor is a simple abstraction on top of Fortran. For > example, Ratfor provides a while loop. The while loop can be mechanically > converted to Fortran if-then and goto statements. Really cool! > > That got me to wondering, "What other programming languages are simply > abstractions on top of an existing programming language?" In the Ratfor spirit, in April 2022, I introduced a new one: cppawk. https://www.kylheku.com/cgit/cppawk/about/ Using the GNU C preprocessor, with C99 semantics, I managed to build, for instance, a loop macro that supports multiple clauses that combine for parallel or nested (cross product) iteration. Not only are there some userful predefined clauses, but they are user-definable. Even the Common Lisp LOOP macro deosn't have user-definable clauses. I made it possible in five #define statements. "LOL" :) There is a "Mock Lisp" data abstraction layer as well: cons cells are represented and such. Lists can be passed around and mapped over (if you have GNU Awk, which has indirect functions). cppawk provides a case statement which "compiles" either to a GNU Awk switch (nonstandard extension) or else portable constructs that work in other Awks. > /Roger > [The infamous m4 macrogenerator is used to build what are in effect new > languages like the sendmail configuration and GNU Autoconf. -John] GNU m4 underlies the Bison implementation: it's what glues together the parser skeleton templates with the grammar tables and whatnot to produce the output. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal