Sign in Join

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

Mailing lists / fpc-other / 2017-01

How was compiled the very first version of FPC?

15 messages · 10 people · –

Reply by email Subscribe to this list Your subscription

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

Giuliano Colla

While installing FPC on a new platform, and looking for the appropriate seed compiler, a question came to my mind.

As compiling FPC from sources requires a previous FPC version, how was compiled the very first version of FPC?

I have a found a number of possible answers, but which one is the good one?

1) FPC has always existed, it was just created at the Big Bang, at the same time as the hydrogen atoms.

2) A minimal version of FPC was written in assembler.

3) A minimal version of FPC was written in ALGOL

4) The first FPC was written in Pascal and compiled using Turbo Pascal or something similar.

I'm fond of answer 1) :-) but I'm unsure...

Giuliano

Reply by email

Karoly Balogh (Charlie/SGR
to Giuliano Colla

Hi,

Giuliano Colla wrote 10 lines
While installing FPC on a new platform, and looking for the appropriate seed compiler, a question came to my mind. As compiling FPC from sources requires a previous FPC version, how was compiled the very first version of FPC? I have a found a number of possible answers, but which one is the good one? 1) FPC has always existed, it was just created at the Big Bang, at the same time as the hydrogen atoms.

Yes, and it then since became a supermassive black hole, sucking all code out of the poor maintainers! :P

4) The first FPC was written in Pascal and compiled using Turbo Pascal or something similar. I'm fond of answer 1) :-) but I'm unsure...

The point 4. is correct. The first version was done in Turbo Pascal, then eventually the compiler became able to compile itself. Until 1.0(?) I think it was still possible to build the compiler with TP7. Later the TP7 compatibility was dropped, and since then FPC is only developed in itself.

It's written on Wikipedia BTW:
https://en.wikipedia.org/wiki/Free_Pascal#Early_years

:)

Charlie

Reply by email

Mark Morgan Lloyd
to Karoly Balogh (Charlie/SGR
Karoly Balogh wrote 17 lines
Hi, On Mon, 9 Jan 2017, Giuliano Colla wrote: > While installing FPC on a new platform, and looking for the appropriate seed > compiler, a question came to my mind. > > As compiling FPC from sources requires a previous FPC version, how was > compiled the very first version of FPC? The point 4. is correct. The first version was done in Turbo Pascal, then eventually the compiler became able to compile itself. Until 1.0(?) I think it was still possible to build the compiler with TP7. Later the TP7 compatibility was dropped, and since then FPC is only developed in itself. It's written on Wikipedia BTW: https://en.wikipedia.org/wiki/Free_Pascal#Early_years

And ultimately I think that TP was written in Z80 assembler, later converted to 8086.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Travis Siegel
to Mark Morgan Lloyd
And ultimately I think that TP was written in Z80 assembler, later converted to 8086.

Actually, I don't know about versions pre 4.0), but source code versions of tp 6 have escaped into the wild, and if you can locate one of those, you'll see turbo pascal is written in turbo pascal as well. There's assembly language for some routines to speed up certain parts of the code, but in general, it's mostly pascal code. Interesting, but I never did look at the code itself, since I didn't have the tools required to compile it, so it never interested me. Of course, I haven't a clue where you'd find such a thing these days, last time I saw it was about 10 years ago, on some chineese site, so who knows.

---
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

gabor
to Travis Siegel

http://turbopascal.org/
I think it's not borland's turbo pascal

W dniu 2017-01-10 o 21:59, Travis Siegel pisze:

Show quoted text 24 lines
> And ultimately I think that TP was written in Z80 assembler, later > converted to 8086. > Actually, I don't know about versions pre 4.0), but source code versions of tp 6 have escaped into the wild, and if you can locate one of those, you'll see turbo pascal is written in turbo pascal as well. There's assembly language for some routines to speed up certain parts of the code, but in general, it's mostly pascal code. Interesting, but I never did look at the code itself, since I didn't have the tools required to compile it, so it never interested me. Of course, I haven't a clue where you'd find such a thing these days, last time I saw it was about 10 years ago, on some chineese site, so who knows. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus _______________________________________________ fpc-other maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other

Reply by email

geneb
to Travis Siegel: Actually, I don't know about versions pre 4.0), but source code versions of tp 6 have…
Travis Siegel wrote 6 lines
> And ultimately I think that TP was written in Z80 assembler, later > converted to 8086. > Actually, I don't know about versions pre 4.0), but source code versions of tp 6 have escaped into the wild, and if you can locate one of those, you'll

Maybe for the TP6 runtime libraries, but never for the compiler itself as far as I know. BP7 included the runtime sources as part of the distribution.

g.

Proud owner of F-15C 80-0007 http://www.f15sim.com - The only one of its kind. http://www.diy-cockpits.org/coll - Go Collimated or Go Home. Some people collect things for a hobby. Geeks collect hobbies. ScarletDME - The red hot Data Management Environment A Multi-Value database for the masses, not the classes. http://scarlet.deltasoft.com - Get it _today_!

Reply by email

Ralf Quint
to gabor: http://turbopascal.org/ I think it's not borland's turbo pascal W dniu 2017-01-10 o…
gabor wrote
http://turbopascal.org/ I think it's not borland's turbo pascal

No, it's not, it's the site of a Russian guy who says he reverse engineered Turbo Pascal 7 and sells the source code for that (called TPC16, there's also a 32bit version compiled with Delphi).

This site is around for years, so if something would be way out of whack on how he got the source code, I am pretty sure
Borland/Inprise/Codegear/Embarcadero would have gotten on his case a long time ago.

Ralf

---
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Mark Morgan Lloyd
to Ralf Quint
Ralf Quint wrote 7 lines
On 1/10/2017 1:31 PM, gabor wrote: > http://turbopascal.org/ > I think it's not borland's turbo pascal > No, it's not, it's the site of a Russian guy who says he reverse engineered Turbo Pascal 7 and sells the source code for that (called TPC16, there's also a 32bit version compiled with Delphi).

OK, but it does explicitly say that (early) TP was written in assembler. I'd also add that earlier versions, certainly <= v3, didn't allow general-purpose external libraries so it's unlikely that the library later shipped with (Pascal) source was relevant in those days.

So ultimately, all compilers depend heavily on assembler: either in a prototype which was later re-written in itself, or in an earlier compiler (e.g. C initially being written in B which was written in A which was written in assembler, or some similar chain).

Some system architectures provided more help than others for this job: Wirth recoded his earlier Euler and wrote much of ALGOL-W while he was at Stanford where they had a B5500, which had very high-level machine instructions. But something like the early TP compiler and editor, written in Z80 assembler for systems which didn't have a character-mapped screen or a standardised keyboard, took real skill.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Lars
to Giuliano Colla: While installing FPC on a new platform, and looking for the appropriate seed compiler, a…
Giuliano Colla wrote 12 lines
While installing FPC on a new platform, and looking for the appropriate seed compiler, a question came to my mind. As compiling FPC from sources requires a previous FPC version, how was compiled the very first version of FPC? I have a found a number of possible answers, but which one is the good one? 1) FPC has always existed, it was just created at the Big Bang, at the same time as the hydrogen atoms.

(turbo pascal)

This very question was asked many years ago, maybe by myself, when I was first learning FPC.

We got in to discussions about the origin of the universe itself, and Florian K. ended up saying something about physical bit switches being used to program a system which has no software on it yet...

But I could be distorting the discussion slightly ;-)

