Recent

Author Topic: Wiki stub: Make your own compiler, interpreter, parser, or expression analyzer  (Read 20269 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
I am on holiday but i can add some things next week.
Specialize a type, not a var.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
I am on holiday but i can add some things next week.
Please do!   :)
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Edson

  • Hero Member
  • *****
  • Posts: 1301
I think the best title for that WIki entry could be "Libraries for compiler, interpreter, parser, or expression analyzer". 
Then you can add information about TFPExpressionParser, and some links about "Make your own compiler".
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
If the Wiki entry is about "Make your own compiler", shouldn't there be some information about the importance of also knowing Assembly Language?
« Last Edit: September 21, 2018, 03:42:47 am by valdir.marcos »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Btw, I have just updated the wiki with 'Let's build a compiler' PDF from your site.  ;)

I didn't do it myself, because my site goes dark october 1st :-)
Preserved on webarchive, and wiki link changed accordingly:
http://web.archive.org/web/20180107011717/http://www.stack.nl:80/~marcov/compiler.pdf

I think the best title for that WIki entry could be "Libraries for compiler, interpreter, parser, or expression analyzer". 
Then you can add information about TFPExpressionParser, and some links about "Make your own compiler".
GOLD, COCO-R and AntLR have their own IDE where for example you can write, test, single step and debug your grammar, find ambiquities, and generate skeleton application code in many programming languages. These are definetly not libraries, so title would not be appropriate. "Tools and libraries for compiler, interpreter, parser, or expression analyzer" came to my mind after that, but it would not justify links in whe wiki which have full tutorials how to make your own compiler. Therefore I am more for original title, which reflect more what is inside the wiki. However this is not carved in stone, and I wouldn't mind if someone changes it. I care more about the content and contributions that would expand it. There are many situations when for a simple forum question you get many wiki links in an answer, and that repeats over and over. I would like to have a single wiki stub for the whole topic, even if it means that current layout should be changed in the future and separate wiki subtopic pages should be made. That way, for question like how to build a compiler, how to build an interpreter, how to build a front end, how to build a back end, what is an AST, what is a BNF grammar, how to parse this and that, how to make an expression analyzer and similar - we just give this single link and user will expand his knowledge from there. I didn't feel like adding links to wikipedia articles about all the terms since that would probably be too much, but other web links (especially when related to FreePascal) should end there.

If the Wiki entry is about "Make your own compiler", shouldn't there be some information about the importance of also knowing Assembly Language?
At least one of the links shows how to write a compiler with assembler generator back end. But that is indirect info. Please add direct info about assembler importance if you feel like it.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
If the Wiki entry is about "Make your own compiler", shouldn't there be some information about the importance of also knowing Assembly Language?
At least one of the links shows how to write a compiler with assembler generator back end. But that is indirect info. Please add direct info about assembler importance if you feel like it.
I was thinking about something deeper, but I'd better leave it alone.
I only did a minor edit about Coco/R.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
I only did a minor edit about Coco/R.
Thank you!
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Edson

  • Hero Member
  • *****
  • Posts: 1301
Hi. I'm starting to write some articles about creating compilers, using a simple example compiler for the x86 32 bits architecture.  :D

The challenge for the compiler example, will be to create it without any external library, just hand code routines, of FPC no objects, no class, no records, just using integers and strings.  :o

Only in spanish by now: http://blog.pucp.edu.pe/blog/tito/2019/01/05/crea-tu-propio-compilador-casero-parte-1/ :-[
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Only in spanish by now ...

Did you mean it will be available in English in the future?
I guess the answer is YES.
So I bookmarked the link and wait patiently. :)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Hi. I'm starting to write some articles about creating compilers, using a simple example compiler for the x86 32 bits architecture.  :D

The challenge for the compiler example, will be to create it without any external library, just hand code routines, of FPC no objects, no class, no records, just using integers and strings.  :o

Only in spanish by now: http://blog.pucp.edu.pe/blog/tito/2019/01/05/crea-tu-propio-compilador-casero-parte-1/ :-[
Excellent article!
I loved your "Yo no soy un dictador informático." :D

After this series on compilers, could you extend it to another series about assemblers and linkers?

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
I just read the article using Google Translate (Not a bad job for auto-translation) and I'm bookmarking and will keep checking back  :)

I've been playing with Plex and Pyacc, but one of the big things missing for me (In general in these topics) is how to actually implement a simple compiler (Not an interpreter).

lucamar

  • Hero Member
  • *****
  • Posts: 4219
I've been playing with Plex and Pyacc, but one of the big things missing for me (In general in these topics) is how to actually implement a simple compiler (Not an interpreter).

Jack Crenshaw's Let's build a compiler may interest you then. Although it's (unfortunately) unfinished.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
I started reading it after a few chapters, seemed pretty solid though.

I'll pick it back up when I get some free time again

Edson

  • Hero Member
  • *****
  • Posts: 1301
Only in spanish by now ...

Did you mean it will be available in English in the future?
I guess the answer is YES.
So I bookmarked the link and wait patiently. :)

I hope to have time to translate but if someone can help it will be good. Fortunately the language created (I called it "Titan") is in english so it won't be a problem.

Excellent article!
I loved your "Yo no soy un dictador informático." :D
After this series on compilers, could you extend it to another series about assemblers and linkers?

Thanks. I've created assemblers but no real linkers. I will consider to write about it after finished some projects.

I just read the article using Google Translate (Not a bad job for auto-translation) and I'm bookmarking and will keep checking back  :)

I've been playing with Plex and Pyacc, but one of the big things missing for me (In general in these topics) is how to actually implement a simple compiler (Not an interpreter).
The compiler used as example in this articles, is very simple, without some library, because the idea is to make this a Self-hosting compiler. That's why I'm using just a simple Pascal syntax to create the compiler.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Excellent article!
I loved your "Yo no soy un dictador informático." :D
After this series on compilers, could you extend it to another series about assemblers and linkers?
Thanks. I've created assemblers but no real linkers. I will consider to write about it after finished some projects.
Thanks.

In your opinion:
What are the best books about compilers or interpreters or assemblers or linkers?
Is there any new (last five or ten years) good books about compilers or interpreters or assemblers or linkers?

 

TinyPortal © 2005-2018