Break the compiler into a compiler/linker

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Break the compiler into a compiler/linker

Post by Mistrel »

Recompiling very large projects in PB can take several minutes (10-15 on my laptop). The ability to compile separate source files into objects like C/C++ would make compile times much, much faster.

It does complicate the compile process but it is a logical step and improvement. It will help managing projects with a lot of source files where the majority of the code doesn't need to be updated.
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: Break the compiler into a compiler/linker

Post by UserOfPure »

10 minutes to compile a project? Can you post some stats on your laptop (CPU, RAM, etc), and also what your project is made up of, ie. number of source files and how many lines in each, and what included data, and so on. Because 10 mins seems far too long. You must have a mammoth project happening, like the source of Windows 7. :) Also, how long does the same project take to compile on a desktop PC? Maybe your laptop is the cause of the slow speed.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: Break the compiler into a compiler/linker

Post by Kaeru Gaman »

I would strongly discourage this request, until it would be an additional option wich is default off!

the hit-and-run feeling of PureBasic, simply press F5 and see what you created, is a very strong argument for beginners to chose this language.

development environments with seperated compiler and linker are only for professionals.
neither beginners nor hobby proggers will feel comfortable with it.
I wouldn't - and I'm a hobby progger for over 25 years now.
oh... and have a nice day.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Break the compiler into a compiler/linker

Post by Fred »

10 minutes ? The IDE compiles in seconds here (70.000 lines). The concept of linker and therefore modules is not easy to grap for beginners and we don't want to step in this direction.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Break the compiler into a compiler/linker

Post by ts-soft »

Fred wrote:The concept of linker and therefore modules is not easy to grap for beginners
The concept of modules solve many problems for large projects and advanced user :wink: (not for speed reason)
An option for modules would be nice

Greetings
Thomas
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: Break the compiler into a compiler/linker

Post by Foz »

Why not break it down into dll plugins instead then?
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: Break the compiler into a compiler/linker

Post by Rings »

using a RamDisk would increase speed a lot.....

@fred : thats unfair, you are using a fast SSD :)
SPAMINATOR NR.1
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Break the compiler into a compiler/linker

Post by srod »

Arctic Reports > 50000 lines of code, umpteen source files (more than 40); compiles in seconds here! Mistrel, how many files does this project of yours have?

As for modules compiling to individual object files... that would be a great addition yes. Drop a precompiled object file into a project and have it automatically linked in with the resulting exe... :) Could this not exist side by side with the existing arrangements?

Still, as nice as that feature would be, it is not absolutely crucial! :)
I may look like a mule, but I'm not a complete ass.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Break the compiler into a compiler/linker

Post by Fred »

Rings wrote:using a RamDisk would increase speed a lot.....

@fred : thats unfair, you are using a fast SSD :)
I was talking about my old single core Ahtlon 3000+ with regular disk :P
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Break the compiler into a compiler/linker

Post by Mistrel »

Sorry for the lack of detail. I wasn't clear in my first post about what I was actually doing and have subsequently mixed in some misinformation as well as my thoughts and intentions got jumbled.

I started to talk about the compiler/linker part and then thought about how long it takes me to compile PureGDK, without realizing I was mixing up PureBasic and TailBite. PureGDK is comprised of about 60 TailBite libraries, three DLLs, and some other miscellaneous tools. Only a small portion is actually compiled fully by PureBasic.

The comparison doesn't make sense because I'm not really compiling with PB.

My original thought stems from my using C++ more and more in my general work. I manage all of my projects, libraries, and dependencies using a combination of UNIX Bash and GNU Make. When projects start to get really big or just complicated I start abstracting things and put them in their own source files, to be compiled to their own object files which are then only updated if the source changes.

Managing a larger project compiled to individual objects just makes more sense to me; which why I requested this.

And for those of you who are wondering, my primary development environment is my laptop which is a 1.4Ghz Core 2 Solo with 4GB of memory. It's noticably slower at compiling than anything else I own. But the 8 hour battery makes up for it in spades.
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: Break the compiler into a compiler/linker

Post by ozzie »

I also wouldn't want the complication of a separate linker. My project is in excess of 113000 lines and it compiles in about 4 seconds. That's with an Intel Core 2, 2.10GHz, 1Gb RAM, running XP under Parallels on an Apple iMac.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Break the compiler into a compiler/linker

Post by srod »

113000 lines... wow, that is impressive. 8) Sounds like a beastie.
I may look like a mule, but I'm not a complete ass.
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: Break the compiler into a compiler/linker

Post by eesau »

ozzie wrote:My project is in excess of 113000 lines and it compiles in about 4 seconds.
Out of curiosity, what kind of a project is it and has it been easy to manage using PB?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Break the compiler into a compiler/linker

Post by DoubleDutch »

40,000+ lines 1 second or so to compile.

(Mac 2.8Ghz 2x 4-Core Xeon 6GB ram running Windows 7x64. But only one core will be doing the compiling. ;) )
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Break the compiler into a compiler/linker

Post by djes »

23000 lines for Purebreaker 3, and 1s compile time on this Pentium 4 2.8, 1.5GB
Post Reply