Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Bart Newsgroups: comp.compilers Subject: Re: Best language for implementing compilers? Date: Sat, 9 Mar 2019 12:34:22 +0000 Organization: virginmedia.com Lines: 29 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-03-004@comp.compilers> References: <19-02-002@comp.compilers> <19-02-004@comp.compilers> <19-02-006@comp.compilers> <19-03-002@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="90944"; mail-complaints-to="abuse@iecc.com" Keywords: lex, python, comment Posted-Date: 09 Mar 2019 20:29:06 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <19-03-002@comp.compilers> Content-Language: en-GB Xref: csiph.com comp.compilers:2170 On 09/03/2019 06:47, mertesthomas@gmail.com wrote: > On 2019-02-12 15:43:46 UTC+1 Bart wrote: >> On 08/02/2019 23:36, George Neuner wrote: >>> On Fri, 8 Feb 2019 12:20:18 +0000, "Costello, Roger L." >>> wrote: >>> >>>> What is it about ML that makes it such a good language for implementing >>>> compilers? >>> >>> Compiling involves a lot of pattern matching, and pattern matching is >>> a native feature of ML. >> >> You mean for tokenising and parsing? That would be a small part of >> compilation (the easy bit, in my view), although it seems to be a >> preoccupation of this group. > > Agree. Pattern matching might help a little during tokenising, > but I have doubts that it leads to a fast tokenizing function. In one exchange on comp.lang.python a few years ago, I posted a highly un-Pythonic and generally derided tokeniser program. However it turned out to be faster than someone else's more elegant tokeniser based on regular expressions. And that was despite the regular expression library being implemented (I would presume) in compiled native code. Mine would have been mostly byte-code. [Python's REs are not particularly fast. Perl's seem about twice as fast. -John]