Newsgroups: comp.compilers
From: f...@cs.mu.OZ.AU (Fergus Henderson)
Date: 1999/05/21
Subject: Re: Using Prolog to Compile Things
Nick Roberts <nickrobe...@callnetuk.com> writes: I have written a couple of compilers in Prolog. In many ways, Prolog >Has anyone on this ng experience or knowledge of the use of Prolog to >implement a native-code compiler for a typical high-level imperative >language? I am toying with the idea of using Prolog for the lexer, the >parser, the intermediate (library) code generator, and the end-code >generator (and even, in effect, for linking!), i.e. the 'whole shebang'. is an excellent language for writing compilers, but it does have some important disadvantages. Much of the task of compilation is manipulating trees of various Another advantage of Prolog is the use of unbound variables and Prolog does have some significant disadvantages. One is that Prolog Another disadvantage is that Prolog doesn't have records with named Another disadvantage, probably more important than the previous two, If you do use Prolog, then I strongly recommend that you document the Of course, I'm one of the developers of Mercury, so my opinion in that > I'm particularly interested in the idea of using Prolog's natural I think this is a mirage. It's pretty easy to express searching > searching abilities to search for truly optimal code. algorithms in any language. But finding _feasible_ algorithms to produce "truly optimal code" is going to be difficult in any language. Prolog's searching abilities won't really help much here. -- Fergus Henderson <f...@cs.mu.oz.au> WWW: <http://www.cs.mu.oz.au/~fjh> PGP: finger f...@128.250.37.3 [It's my impression that in too many cases the only way to find perfectly optimal code would be to enumerate and check an impractically large set of possibilities. -John] You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||