Mailing lists / fpc-devel / 2020-08
Compiler development guides
9 messages · 5 people · –
- DDmitriy Pomerantsev 4
- JJ. Gareth Moreton 2
- CChristo Crause 1
- FFlorian Klämpfl 1
- JJonas Maebe 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
Dmitriy Pomerantsev wroteHello. 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.
Writing compilers is a pretty specialised undertaking, so general guides are rather hard…
No, there aren't. Best is to use an existing backend and ask questions here.
Florian Klämpfl wroteBest is to use an existing backend and ask questions here.
The AArch64 backend should be fairly clean as a starting point.
Jonas
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
On Tue, Aug 18, 2020 at 2:52 PM Dmitriy Pomerantsev via fpc-devel <
Show quoted text 6 lines
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.
Sorry, I didn't mean to imply you were a novice, just a slight warning to be prepared…
