less_retarded_wiki/fork.md
2024-09-25 13:26:28 +02:00

6.4 KiB

Fork

In technology forking generally means splitting, or better said duplicating an abstract entity (such as a computer process or development project) into two or more such entities so that each one can from then on develop differently; this is very similar to how biological cells duplicate by splitting. The term fork is used in many contexts, for example in software development (project forking), in operating systems (process forking), in cryptocurrencies (blockchain forking), nondeterministic computing (computation forking) etc. Though the term fork may be quite recent, the concept is not -- throughout all history we can observe for example various religions and churches splitting off of main branches -- this is forking as well.

Project Forking

In context of projects fork is a branch that splits from the main branch of a project and continues to develop in a different direction as a separate version of that project, possibly becoming a completely new one. This may happen with any "intellectual work" or idea such as software, movement, theory, literary universe, religion or, for example, a database. Forks may later be merged back into the original project or continue and diverge far away, forks of different projects may also combine into a single project as well.

For example the Android operating system and Linux-libre kernel have both been forked from Linux. Linux distributions highly utilize forking, e.g. Devuan or Ubuntu and Mint are forked from Debian. Free software movement was forked into open source, free culture and suckless, and suckless was more or less forked into LRS. Wikipedia also has forks such as Metapedia. Memes evolve a lot on the basis of forking.

Forking takes advantage of the ability to freely duplicate information, i.e. if someone sees how to improve an intellectual work or use it in a novel way, he may simply copy it and start developing it in a new diverging direction while the original continues to exist and going its own way. That is unless copying and modification of information is artificially prevented, e.g. by intellectual property laws or purposeful obscurity standing in the way of remixing. For this reason forking is very popular in free culture and free software where it is allowed both legally and practically -- in fact it plays a very important role there.

In software development temporary forking is used for implementing individual features which, when completed, are merged back into the main branch. This is called branching and is supported by version control systems such as git.

There are two main kinds of forks:

  • soft forks (also dynamic forks): Soft fork introduces changes that somehow stay compatible with the original project and can potentially even be merged back later, the fork exists as a different but synchronized version of the original project and as the original gets updates, the fork automatically gets these updates as well. Temporary git forks during development are soft forks, also for example Linux-libre is a soft fork of Linux as it adds a set of scripts that automatically remove proprietary blobs from the current version of Linux; patches of suckless software can also be seen as soft forks. It is typical that a soft fork somehow maintains just a set of changes against the original, e.g. in a form of a diff or script, i.e. soft fork is kind of a lightweight fork for which the original project stays a dependency.
  • hard forks: Hard fork splits from the original project in such a way that it can no longer be easily merged back, it diverges in a very different way and stops being synchronized with the original. For example darkplaces is a hard fork of the Quake 1 engine. Hard fork typically just copies all the data of the original project to a new repository and start modifying them freely. This has the disadvantage of having to repeat work on the original and the fork (e.g. if a new bug is discovered in the original after the split, it has to be manually fixed in both versions). This is one of the reasons why hard forks very often split off of projects that aren't actively developed anymore.

Is forking good? Yes, to create anything new it is basically necessary to build on top of someone else's work, stand on someone else's shoulders. Some people criticize too much forking; for example some cry about Linux distro fragmentation, they say there are too many of distros and that people should rather focus their energy on creating a single or at least fewer good operating systems, i.e. that forking is kind of "wasting effort". LRS supports any kind of wild forking and experimentation, we believe the exploration of many directions to be necessary in order to find the right one, in a good society waste of work won't be happening -- that's an issue of a competitive society, not forking.

In fact we think that (at least soft) forking should be incorporated on a much more basic level, in the way that the suckless community popularized. In suckless everyone's copy of software is a personal fork, i.e. software is distributed in source form and is so extremely easy to compile and modify that every user is supposed to do this as part of the installation process (even if he isn't a programmer). Before compilation user applies his own selected patches, custom changes and specific configuration (which is done in the source code itself) that are unique to that user and which form source code that is the user's personal fork. Some of these personal forks may even become popular and copied by other users, leading to further development of these forks and possible natural rise of very different software. This should lead to natural selection, survival and development of the good and useful forks.

Process Forking

See also fork bomb.

TODO