Sign in Join

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

Mailing lists / fpc-devel / 2020-08

Compiler development guides

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

J. Gareth Moreton

Writing compilers is a pretty specialised undertaking, so general guides are rather hard to come by. For FPC, your best bet is to study the source code of something that already exists, make notes and build from there.

Gareth aka. Kit

On Tue 18/08/20 14:39 , Florian Klämpfl via sent:

Show quoted text 29 lines
Am 18.08.20 um 14:46 schrieb Dmitriy Pomerantsev via fpc-devel: > Hello. Are there any guides for those who want to try adding something > to the compiler? No, there aren't. > For example, I would like to try making a new backend. > Is there some example template, etc? Or just other backend code examples? Best is to use an existing backend and ask questions here. _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Florian Klämpfl
to Dmitriy Pomerantsev:
Dmitriy Pomerantsev wrote
Hello. Are there any guides for those who want to try adding something to the compiler?

No, there aren't.

For example, I would like to try making a new backend. Is there some example template, etc? Or just other backend code examples?

Best is to use an existing backend and ask questions here.

Reply by email

J. Gareth Moreton

Sorry, I didn't mean to imply you were a
novice, just a slight warning to be prepared
when you dive into the code!

Some documentation would be nice for the
compiler, but I'm not sure where to begin
there except maybe with outlining the
individual compiler stages (creating nodes,
simplifying nodes, building target-specific
assembly language, peephole optimisation
etc.)

Gareth aka. Kit
On Tue 18/08/20 16:26 , "Dmitriy
Pomerantsev" sent:

 Thanks for the warning, but I'm not new

in programming. Just not familiar

with the Free Pascal source code. Dmitriy

Pomerantsev. 18.08.2020, 17:47,

"J. Gareth Moreton via fpc-devel" : Writing compilers is a pretty specialised

undertaking, so general guides

are rather hard to come by. For FPC, your best bet is to study the

source code of something that

Show quoted text 5 lines
already exists, make notes and build from there. Gareth aka. Kit

Reply by email

Christo Crause
to Dmitriy Pomerantsev:

On Tue, Aug 18, 2020 at 2:52 PM Dmitriy Pomerantsev via fpc-devel <

Show quoted text 6 lines
wrote: Hello. Are there any guides for those who want to try adding something to the compiler? For example, I would like to try making a new backend. Is there some example template, etc? Or just other backend code examples?

There are a couple of wiki pages with some information, see e.g. https://wiki.lazarus.freepascal.org/Porting_Free_Pascal and the links at the bottom of the page. It is unfortunately not very detailed and outdated, hence the advice to rather look at existing backend code.

Reply by email