PureBasic Librarian

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: PureBasic Librarian

Post by DarkDragon »

mk-soft wrote: Wed Jan 10, 2024 7:36 pm User Library only makes sense if you program your own functions and controls in 'C' and include the headers from the Purebasic SDK.
Thus the user libraries can also be recompiled with 'C' with a new version of the Purebasic SDK and pblibrarymaker.
I do not mean here the 'C' backend of Purebasic!

But I haven't tried it myself yet
Doesn't work due to missing headers. I wanted to implement a feature that I'd like to have and directly deliver the source with it such that Fred has less work to do if he decides to include that feature.

But that reason might not be valid enough. The Userlib hell would still exist with all static libs that have dependencies. No matter if written with C or PB.
Last edited by DarkDragon on Wed Jan 10, 2024 8:37 pm, edited 2 times in total.
bye,
Daniel
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PureBasic Librarian

Post by skywalk »

Will PB transpiled C code ever be compiled as a static lib?
That is on my wish list.
Yes, dll is available, but more files to manage.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: PureBasic Librarian

Post by DarkDragon »

skywalk wrote: Wed Jan 10, 2024 8:35 pm Will PB transpiled C code ever be compiled as a static lib?
That is on my wish list.
Yes, dll is available, but more files to manage.
With static libs you have to distinguish between those including all dependencies and those which don't. First ones could potentially fail during interop with PureBasic again (duplicate symbols), latter ones fail when used outside PureBasic (missing symbols).

Those including dependencies could also be against the rules, as it's against the wrapper rule.
bye,
Daniel
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PureBasic Librarian

Post by skywalk »

Yes, I ran across conflicts in the past and solved it with Prototypes or modified Import?
Can't remember exact details.
But, can't the few dependencies be renamed with a namespace prefix?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: PureBasic Librarian

Post by DarkDragon »

skywalk wrote: Wed Jan 10, 2024 9:05 pm Yes, I ran across conflicts in the past and solved it with Prototypes or modified Import?
Can't remember exact details.
But, can't the few dependencies be renamed with a namespace prefix?
You can hide symbols by obfuscation or direct addressing without going over a symbol at all of course, but I've never done it with precompiled libraries. I'm not sure if that functionality is implemented for all linkers/platforms PureBasic relies on.

With ld you can add the parameter --retain-symbols-file and pass a file listing symbols to keep.
bye,
Daniel
akee
Enthusiast
Enthusiast
Posts: 496
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Re: PureBasic Librarian

Post by akee »

I do feel that if your have compiled your commonly used code into a library then coding would make your existing projects smaller.
akee
Enthusiast
Enthusiast
Posts: 496
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Re: PureBasic Librarian

Post by akee »

Please help see if we can have a PureBasic librarian or at least a documented way to compile PureBasic code to PureLibraries like TailBite.
Axolotl
Addict
Addict
Posts: 804
Joined: Wed Dec 31, 2008 3:36 pm

Re: PureBasic Librarian

Post by Axolotl »

A few thoughts from me to the initial question.

1. Although I only program for myself, I would be very reluctant to install 3-party closed source software. So far I have always resigned myself to having a worse or no solution. And yes, I know PB itself is closed source in large parts.

2. I use a "big" include file, which I integrate in different projects. Unfortunately it happens to me again and again that I make (unintentionally incompatible) changes, which then fall on my feet in other "projects".
Here I could imagine that a "pre-compiled" lib would protect me from carelessly (on the fly) incorporating a change.
Currently I set the include file to readonly. (Unfortunately, the IDE does not support read only files - you will see if you change something......)

Conclusion:
Why not create the possibility of creating libraries and include a "how to create a library with PB".
But it should be possible with PB's own resources. The installation of arbitrary C compilers would - from my point of view - not be helpful.

I am sure, everyone can decide for themselves whether to use such a lib without source or not.
And honestly, I think Fred has already formed his opinion.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
BarryG
Addict
Addict
Posts: 4136
Joined: Thu Apr 18, 2019 8:17 am

Re: PureBasic Librarian

Post by BarryG »

Axolotl wrote: Thu Apr 18, 2024 2:59 pmthe IDE does not support read only files
Say what? Yes, it does. I have dozens of read-only files included in my source. Have used them for years.
Axolotl
Addict
Addict
Posts: 804
Joined: Wed Dec 31, 2008 3:36 pm

Re: PureBasic Librarian

Post by Axolotl »

BarryG wrote: Thu Apr 18, 2024 10:14 pm Say what? Yes, it does. I have dozens of read-only files included in my source. Have used them for years.
We have a differnt understanding about support. I dont known the command for changing the attribute read only in the ide.
Sure you can open and compile a read only file. That is what I do as well.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
akee
Enthusiast
Enthusiast
Posts: 496
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Re: PureBasic Librarian

Post by akee »

Axolotl wrote: Thu Apr 18, 2024 2:59 pm A few thoughts from me to the initial question.

1. Although I only program for myself, I would be very reluctant to install 3-party closed source software. So far I have always resigned myself to having a worse or no solution. And yes, I know PB itself is closed source in large parts.

2. I use a "big" include file, which I integrate in different projects. Unfortunately it happens to me again and again that I make (unintentionally incompatible) changes, which then fall on my feet in other "projects".
Here I could imagine that a "pre-compiled" lib would protect me from carelessly (on the fly) incorporating a change.
Currently I set the include file to readonly. (Unfortunately, the IDE does not support read only files - you will see if you change something......)

Conclusion:
Why not create the possibility of creating libraries and include a "how to create a library with PB".
But it should be possible with PB's own resources. The installation of arbitrary C compilers would - from my point of view - not be helpful.

I am sure, everyone can decide for themselves whether to use such a lib without source or not.
And honestly, I think Fred has already formed his opinion.
Same issue... +1
moricode
Enthusiast
Enthusiast
Posts: 162
Joined: Thu May 25, 2023 3:55 am

Re: PureBasic Librarian

Post by moricode »

To be able to produce a static LIB from it's own programing language is a must for a language that call itself a "Powerful , Native, Fast, small binary" compiler language.

Purebasic , feel the pure power, native , and fast , small exe size, now with many limitation bother neck , thousands of missing feature.
mestnyi
Addict
Addict
Posts: 1098
Joined: Mon Nov 25, 2013 6:41 am

Re: PureBasic Librarian

Post by mestnyi »

moricode wrote: Sat Apr 20, 2024 3:37 am To be able to produce a static LIB from it's own programing language is a must for a language that call itself a "Powerful , Native, Fast, small binary" compiler language.

Purebasic , feel the pure power, native , and fast , small exe size, now with many limitation bother neck , thousands of missing feature.
+1
Post Reply