Path: utzoo!utgpu!attcan!uunet!mcvax!unido!ecrcvax!micha From: micha@ecrcvax.UUCP (Micha Meier) Newsgroups: comp.lang.prolog Subject: Re: Pascal/C -vs- Prolog Message-ID: <607@ecrcvax.UUCP> Date: 3 Aug 88 11:06:20 GMT References: <184@quintus.UUCP> Reply-To: micha@ecrcvax.UUCP (Micha Meier) Organization: ECRC, Munich 81, West Germany Lines: 30 In article <184@quintus.UUCP> ok@quintus () writes: >A fast compiler is well worth having, but I think it is better for Prolog >users in the long run if vendors try to make faster compilers *in Prolog*. I absolutely agree, but the question I am raising is "is that possible?" and "how can it be done?". I definitely don't have a 20 years' experience with programming in C (I knew Prolog before C), and I haven't tried to write the compiler in Prolog; however, I've seen quite a few Prolog compilers in Prolog, and all of them are really *slow* compared to the C version. I suggest that people analyze their Prolog compilers and share the experiences, because as long as the compilers in Prolog cannot compete the ones in C, Prolog cannot be claimed to be 'the compiler implementation language'. I know that lot of people will say that a compiler in Prolog is more readable, better maintainable etc., but so is my Sepia compiler in C. Bruno has already noted that his compiler spends the majority of time in managing the database (record*), and of course in C is this much easier. My compilers spends 56 units in the lexical analysis, 90 units in parsing, 47 units in the second pass and 25 units in the code generation (and other units elsewhere). This looks like the first pass is the most expensive one (I'm not a compiler expert :-)). How is it in a compiler written in Prolog? Are other compilers in C similar? (units measured compiling CHAT-80). --Micha