by open-source-ux · 8y ago · 0 comments
This is not to take anything away from this project, just making an observation. The programming field often feels like it's in a giant loop constantly re-discovering what went before.
Even GNU/Linux made such a big deal of moving from a.out to ELF binary format, due to easier support for dynamic linking, which quite cumbersome with a.out.
Now almost 30 years later it is a big deal to support static linking, go figure.
const varname = staticRead"filename" embeds a given resource at compile time - to make the project completely selfcontained if need be, and just for the hell of it.
I know you can do this in several other languages, but the Nim way is - unsurprisingly - the most ready-made, obvious and transparent one I've come across.
The most popular one is Starkit/Starpack which uses the Metakit database (which is a heirarchial database) and appends that archive to a loader (either a script, as a stub, or to an executable which includes the stub with the ability to open itself). This database can be modified externally using the starkit tools (sdx), and when you pack all your resources into it, it appears from within the interpreter that all the files are just normal files even though only the database is being accessed.
It might feel that way, but this is driven by economics. Basically disk, memory, and bandwidth is far cheaper than it used to be so who cares if you waste a GB or so copying the same libraries all over if you don't have to solve for dependency hell?
I wonder if that sounds arrogant to just me. As a user I DO CARE. Its frustrating to find applications shipping their own copy of libraries wasting precious disk space. When I was using a Mac, I had at least 4 applications shipping their own copy of Qt5.4 ... aaaarrgh
Back on the Linux desktop, package managers handle this beautifully. And for the cases where you need to skip the distro, Flatpak still lets you use system dependencies. Everyone wins.
And for whoever claims storage is cheap, please link me the magical place you're buying yours from. Thanks.
And storage is ridiculously cheap. You can get an 8TB HDD for $150[0]. Or a 1TB SSD for the same price[1].
[0]https://www.amazon.com/Seagate-Expansion-Desktop-External-ST...
[1]https://www.amazon.com/Blue-NAND-1TB-SSD-WDS100T2B0A/dp/B073...
In many package managers you can have multiple versions of the same application without a big deal -- in most cases you don't want to SUPPORT multiple versions of the same application, so there's always a trade-off.
Not in the cloud.
2) Application space on the server is vanishingly tiny compared to the data you're processing, so it is a far more generous trade-off.
Just an example: https://blog.acolyer.org/2017/04/03/a-study-of-security-vuln...
If there's a bug in Go's TLS implementation, you need to identify, recompile, and redistribute every Go application you use. Whereas if it were using the system's OpenSSL library everything would magically be fixed by a simple `apt-get upgrade` or `yum update`.
* those who want applications that take the least space on the drive, and share most of their data / libraries across themselves - shared electron runtime, steam runtime shared with the os * those who want applications to conform exactly to what the developper used since the developer can guarantee a "working" configuration
Ideally it should be up to the user to choose what configuration he wants, but the problem is that it's up to the developer to make that choice. Thus, the eternal loop :
applications released as a blob -> this takes too much disk space, we should use shared libraries ! -> applications released as shared libraries -> DLL hell -> applications released as a blob -> ...I think part of this comes from various tradeoffs becoming more or less important at different times. Processing power goes up so you move to fat clients, then people move to battery powered devices and heavy lifting makes more sense on servers again.
But nowadays it has terrible security (and to some extent reliability) trade-offs - if everything is a static binary and there's a security issue in a library, you need to upgrade every single binary depending on it, which is much less reliable and more prone to error/oversight.
As security and reliability have increased in importance, so the "cost" of the static binary route has actually gone up significantly in my view compared to 20-30 years ago. So it's a bit odd to me to see this model (and closely related ideas like flatpak etc) gaining currency. There must be better ways to manage the "DLL hell" issues than that.
Also, if you're talking about native, highly-distributed desktop/server applications, then the problem with using shared libraries is even worse. The only exception is system-level libraries that are updated automatically by the OS/distribution.
Finally, on Windows, with static binaries you can be sure that the binary is a particular version/build and is signed (this ensures that the binary version/build is valid). You don't get much better peace of mind than that. We've been distributing our installations and other binaries like that for over a decade, and it works great.
The concern has more relevance to client applications, but then the cost becomes related to update strategy, and if every app is tied to an update manager process(whether it's an app store type of thing or a custom one) then the thinking becomes similar to the cloud server setup: Why bother, I'm going to blow it all away in the next update.
When the dependency management is exposed to users, there's a much bigger surface area for troubleshooting and support. It makes sense that devs favor static if they expect the whole environment to be disposable. It isn't like it was in the 90's, where patching was occasional but major new versions were essentially new products.