PDA

View Full Version : Making a programming language in FPC



EmbranceII
05-02-2005, 10:37 AM
I have made a custom set of units for this purpose.
Now i have some question:
1)What needed to make a compiler?
2)What needed to make a interpeter?
3)What the difference between compiler/interpeter?
4)How fast each of them is?
5)In what language FPC is developed in?(lol,that a simple one)

Some direction would be good.
Thanks for your time!

WILL
05-02-2005, 11:24 AM
I have made a custom set of units for this purpose.
Now i have some question:
1)What needed to make a compiler?
2)What needed to make a interpeter?
3)What the difference between compiler/interpeter?
4)How fast each of them is?
For all 4 I'd recommend a very good article called Let's Build A Compiler! that is listed in the Library section of PGD, right here (http://www.pgd.netstarweb.com/library.php?show=list&cat=4#26).


5)In what language FPC is developed in?(lol,that a simple one)

Some direction would be good.
Thanks for your time!
Free Pascal, as far as I know, is actually built by the FPC itself. :) Lazarus, I know is buit under it. At the very least I don't know what they originally used to make the first couple of builds, but I'm guessing it was not FPC. ;)

EmbranceII
05-02-2005, 12:03 PM
Thatnks fot the article link.It very nice and clean!
Also i asked about FPC,becouse i somewhere read it was built using TP.
So normally this nakes it an intepeted language...lol

WILL
05-02-2005, 12:13 PM
:lol: FPC is hardly interprited... Those articles I set you to will help clairify some things, but the main difference is that a compiler creates a file that contains machine code where as an interpriter just interprites the code from the file... no machine code is written, it's just ran.

The code for the article is Pascal! Seriously... he used Turbo Pascal 4 for it... But with just a few tiny tweeks you can easilyuse either Delphi or FPC to compile... I've tested the code myself. I'm up to about Part 4 myself... got busy again after that. ;)

If you have any FPC questions I suggest posting in the Free Pascal forum here, we have some of it's developers visit on occation and will be able to answer questions directly.

Have fun making your own compiler! :D

EmbranceII
05-02-2005, 02:03 PM
Well,i saw some of the code.
Also my puprose is this:
There s big hole in Pascal site/forums.I will have to wait a little for my site to be launched but after i do i hope to help this hole to be closed.
It will have tutorials for FPC only and unit,stuff about it too.
No TP though.
Howeve everything can change at last minute..So none knows!lol

WILL
05-02-2005, 02:21 PM
A hole?!? :o Where? Do you mean that it lacks a huge library? I couldn't agree more. Thats what our misison is with the Library on PGD. Hopefully we'll start seeing more articles coming in too.

I might even try an interview with our favorite compiler developers over at FPC... :)

Geez, I hope noone falls and gets hurt. :lol:

EmbranceII
05-02-2005, 02:42 PM
hole=lack of stuff around Pascal and FPC....
I know there are some sites with great sutff on Pascal but its for TP...
That s what i ment!lol

WILL
05-02-2005, 02:55 PM
Yes, very true. Not supprising how when most people think of Pascal TP7 comes up. Borland's move to the term 'Delphi' confused more than just non-Pascal programmers. I myself, didn't even know they did so until around when Delphi 3 was out. That was around 1997 and I was hurting for a Windows capable Pascal compiler. :) I sort of knew about FPC, but it was *really* early in development and the other alternatives were just not that great. Found out about it on some IRC channel actually.

That article by Jack Crenshaw is great actually, it refrains from going too far into actual platforms(save the Motarola 64000 Assembly code it generates) and gets right to the nitty gritty without taking you off-track with alot of dated material. Probably why it's lasted so long as a valuable set of learning material. Unfortunately it does not seem to have alot of information about making the Linker if at all. You may have to research that one yourself.

marcov
06-02-2005, 10:25 PM
For all 4 I'd recommend a very good article called Let's Build A Compiler! that is listed in the Library section of PGD, right here (http://www.pgd.netstarweb.com/library.php?show=list&cat=4#26).

Here is a PDF version: http://www.stack.nl/~marcov/compiler.pdf


To the OP: did you check the FPC contributed units site ?:

http://www.freepascal.org/contrib/db.php3?category=all