Path: csiph.com!xmission!news.alt.net!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: luser droog Newsgroups: comp.compilers Subject: Re: implementation languages, was Supporting multiple input syntaxes Date: Sun, 23 Aug 2020 20:39:30 -0700 (PDT) Organization: Compilers Central Lines: 36 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <20-08-015@comp.compilers> References: <20-08-002@comp.compilers> <20-08-009@comp.compilers> <20-08-010@comp.compilers> <20-08-011@comp.compilers> <20-08-012@comp.compilers> <20-08-014@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="85427"; mail-complaints-to="abuse@iecc.com" Keywords: design, comment Posted-Date: 24 Aug 2020 11:42:31 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: <20-08-014@comp.compilers> Xref: csiph.com comp.compilers:2567 On Sunday, August 23, 2020 at 10:15:06 PM UTC-5, luser droog wrote: > Thanks to everyone for the help, esp. Kaz with the brilliant suggestion > to pass a language id token between tokenizer and parser. > > > Ps. the prototype is written in PostScript extended with function syntax. > https://github.com/luser-dr00g/pcomb/blob/master/ps/pc11.ps > https://codereview.stackexchange.com/questions/193520/an-enhanced-syntax-for-defining-functions-in-postscript > > -- > l droog > [Why Postscript? I realize it's Turing complete, but it seems odd to run ones parser on a printer. -John] I discovered PostScript around '97 or '98. I was taking Computer Graphics and it was in an Appendix to the textbook (Salman). At the same time I was editor of the Honors College student magazine so it really piqued my interest as a graphics and typography language. But the language itself I just really enjoy. It's my "Lego blocks" language. The RPN syntax removes all ambiguity about precedence and sequencing. It has the same code=data properties as Lisp. Application code can read from the program stream. It has strings, arrays and dictionaries. It has first class procedures which can be constructed on the fly. I've found it a nice playpen for syntax extension. I was also on a many-decades long crusade to never use MS Word after that /first/ time they screwed everyone by changing the interface. And PostScript has slowly become my tool for that as my programming skill grew. https://github.com/luser-dr00g/ibis.ps On another front, I wanted to have parsers in PostScript so I could evaluate infix math expressions. And I wanted regular expression matching in PS thinking it would help to implement algorithmic hyphenation of text. [Take a look at Forth. Many of the same advantages, runs a lot more places. -John]