Post AWMEY2tan6JQ1IQvrM by vertigo@hackers.town
(DIR) More posts by vertigo@hackers.town
(DIR) Post #AWM7mApFPB4szOBswK by xerz@fedi.xerz.one
2023-06-04T18:20:47.395422Z
0 likes, 0 repeats
Hottestest takest: things didn’t break down because of evil distros wanting to package whatever they want ‒ but because at some point we started using dynamic linking while installing arbitrary programs that could touch each other’s stuff, even after designing ways to figure out package conflicts…maybe worth focusing on that?
(DIR) Post #AWM8YGgqu6DN4tCHrM by xerz@fedi.xerz.one
2023-06-04T18:29:22.086640Z
0 likes, 0 repeats
To sound a bit more like an academic: instead of limiting the possible combinations of programs an user may be able choose (in formal terms: "nonsense"), we should minimize side effects by delimiting the state of each program. Not merely in packaging, but also in inputs and outputs.
(DIR) Post #AWM8ZwovkYTI23mCtE by xerz@fedi.xerz.one
2023-06-04T18:29:47.131555Z
0 likes, 0 repeats
To sound a bit more like an academic: instead of limiting the possible combinations of programs an user may be able to choose (in formal terms: "nonsense"), we should minimize side effects by delimiting the state of each program. Not merely in packaging, but also in inputs and outputs.
(DIR) Post #AWM8vi8P24bEr6GJ1s by xerz@fedi.xerz.one
2023-06-04T18:33:37.792904Z
0 likes, 0 repeats
It's a game that can probably never be fully won. But who cares, not everyone wants their stuff to always work at the cost of freedom to play around ‒ just make stuff work out of the box for most people.And if you don't want it to feel like an ugly hack like with Flatpak? Maybe just, make binaries static and create your own distro where programs are not trusted by default.
(DIR) Post #AWM8xCKeFD3knihNtA by xerz@fedi.xerz.one
2023-06-04T18:33:59.073526Z
0 likes, 0 repeats
It's a game that can probably never be fully won. But who cares, not everyone wants their stuff to always work at the cost of freedom to play around ‒ just make stuff work out of the box for most people.And if you don't want it to feel like an ugly hack like with Flatpak? Maybe just, use static binaries and create your own distro where programs are not trusted by default.
(DIR) Post #AWM9211rhChBC3D6ci by xerz@fedi.xerz.one
2023-06-04T18:34:51.237901Z
0 likes, 0 repeats
(AppImage if it was #based)
(DIR) Post #AWMAW5wG6fOn3tUjzc by freja@freja.zone
2023-06-04T18:50:05Z
1 likes, 0 repeats
@xerz Dynamic linking and its consequences
(DIR) Post #AWMAZ4FQqi46gdseQK by xerz@fedi.xerz.one
2023-06-04T18:52:02.041283Z
0 likes, 0 repeats
@freja Glibc was a mistake :sadcowboy:
(DIR) Post #AWMEY2tan6JQ1IQvrM by vertigo@hackers.town
2023-06-04T19:21:41Z
0 likes, 0 repeats
@xerz I keep saying to look to Amiga OS for inspiration here. It has shared libraries without the dynamic linking (via what we'd call v-tables these days). Yep, Amiga's shared libraries are literally statically linked.I don't think it'd solve all the issues you're talking about here; but, it did ameliorate some of the issues that come with dynamic linking as we know it today.
(DIR) Post #AWMEY3k3e2HOe0ypdY by xerz@fedi.xerz.one
2023-06-04T19:36:37.987197Z
0 likes, 0 repeats
@vertigo So basically, a static, deterministic pointer table? Well, wouldn't that have to be shared across distros in order to work?
(DIR) Post #AWNu8VmTAGvXJEZJIm by hazelweakly@hachyderm.io
2023-06-04T23:42:56Z
0 likes, 0 repeats
@xerz out of curiosity, have you ever heard of nix or nixos? (Because this is literally what nix does, how it models packaging, and the original motivation for its existence)[Apologies if you have and I'm missing something!]
(DIR) Post #AWNu8WP6qbprF4eAWu by xerz@fedi.xerz.one
2023-06-05T14:57:16.124736Z
0 likes, 0 repeats
@hazelweakly yes I have: https://codeberg.org/xerz/quectoin my opinion, Nix still does not address this on its own, as it is Yet Another Package Manager™®© with its own opinionated choices, yet it doesn't involve itself (by default) in issues like all programs sharing full access to an user's filesystem and all the side effects that implies
(DIR) Post #AWNuKStrhW8FqkjBCq by yojimbo@hackers.town
2023-06-04T23:03:58Z
0 likes, 0 repeats
@xerz @vertigo Only if you expect binaries to be portable between distros, which they already sort-of-aren't.
(DIR) Post #AWNuKThqhg7ALm767E by vertigo@hackers.town
2023-06-04T23:35:57Z
1 likes, 0 repeats
@yojimbo @xerz The jump table is set by the library developer, so by definition which distro is used is immaterial. That's kind of the point.I mean, the function numbers of the kernel system calls are well known, why not a v-table offset?
(DIR) Post #AWNuR8YviLNSni7J3I by xerz@fedi.xerz.one
2023-06-05T15:00:42.119726Z
0 likes, 0 repeats
@vertigo @yojimbo well, distros could patch packages and break compatibility still… but that might be easier to figure out than the status quo :blobcatthink:
(DIR) Post #AWNupMVfVfEN0Y8uUy by thebluewizard@hackers.town
2023-06-05T05:34:12Z
1 likes, 0 repeats
@vertigo @yojimbo @xerz I smell a possible article write up which would explain various approaches with Linux's shared library (.so format), Amiga's library format, Windows DLL, ... I can't think of any other example of dynamic linkage formats.The phrase statically-linked and dynamic linking are quite different: The static link means the linker makes a copy of code from a library and put it in an executable). The dynamic linking means the library (with its code) get loaded into the memory and the loader makes a "link from the executable into the loaded library. Exactly how it is achieved varies from platform to platform.The Wikipedia article on the static linking explains that: https://en.wikipedia.org/wiki/Static_libraryI know Amiga library format pretty well. As Vertigo said, it is just a v-table, and each entry (with one or two exceptions I know of) contains a JMP $xxxxxxxx instruction. Yes, There are two jumps per invocation.To take an example, a DOS Library might have a list:typedef void (*)() Libcall;struct DOSLibrary { // Standard llibrary routines that manage this library Libcall Open; Libcall Close; Libcall Read; // etc.} DOSLibrary = { // Lib routines addresses &DOS_Open, // actually JMP DOS_Open &DOS_Close, // actually JMP DOS_Close // etc,};int DOS_Open(blah, blah) {...}void DOS_Close(blah) {...}// etc.That's it.Of course an operating system must give an address of DOSLibrary in order for an application invoke the routines.Something like this:(struct DOSLibrary *) DOSLibrary = OpenLibrary("dos.library");// ...DOSLibrary ->Open(....);That is roughly how that works on Amiga. (I know I made some white lies regarding AmigaOS itself in order to explain more clearly how that works).It is even more clear when seen at assembly level.Maybe I should write an article and let Vertigo add some more, hmm?I am not very knowledgeable about .so and DLL (those are similar but different in some ways, that much I know. (I did read some articles about .so and DLL in the past).One thing I must point out: CORBA, COM and similar are different than what I talked about.I apologize to Vertigo for jumping into the discussion with lengthy explaining, and I hope others understand it better.An article is definitely called for in my opinion.Anyway, bedtime!
(DIR) Post #AWNupNCYwBXf9aDAMC by vertigo@hackers.town
2023-06-05T14:38:21Z
1 likes, 0 repeats
@thebluewizard @yojimbo @xerz I would be careful with referencing Wikipedia here, as the articles there tend to reinforce the current zeitgeist, which is prominently based on Windows and Unix experience. The closest analog to Amiga's libraries outside the platform is, in fact, COM components.