Page 2 of 2

Re: PureBasic Librarian

Posted: Wed Jan 10, 2024 8:30 pm
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.

Re: PureBasic Librarian

Posted: Wed Jan 10, 2024 8:35 pm
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.

Re: PureBasic Librarian

Posted: Wed Jan 10, 2024 8:38 pm
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.

Re: PureBasic Librarian

Posted: Wed Jan 10, 2024 9:05 pm
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?

Re: PureBasic Librarian

Posted: Wed Jan 10, 2024 9:11 pm
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.

Re: PureBasic Librarian

Posted: Tue Jan 23, 2024 9:08 am
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.

Re: PureBasic Librarian

Posted: Wed Apr 17, 2024 5:23 pm
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.

Re: PureBasic Librarian

Posted: Thu Apr 18, 2024 2:59 pm
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.

Re: PureBasic Librarian

Posted: Thu Apr 18, 2024 10:14 pm
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.

Re: PureBasic Librarian

Posted: Thu Apr 18, 2024 11:17 pm
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.

Re: PureBasic Librarian

Posted: Fri Apr 19, 2024 6:01 pm
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

Re: PureBasic Librarian

Posted: Sat Apr 20, 2024 3:37 am
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.

Re: PureBasic Librarian

Posted: Sat Apr 20, 2024 12:05 pm
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