mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 04:58:21 +00:00
28 lines
12 KiB
HTML
28 lines
12 KiB
HTML
|
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>Functional package management</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
||
|
MathJax = {
|
||
|
tex: {
|
||
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
||
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
||
|
},
|
||
|
options = {
|
||
|
processHtmlClass = "math"
|
||
|
}
|
||
|
}
|
||
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>Functional package management</h1><section class="post-metadata"><span>Date: <!-- -->2020-09-19 08:31:48 +08:00</span><span>Date modified: <!-- -->2021-09-08 02:42:50 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"></ol></nav><p>Functional package management (FPM) is the next step forward <a href="https://edolstra.github.io/pubs/nixos-icfp2008-final.pdf">pioneered by Eelco Dolstra</a> with <a href="/wiki/tools.nix">Nix package manager</a> as the living implementation. <!-- -->[GNU Guix]] and <a href="https://silverblue.fedoraproject.org/">Fedora Silverblue</a>.]
|
||
|
</p><p>It was first realized from the thesis "<a href="id:f2e1e2f3-cc34-4c76-91d4-2706ce7756d2">The Purely Functional Software Deployment Model</a>".
|
||
|
</p><p>The conceptual overview of it is similar to <a href="/wiki/2020-09-04-19-57-06">Functional programming</a> with how it views with data and functions (in this case, packages and build processes).
|
||
|
It views that packages are a unique result from combining different things: dependencies, build processes, versions, and more.
|
||
|
If a dependency has updated its patch version or a build instruction has revised with one line of change, it will result in a "new" package as the output even if the package isn't any different.
|
||
|
</p><p>Coming from a functional approach, it also features statelessness and immutability, making it a reliable toolkit for <a href="https://reproducible-builds.org/">reproducible builds</a> (thus gaining a reach for <a href="/wiki/2020-04-12-11-20-53">Reproducible research</a>).
|
||
|
</p><p>The problems that FPM attempts to solve come from the critique of the traditional package management which is still dominant as of today (2020-08-31).
|
||
|
Here are some of the problems on a traditional Linux-based system:
|
||
|
</p><ul><li><p>The statefulness of the entire system leads to similar situations on Windows' dependency hell problem.
|
||
|
</p></li><li><p>As a consequence of the statefulness, traceability is almost non-existent.
|
||
|
</p></li><li><p>Multiple versions of packages are hard to place side-by-side which is used by developers targetting stable versions while experimenting with the latest versions.
|
||
|
</p></li><li><p>Destructive ongoing updates which consists of replacing the current version with the updated version while the update is going.
|
||
|
</p></li></ul><p>The functional approach with the unique output and immutable variables addresses the listed problems in some way.
|
||
|
</p><ul><li><p>A package is built from an input resulting in a package on a unique immutable location, eliminating the statefulness in the process.
|
||
|
</p></li><li><p>Since each revision results in a new location, the same package with different versions can be easily placed side-by-side.
|
||
|
</p></li><li><p>With the way how packages built, the old system can be kept giving the possibility for the user to rollback to those previous versions.
|
||
|
</p></li><li><p>The functional approach creates a guaranteed output, making it predictable (and traceable).
|
||
|
</p></li></ul><section><h2>Backlinks</h2><ul><li><a href="/wiki/2020-08-19-08-21-44">Guix package manager</a></li><li><a href="/wiki/tools.nix">Nix package manager</a></li></ul></section></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"\"2020-09-19 08:31:48 +08:00\"","date_modified":"\"2021-09-08 02:42:50 +08:00\"","language":"en","source":""},"title":"Functional package management","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Functional package management (FPM) is the next step forward "},{"type":"element","tagName":"a","properties":{"href":"https://edolstra.github.io/pubs/nixos-icfp2008-final.pdf"},"children":[{"type":"text","value":"pioneered by Eelco Dolstra"}]},{"type":"text","value":" with "},{"type":"element","tagName":"a","properties":{"href":"/tools.nix"},"children":[{"type":"text","value":"Nix package manager"}]},{"type":"text","value":" as the living implementation. "},{"type":"text","value":"[GNU Guix]] and "},{"type":"element","tagName":"a","properties":{"href":"https://silverblue.fedoraproject.org/"},"children":[{"type":"text","value":"Fedora Silverblue"}]},{"type":"text","value":".]\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"It was first realized from the thesis \""},{"type":"element","tagName":"a","properties":{"href":"id:f2e1e2f3-cc34-4c76-91d4-2706ce7756d2"},"children":[{"type":"text","value":"The Purely Functional Software Deployment Model"}]},{"type":"text","value":"\".\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The conceptual overview of it is similar to "},{"type":"element","tagName":"a","properties":{"href":"/2020-09-04-19-57-06"},"children":[{"type":"text","value":"Functional programming"}]},{"type":"text","value":" with how it views with data and functions (in this case, packages and build processes).\nIt views that packages are a unique result from combining different things: dependencies, build processes, versions, and more.\nIf a dependency has updated its patch version or a build instruction has revised with one line of change, it will result in a \"new\" package as the output even if the package isn't any different.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Coming from a functional approach, it also features statelessness and immutability, making it a reliable toolkit for "},{"type":"element","tagName":"a","properties":{"href":"https://reproducible-builds.org/"},"children":[{"type":"text","value":"reproducible builds"}]},{"type":"text","value":" (thus gaining a reach for "},{"type":"element","tagName":"a","properties":{"href":"/2020-04-12-11-20-53"},"children":[{"type":"text","value":"Reproducible research"}]},{"type":"text","value":").\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The problems that FPM attempts to solve come from the critique of the traditional package management which is still dominant as of today (2020-08-31).\nHere are some of the problems on a traditional Linux-based system:\n"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The statefulness of the entire system leads to similar situations on Windows' dependency hell problem.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"As a consequence of the statefulness, traceability is almost non-existent.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Multiple versions of pac
|