[fpc-devel] Alternative parsers

Michael Van Canneyt michael at freepascal.org
Tue Oct 19 15:50:51 CEST 2010



On Wed, 20 Oct 2010, Alexander Klenin wrote:

> On Wed, Oct 20, 2010 at 00:11, Florian Klaempfl <florian at freepascal.org> wrote:
>> Am 19.10.2010 14:48, schrieb Alexander Klenin:
>>> On Tue, Oct 19, 2010 at 23:14, Florian Klaempfl <florian at freepascal.org> wrote:
>>> I actually teach compiler construction at the university,
>>> and he correctly noted that compilers produced by some
>>> students at the end of the course are better structured than FPC.
>>
>> Oh really? Where can I download these great compilers?
>
> http://imcs.dvgu.ru/works/home?name=%D0%9A%D0%BE%D0%BC%D0%BF;wt=1567;do_select=1
> Sorry, russian interface only.
>
>> I hope they are ready for production use.
> Of course not, they are written in 4 months by the 3rd year students
> spending 3-4 hours per week.
>
>> BTW: We spend a lot of time to fix his mess of
>> code :) No problem he was student, but I consider him far from being
>> able to judge about code quality considering his work :)
>
> I know, he is certainly not the best student, but not a bad one too.
> Still, two points:
> 1) While he may be a bad judge, but he is certainly a good case study
> of an average programmer trying to make sense of FPC codebase.
> 2) I'd say that at least half of his mistakes could be avoided
> by better code structure of FPC -- he was really uncomfortable
> using strange records and pchars instead of normal objects and strings.

That has nothing to do with code structure, but with efficiency.

pchar and records are much faster than objects and strings.
This has been established empirically a long time ago by the compiler
developers. Speed of the compiler is an important factor, so records and
pchars are used.

So with your last argument you actually strengthen Florians case.

Michael.



More information about the fpc-devel mailing list