Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-07

New to list

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart Hotmail

Hi,

Because i am very much interested in code optimization (SSA), I got the fpc v2.0.2 source and am reading through it & the internals doc. For now i have the following questions/comments:
* Are there plans to put in the missing parts of the internals doc, specifically "The code generator"?
* Are there plans to perform (some level of) code cleanup? I found that the code not always easy to follow
for example: there are procedures of 100s of lines long, the compiler state is composed of a lot of global
variables spread accross several units, and there is mixed coding conventions (name casing, indenting).
Beforehand i expected to see the front-end and back-end loosely coupled (nice for putting a new front end in to make a new compiler), but i have not been unable to tell yet.

Of course, I am always happy to contribute.

Bart

Reply by email

Daniël Mantione
to Bart Hotmail

Op Sun, 16 Jul 2006, schreef Bart Hotmail:

Hi, Because i am very much interested in code optimization (SSA),I got the fpc v2.0.2 source and am reading through it & the internals doc.

Check the wiki article "Single assignment", which deals about the subject.

For now i have the following questions/comments: * Are there plans to put in the missing parts of the internals doc, specifically "The code generator"?

What document are you referring to, Comparch.pdf? That document is indeed outdated. While updating is might be a good idea, I fear there are much higher priorities.

Show quoted text 6 lines
* Are there plans to perform (some level of) code cleanup? I found that the code not always easy to follow for example: there are procedures of 100s of lines long, the compiler state is composed of a lot of global variables spread accross several units, and there is mixed coding conventions (name casing, indenting).

During normal development, we are contiuously doing changes to get the code cleaner and actually I'm reasonably satisfied with the cleanness of the code at the moment: We have a very clean code generator structure, the code is reasonably well documented, OOP is used were appropriate, etc. However, there is always room for improvement and indeed there exist a few very long procedures.

Beforehand i expected to see the front-end and back-end loosely coupled (nice for putting a new front end in to make a new compiler), but i have not been unable to tell yet.

The back-end has a reasonably clean interface, because the parser creates nodes using virtual constructors. It should therefore be possible to bolt a different parser on top of the backend. However, nobody has walked this path yet.

Of course, I am always happy to contribute.

Sounds interresting!

Daniël

Reply by email

Bart Hotmail
to Daniël Mantione
Check the wiki article "Single assignment", which deals about the subject.

I have done a substantial deal of reading on optimizing and SSA already. And the fpc source seems a nice start to get at it :). However i need to get to know the source better.

What document are you referring to, Comparch.pdf?

I am referring to the wiki of course :).

During normal development, we are contiuously doing changes to get the code cleaner and actually

On what part is the majority of work being done at the moment? (Guess it's not the scanner & parser).

...I'm reasonably satisfied with the cleanness of the code at the moment: We have a very clean code generator structure, the code is reasonably well documented, OOP is used were appropriate, etc.

Sounds interesting :). I didnt get to the code generator yet (the internals wiki
does not cover it). Is there other documentation on the "code generator structure"?

However, there is always room for improvement and indeed there exist a few very long procedures.

Well in the end i can get use to anything. But i available for giving feedback on
design improvements.

Bart.

Reply by email

Daniël Mantione
to Bart Hotmail

Op Sun, 16 Jul 2006, schreef Bart Hotmail:

Show quoted text 8 lines
> Check the wiki article "Single assignment", which deals about the > subject. I have done a substantial deal of reading on optimizing and SSA already. And the fpc source seems a nice start to get at it :). However i need to get to know the source better. > What document are you referring to, Comparch.pdf? I am referring to the wiki of course :).

That is a user initiative. I expect it will occasionally be improved by people.

Show quoted text 5 lines
> During normal development, we are contiuously doing changes to get the > code cleaner and actually On what part is the majority of work being done at the moment? (Guess it's not the scanner & parser).

That is right, because the scanner and parser have reached a very stable state, they can parse the Pascal language and only need to be changed for new language features which can be easily added in the current structure.

Show quoted text 9 lines
> ...I'm reasonably satisfied with the cleanness of the > code at the moment: We have a very clean code generator structure, the > code is reasonably well documented, OOP is used were appropriate, etc. Sounds interesting :). I didnt get to the code generator yet (the internals wiki does not cover it). Is there other documentation on the "code generator structure"?

My OSNews article contains the general idea how it works, but detailed documentation doesn't exist yet at this time.

Daniël

Reply by email