2-pass compiling support

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Post by blueb »

netmaestro:
I remember compiling 500 lines of Clipper code on a 20 mhz AT and going out for a smoke waiting for it to finish!
Geez, you had a fast one.... mine was the early 6 mz (the later one went to 8 mz)... circa 1984.

My first pc in 1981 was a IBM 8088 at 4.77mz

--blueb

Now I'm frying eggs with an AMD FX-55
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Straker
Enthusiast
Enthusiast
Posts: 701
Joined: Wed Apr 13, 2005 10:45 pm
Location: Idaho, USA

Post by Straker »

Oh yes, I remember Wang. 1987. All of the secretaries in our office used them. Just the word processors though.

I would hand my secretary a memo and say "wang this". These days, I would probably get arrested if I said that.
Image Image
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

lol. :D

I remember Wang as well (and wang's basic).


Edit: Was it just your office that was out of the ark? Or were you there as well, just kept in a different stall from me?
Dare2 cut down to size
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

helpy wrote:
aaron wrote:... an attachment to the IDE that runs a first pass through the code, extracts all the procedure names and re-writes them as declares, and then either jams them into the top of the source code or into a second include file.
But than all structures have to be extracted and put before all declares, because there could be structure pointers as procedure argumnts! And the structures also have to be in the right order!
Does anyone know of such a plugin? At times, it would ease the pain of rearranging procedures in the proper order so it can compile.. of course declares are the answer but creating these (when there are lots of procedures) is not productive use of time. If we can't have 2-pass compiler support, at least it would be great to have an automated process in the IDE to properly build these declares.

In doing a search for the above, seems that others agree that a 2-pass compiler is handy for another reason -> not compiling unused procedures.

Thanks.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

it's not too difficult to build, the major problem would be line number mismatch for error reporting, unless all declares would be in an included file...

hmm...
that just might work...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Hi blueznl
blueznl wrote:all declares would be in an included file...
Personally, that would be ok with me - then these are out of your face, and you can code with confidence (not worrying about procedure ordering). It would be great if you can make a tool or plug-in. :)
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post by Dreglor »

Personally I like to code with a single pass compiler for various reasons

1) Speed; a single pass compiler as you know takes seconds to compile it makes debugging so much easier and less frustrating to wait for it to compile (like in C++)

2) One Less thing to keep track of; If you know the order of everything works then you don't have to worry about if it is declared in this file or that file first, Xinclude helps if it doesn't pick up like it should

3) Coding ethics; I like to keep my code nice, clean, and readable the single pass keep everything readable you can visually see how things can be declared and are at. You will always know the area were previously declared code is, instead of asking where the hell did that structure/procedure come from? a double pass compiler could allow for code to look pretty tangled and far from orderly.
~Dreglor
MLK
User
User
Posts: 57
Joined: Sat Jan 24, 2004 8:46 pm
Location: Germany

Post by MLK »

i would really like to see this feature implemented, as i would like to forget about declares and create my gadgets like:

Code: Select all

Global Gadget.l = ...Gadget(#PB_Any, ...)
robleong
User
User
Posts: 38
Joined: Mon May 19, 2003 10:20 pm
Location: San Francisco bay area, California, USA
Contact:

Post by robleong »

I didn't realize PureBasic has a one-pass compiler until I started reading Kale's book. I too would be keen for a two-pass option in the future because I'm so used to the latter. However, I do understand that it is not likely to happen, nor should it be one of Fred's priority! :)
Post Reply