September 18

Re: PhobosV3+ Fundamental Elements
Gravatar of Sebastiaan KoppePosted by Sebastiaan Koppe
in reply to Richard (Rikki) Andrew Cattermole
PermalinkReply
Gravatar of Sebastiaan Koppe
On Friday, 18 September 2026 at 16:46:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
> The libraries built on top of the base phobosv3 library, need to be shared libraries they are doing things like event loop that should not be available by default and are not going to work right if they were a static library.
>
> I don't want people who don't know what they are doing thinking that they should use a static library for easier shipping and then find themselves with core features not working.

What is the issue with static libs?

September 19

Re: PhobosV3+ Fundamental Elements
Gravatar of Richard (Rikki) Andrew CattermolePosted by Richard (Rikki) Andrew Cattermole
in reply to Sebastiaan Koppe
PermalinkReply

Richard (Rikki) Andrew Cattermole

Gravatar of Richard (Rikki) Andrew Cattermole

Posted in reply to Sebastiaan Koppe

On 19/09/2026 6:27 AM, Sebastiaan Koppe wrote:
> On Friday, 18 September 2026 at 16:46:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> The libraries built on top of the base phobosv3 library, need to be shared libraries they are doing things like event loop that should not be available by default and are not going to work right if they were a static library.
>>
>> I don't want people who don't know what they are doing thinking that they should use a static library for easier shipping and then find themselves with core features not working.
> 
> What is the issue with static libs?

The primary issue is you lose ability to load shared libraries that depend upon it.

Which is an important feature of web servers, GUI toolkits and game engines.

If you know and understand these limitations, building it yourself with dub shouldn't be an issue.

Also we'll likely end up shipping libraries that would conflict if it were a static library. I have a couple of Luna's in mind as part of a GUI toolkit.

September 18

Re: PhobosV3+ Fundamental Elements
Gravatar of libxmocPosted by libxmoc
in reply to Richard (Rikki) Andrew Cattermole
PermalinkReply

libxmoc

Gravatar of libxmoc

Posted in reply to Richard (Rikki) Andrew Cattermole

On Friday, 18 September 2026 at 18:33:41 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 19/09/2026 6:27 AM, Sebastiaan Koppe wrote:
>> On Friday, 18 September 2026 at 16:46:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
>>> The libraries built on top of the base phobosv3 library, need to be shared libraries they are doing things like event loop that should not be available by default and are not going to work right if they were a static library.
>>>
>>> I don't want people who don't know what they are doing thinking that they should use a static library for easier shipping and then find themselves with core features not working.
>> 
>> What is the issue with static libs?
>
> The primary issue is you lose ability to load shared libraries that depend upon it.
>
> Which is an important feature of web servers, GUI toolkits and game engines.
>
> If you know and understand these limitations, building it yourself with dub shouldn't be an issue.
>
> Also we'll likely end up shipping libraries that would conflict if it were a static library. I have a couple of Luna's in mind as part of a GUI toolkit.

Just ship source code, I see 0 valid reasons to go with shared libraries.

Let's not repeat dotnet's mistake of shipping programs with bazillions of dll's.

They learned it the hard way when Go started to eat their lunch. They now brag about single static AOT executables in their marketing ;).

September 18

Re: PhobosV3+ Fundamental Elements
Gravatar of monkyyyPosted by monkyyy
in reply to libxmoc
PermalinkReply

monkyyy

Gravatar of monkyyy

Posted in reply to libxmoc

On Friday, 18 September 2026 at 19:09:38 UTC, libxmoc wrote:
> On Friday, 18 September 2026 at 18:33:41 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 19/09/2026 6:27 AM, Sebastiaan Koppe wrote:
>>> On Friday, 18 September 2026 at 16:46:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
>>>> [...]
>>> 
>>> What is the issue with static libs?
>>
>> The primary issue is you lose ability to load shared libraries that depend upon it.
>>
>> Which is an important feature of web servers, GUI toolkits and game engines.
>>
>> If you know and understand these limitations, building it yourself with dub shouldn't be an issue.
>>
>> Also we'll likely end up shipping libraries that would conflict if it were a static library. I have a couple of Luna's in mind as part of a GUI toolkit.
>
> Just ship source code, I see 0 valid reasons to go with shared libraries.
>
> Let's not repeat dotnet's mistake of shipping programs with bazillions of dll's.
>
> They learned it the hard way when Go started to eat their lunch. They now brag about single static AOT executables in their marketing ;).

ssl and malloc should probably still be shared
Im a little annoyed that raylib is shared but like opengl should be shared and unfortunately the gpu drivers in there infinite wisdom forces even worse trade offs on us

September 19

