Re: Best language for implementing compilers?

mertesthomas@gmail.com
Sat, 9 Mar 2019 01:47:38 -0500 (EST)

          From comp.compilers

Related articles
[7 earlier articles]
Re: Best language for implementing compilers? 157-073-9834@kylheku.com (Kaz Kylheku) (2019-02-12)
Re: Best language for implementing compilers? costello@mitre.org (Costello, Roger L.) (2019-02-12)
Re: Best language for implementing compilers? 157-073-9834@kylheku.com (Kaz Kylheku) (2019-02-12)
Re: Best language for implementing compilers? drb@ihatespam.msu.edu (2019-02-19)
Re: Best language for implementing compilers? martin@gkc.org.uk (Martin Ward) (2019-02-19)
Re: Best language for implementing compilers? arnold@skeeve.com (2019-02-20)
Re: Best language for implementing compilers? mertesthomas@gmail.com (2019-03-09)
Re: Best language for implementing compilers? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2019-03-09)
Re: Best language for implementing compilers? bc@freeuk.com (Bart) (2019-03-09)
Re: Best language for implementing compilers? gneuner2@comcast.net (George Neuner) (2019-03-09)
Re: Best language for implementing compilers? gneuner2@comcast.net (George Neuner) (2019-03-09)
Re: Best language for implementing compilers? 157-073-9834@kylheku.com (Kaz Kylheku) (2019-03-10)
Re: Best language for implementing compilers? 157-073-9834@kylheku.com (Kaz Kylheku) (2019-03-10)
[10 later articles]
| List of all articles for this month |

From: mertesthomas@gmail.com
Newsgroups: comp.compilers
Date: Sat, 9 Mar 2019 01:47:38 -0500 (EST)
Organization: Compilers Central
References: 19-02-002 19-02-004 19-02-006
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="8155"; mail-complaints-to="abuse@iecc.com"
Keywords: lex, design
Posted-Date: 09 Mar 2019 01:47:38 EST
In-Reply-To: 19-02-006

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."
> > <cost...@mitre.org> 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.


For parsing I don't think that pattern matching leads to correct
results in all cases. I have seen too much buggy attempts to do
parsing with pattern matching. Even for such simple things as
lines with key=value I saw "solutions" with pattern matching, that
triggered bugs when the line was not simple. A good approach for
parsing is LL(1), which has nothing to do with pattern matching.
With pattern matching you are in danger, to get something that
just works when the weather is good. Good compilers just don't
use pattern matching for parsing.


Regards,
Thomas Mertes


--
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.


Post a followup to this message

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