If I could find the old posts from maybe 2004-2006 era I would.. but I'm too lazy to look in the archives. Basically the meaning of life is: "if there is no software yet installed on the circuit board and you have no other options, just use some physical bit switches to program the system with your bare hands"... But yes it was turbo pascal that was used.

Reply by email

Lars
to Travis Siegel: Actually, I don't know about versions pre 4.0), but source code versions of tp 6 have…
Travis Siegel wrote 10 lines
> And ultimately I think that TP was written in Z80 assembler, later > converted to 8086. > Actually, I don't know about versions pre 4.0), but source code versions of tp 6 have escaped into the wild, and if you can locate one of those, you'll see turbo pascal is written in turbo pascal as well. There's assembly language for some routines to speed up certain parts of the code, but in general, it's mostly pascal code.

Maybe in the later days but Turbo Pascal originally was written in, AFAIK, 100 percent assembly code, with not a single source comment...

Anders was very secretive about his code as he didn't want people to steal it.... and protected it closely....

In the later (or latter) days, Borland decided that assembly code was not so easy to maintain... I thought they made this decision in delphi days, but maybe they made in at some point in Turbo Pascal days and converted some of Anders assembly to turbo pascal.

Reply by email

Lars
to Ralf Quint: No, it's not, it's the site of a Russian guy who says he reverse engineered Turbo Pascal…
Ralf Quint wrote 15 lines
On 1/10/2017 1:31 PM, gabor wrote: > http://turbopascal.org/ > I think it's not borland's turbo pascal > > No, it's not, it's the site of a Russian guy who says he reverse engineered Turbo Pascal 7 and sells the source code for that (called TPC16, there's also a 32bit version compiled with Delphi). This site is around for years, so if something would be way out of whack on how he got the source code, I am pretty sure Borland/Inprise/Codegear/Embarcadero would have gotten on his case a long time ago.

Well, the uncommented assembly code source of Turbo Pascal was in fact leaked on torrent or emule ... but whether he saw this source I don't know... But I know it was indeed leaked.

Reply by email

Lars
to Lars: (turbo pascal) This very question was asked many years ago, maybe by myself, when I was…
I previously wrote 7 lines
> 1) FPC has always existed, it was just created at the Big Bang, at the > same time as the hydrogen atoms. > This very question was asked many years ago, maybe by myself, when I was first learning FPC.
Show quoted text 8 lines
We got in to discussions about the origin of the universe itself, and Florian K. ended up saying something about physical bit switches being used to program a system which has no software on it yet... But I could be distorting the discussion slightly ;-) If I could find the old posts from maybe 2004-2006 era I would..

Ehhh...

Reply by email

Lukasz Sokol
to Lars: (turbo pascal) This very question was asked many years ago, maybe by myself, when I was…
Lars wrote 14 lines
This very question was asked many years ago, maybe by myself, when I was first learning FPC. We got in to discussions about the origin of the universe itself, and Florian K. ended up saying something about physical bit switches being used to program a system which has no software on it yet... But I could be distorting the discussion slightly ;-) If I could find the old posts from maybe 2004-2006 era I would.. but I'm too lazy to look in the archives. Basically the meaning of life is: "if there is no software yet installed on the circuit board and you have no other options, just use some physical bit switches to program the system with your bare hands"... But yes it was turbo pascal that was used.

ICSMBIDNWT (I Could Stop Myself But I Did Not Want To)

https://xkcd.com/378/

-L.

Reply by email