Re: PhobosV3+ Fundamental Elements
Gravatar of Gregor MücklPosted by Gregor Mückl
in reply to Richard (Rikki) Andrew Cattermole
PermalinkReply

Gregor Mückl

Gravatar of Gregor Mückl
On Friday, 18 September 2026 at 16:46:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 18/09/2026 7:16 PM, Gregor Mückl wrote:
>> Please include an option to have all these libraries statically linked as well. Sometimes, it just happens that one really, really needs a completely self-contained binary.
>
> If you hit a wall like that you can always build it yourself.
>

What should I build myself? I think your statement is a bit ambiguous. Do you mean recompiling Phobos or building an entire competing standard library? I'm assuming the former.

> The libraries built on top of the base phobosv3 library, need to be shared libraries they are doing things like event loop that should not be available by default and are not going to work right if they were a static library.
>

I don't understand the event loop part at all. This seems to come out of the blue. Can you give me a little more context on that?

> I don't want people who don't know what they are doing thinking that they should use a static library for easier shipping and then find themselves with core features not working.
>

Well, a binary that needs to sit next to a bunch of libraries isn't such a great deal, either.

I'm not against shared libraries as a default, but there must be a way to use at least the most common part of Phobos statically linked into a binary. There are quite a few use cases out there where people are expected to copy e.g. single Windows DLLs around to make things work (VST instruments, for example - so dplug would be impacted).

Also, another scenario that I believe is full of nasty surprises is when two shared libraries get loaded dynamcially by a process at runtime that are built with different version of Phobos. Even if the file names don't collide, the symbol names will because they have to be exported. If Phobos was linked statically into each shared library with hidden symbol visiblity, those issues would go away.

September 19

Re: PhobosV3+ Fundamental Elements
Gravatar of Gregor MücklPosted by Gregor Mückl
in reply to Richard (Rikki) Andrew Cattermole
PermalinkReply

Gregor Mückl

Gravatar of Gregor Mückl

Posted in reply to Richard (Rikki) Andrew Cattermole

On Friday, 18 September 2026 at 18:33:41 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 19/09/2026 6:27 AM, Sebastiaan Koppe wrote:
>> What is the issue with static libs?
>
> The primary issue is you lose ability to load shared libraries that depend upon it.
>
> Which is an important feature of web servers, GUI toolkits and game engines.
>

I'm not arguing against supporting shared linkage or having it as a default. I'm only advocating for proper support for static linking as an alternative.

> If you know and understand these limitations, building it yourself with dub shouldn't be an issue.
>

Is this going to be a solid guarantee for Phobos 3?

> Also we'll likely end up shipping libraries that would conflict if it were a static library. I have a couple of Luna's in mind as part of a GUI toolkit.

What is a "Luna"?

September 20

Re: PhobosV3+ Fundamental Elements
Gravatar of Richard (Rikki) Andrew CattermolePosted by Richard (Rikki) Andrew Cattermole
in reply to Gregor Mückl
PermalinkReply

Richard (Rikki) Andrew Cattermole

Gravatar of Richard (Rikki) Andrew Cattermole

Posted in reply to Gregor Mückl

On 20/09/2026 6:13 AM, Gregor Mückl wrote:
> On Friday, 18 September 2026 at 18:33:41 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 19/09/2026 6:27 AM, Sebastiaan Koppe wrote:
>>> What is the issue with static libs?
>>
>> The primary issue is you lose ability to load shared libraries that depend upon it.
>>
>> Which is an important feature of web servers, GUI toolkits and game engines.
>>
> 
> I'm not arguing against supporting shared linkage or having it as a default. I'm only advocating for proper support for static linking as an alternative.

I'm not arguing for the default. Nor am I arguing for druntime and base phobosv3 being shared alone.

>> If you know and understand these limitations, building it yourself with dub shouldn't be an issue.
>>
> 
> Is this going to be a solid guarantee for Phobos 3?

It is the current build procedures, and is intended to continue as far as I know.

>> Also we'll likely end up shipping libraries that would conflict if it were a static library. I have a couple of Luna's in mind as part of a GUI toolkit.
> 
> What is a "Luna"?

https://github.com/LunaTheFoxgirl

September 20

Re: PhobosV3+ Fundamental Elements
Gravatar of Richard (Rikki) Andrew CattermolePosted by Richard (Rikki) Andrew Cattermole
in reply to Gregor Mückl
PermalinkReply

Richard (Rikki) Andrew Cattermole

Gravatar of Richard (Rikki) Andrew Cattermole

Posted in reply to Gregor Mückl

