Compile a PB into PB library

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

musicandstamps wrote:Or am i missing the point :?:
indeed.
oh... and have a nice day.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

>> Or am i missing the point :?:

toolhelp in the ide
contexthelp with F1
unused functions not in the exe
userlib has own global variabel scope
private functions in userlib
and many more :wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
musicandstamps
User
User
Posts: 17
Joined: Sun Nov 12, 2006 3:22 pm
Location: Great Britain
Contact:

Post by musicandstamps »

Oh well

I will get there in the end :oops:
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Or am i missing the point :?:

Yes, because all uncalled procedures in that big include file will be compiled
into your app, making it bloated when there's no need. That's why many of
us want uncalled procedures NOT to be included in the compiled executable.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

PB wrote:> Or am i missing the point :?:

Yes, because all uncalled procedures in that big include file will be compiled
into your app, making it bloated when there's no need. That's why many of
us want uncalled procedures NOT to be included in the compiled executable.
I thought there were tests done and only a stub was included for uncalled procedures not the whole code?
--Kale

Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> I thought there were tests done and only a stub was included for uncalled
> procedures not the whole code?

Maybe not entire code, but strings and API calls are still included, even if
the procedures aren't called anywhere. My own tests confirmed that. In
an ideal PureBasic, none would be included at all.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

PB wrote:> I thought there were tests done and only a stub was included for uncalled
> procedures not the whole code?

Maybe not entire code, but strings and API calls are still included, even if
the procedures aren't called anywhere. My own tests confirmed that. In
an ideal PureBasic, none would be included at all.
Definitely not the entire code - as established in the thread:

http://www.purebasic.fr/english/viewtop ... ht=include

However, all procedures referenced from other procedures (even if the 'parent' proc is not called) get included in the final exe. Same with api calls etc. For simplicity's sake I guess, bearing in mind that PB is a single pass compiler.
I may look like a mule, but I'm not a complete ass.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

srod wrote:However, all procedures referenced from other procedures (even if the 'parent' proc is not called) get included in the final exe.
and that's one of the points.
if I have a little Include with standalone procedures, everything is fine.
if I have a complex structure with a handfull of control-procedures called
from outside and dozends of internal procedures I will have almost the
complede Include included even if it is not used at all.

and the other point still remains:
what if I want to offer the Functionallity of my code to the Community, but not the Code itself?
and what if I additionally don't want to give away a DLL?
then I need to provide a UserLib, or keep that Functionallity for my own.
oh... and have a nice day.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Kale wrote:This fear about closed libs has been raised before by lots of people! 2003 anyone?:
http://www.purebasic.fr/english/viewtopic.php?t=16195 :roll:
Even earlier than that! 2001 anyone?:

http://www.purebasic.fr/english/viewtopic.php?t=3380
http://www.purebasic.fr/english/viewtopic.php?t=3971
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Kale wrote:
Kaeru Gaman wrote:yo hey, do you think I search the forum for 4 year old threads everytime some topic occurs?
Perhaps everybody should!
fsw wrote:
Kale wrote:This fear about closed libs has been raised before by lots of people! 2003 anyone?:
http://www.purebasic.fr/english/viewtopic.php?t=16195 :roll:
Even earlier than that! 2001 anyone?:

http://www.purebasic.fr/english/viewtopic.php?t=3380
http://www.purebasic.fr/english/viewtopic.php?t=3971
I can't see the point with that old threads, because so much has changed in the meantime.
in 2001 you were programming in PB 2.00 - 2.70
and the point mentioned in the 2001 thread no.3380 was some totally different:
there was asked "why not write Libs in PB"

2003's thread was about LibMania - ok


I'd like to guide us back to topic:
Some (most?) of us think, a build-in LibCreator would be a good feature.

srod mentioned the Threadsafe/Unicode problem with Libs,
I think that is a point worth being discussed further.
oh... and have a nice day.
Brice Manuel

Post by Brice Manuel »

and the other point still remains:
what if I want to offer the Functionallity of my code to the Community, but not the Code itself?
and what if I additionally don't want to give away a DLL?
then I need to provide a UserLib, or keep that Functionallity for my own.
I agree and this feature should be built in as it is with ebasic.

However, In the past I offered to share a 2D GUI I was working on and release it as a lib and I was flamed for my efforts by people demanding code and not a lib.

Still, this is a feature I would use, as I would use libs I create for my own use and not share them.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Brice Manuel wrote:... I was flamed for my efforts by people demanding code and not a lib.
sure one can learn more from an OpenSource-Lib than from a ClosedSouce-Lib.
but after all it is your own decision how to publish it.

those who complain shout be aware, that providing code will always lead
to someone using your code and claiming it their own.

sure this is something to think about
- help others more to learn and accept your code will be misused
- or just provide functionallity and stand some complaints

you can't make it nice for everybody, and if you try too hard, they'll nail you to a tree someday....
oh... and have a nice day.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

For PBOSL all Sources avalaible, but the most users only download the binaries.
Creating Libs in PB is a missing feature!
You can create your own libs in Delphi, XProfan, EBasic and so on, why not in PB?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

i second the request.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

I want an option to compile to UserLib too
Post Reply