On 20/09/2026 6:04 AM, Gregor Mückl wrote:
> On Friday, 18 September 2026 at 16:46:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 18/09/2026 7:16 PM, Gregor Mückl wrote:
>>> Please include an option to have all these libraries statically linked as well. Sometimes, it just happens that one really, really needs a completely self-contained binary.
>>
>> If you hit a wall like that you can always build it yourself.
>>
> 
> What should I build myself? I think your statement is a bit ambiguous. Do you mean recompiling Phobos or building an entire competing standard library? I'm assuming the former.

The libraries that we ship that are built on top of the base PhobosV3 library.

PhobosV3 base library is akin to V2, we have no auxillary libraries built on top equivalent in V2.

>> The libraries built on top of the base phobosv3 library, need to be shared libraries they are doing things like event loop that should not be available by default and are not going to work right if they were a static library.
>>
> 
> I don't understand the event loop part at all. This seems to come out of the blue. Can you give me a little more context on that?

Proper event loops are very expensive to just link in and have on.

Background threads on mass, and lots of extra dependencies.

Not a good default.

But its necessary if you want to do windowing and networking properly.

>> I don't want people who don't know what they are doing thinking that they should use a static library for easier shipping and then find themselves with core features not working.
>>
> 
> Well, a binary that needs to sit next to a bunch of libraries isn't such a great deal, either.
> 
> I'm not against shared libraries as a default, but there must be a way to use at least the most common part of Phobos statically linked into a binary. There are quite a few use cases out there where people are expected to copy e.g. single Windows DLLs around to make things work (VST instruments, for example - so dplug would be impacted).

Yes, none of that is affected.

> Also, another scenario that I believe is full of nasty surprises is when two shared libraries get loaded dynamcially by a process at runtime that are built with different version of Phobos. Even if the file names don't collide, the symbol names will because they have to be exported. If Phobos was linked statically into each shared library with hidden symbol visiblity, those issues would go away.

Unless you are doing something more advanced build setup wise, you would also be using different compilers and druntimes too. That is not meant to work.

September 19

Re: PhobosV3+ Fundamental Elements
Gravatar of Gregor MücklPosted by Gregor Mückl
in reply to Richard (Rikki) Andrew Cattermole
PermalinkReply

Gregor Mückl

Gravatar of Gregor Mückl

Posted in reply to Richard (Rikki) Andrew Cattermole

On Saturday, 19 September 2026 at 18:19:30 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 20/09/2026 6:13 AM, Gregor Mückl wrote:
>> I'm not arguing against supporting shared linkage or having it as a default. I'm only advocating for proper support for static linking as an alternative.
>
> I'm not arguing for the default. Nor am I arguing for druntime and base phobosv3 being shared alone.
>

OK, this clears up a lot. The passage I quoted from your original post sounded as if shared would be the only supported option going forward. Having shared libraries as an option in addition to static linkage is an improvement that I welcome.

>>> Also we'll likely end up shipping libraries that would conflict if it were a static library. I have a couple of Luna's in mind as part of a GUI toolkit.
>> 
>> What is a "Luna"?
>
> https://github.com/LunaTheFoxgirl

Oh, sorry. I misread your original sentence consistently for like 5 times. :(

September 19

Re: PhobosV3+ Fundamental Elements
Gravatar of Gregor MücklPosted by Gregor Mückl
in reply to Richard (Rikki) Andrew Cattermole
PermalinkReply

Gregor Mückl

Gravatar of Gregor Mückl

Posted in reply to Richard (Rikki) Andrew Cattermole

On Saturday, 19 September 2026 at 18:27:24 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 20/09/2026 6:04 AM, Gregor Mückl wrote:
>> Also, another scenario that I believe is full of nasty surprises is when two shared libraries get loaded dynamcially by a process at runtime that are built with different version of Phobos. Even if the file names don't collide, the symbol names will because they have to be exported. If Phobos was linked statically into each shared library with hidden symbol visiblity, those issues would go away.
>
> Unless you are doing something more advanced build setup wise, you would also be using different compilers and druntimes too. That is not meant to work.

The presence of a different version of a library in the same process can be something that is completely out of the control of the affected developer. I can give you a few examples of how this kind of stuff can get really uncontrollable:

- Vulkan specifies a dynamic loading scheme for layers that intercept API calls between the application and the driver. The landscape for these kinds of layers has evolved into a not quite lawless wild west. Drivers and a lot of applications that you would otherwise not expect ship layers that get loaded into *your* program's address space when you create a Vulkan instance. There's nothing you can do about that - the loader doesn't have an off switch for this behavior by design. Steam and OBS are examples for programs that ship such Vulkan layers.

- Your product is a plugin for some big application like Word or Revit or Unity... you have no control over what those programs are going to load alongside your own plugin.

These are definitely situations where the modules that get loaded need to be as self-contained and isolated as possible to try and avoid funky issues.