master
Miloslav Ciz 1 year ago
parent 288e7fbda7
commit 86d610951d

@ -1,6 +1,6 @@
# Assembly
Assembly (also ASM) is, for any given hardware computing platform ([ISA](isa.md), basically a [CPU](cpu.md) architecture), the lowest level [programming language](programming_language.md) that expresses typically a linear, unstructured sequence of CPU instructions -- it maps (mostly) 1:1 to [machine code](machine_code.md) (the actual [binary](binary.md) CPU instructions) and basically only differs from the actual machine code by utilizing a more human readable form (it gives human friendly nicknames, or mnemonics, to different combinations of 1s and 0s). Assembly is converted by [assembler](assembler.md) into the the machine code. Assembly is similar to [bytecode](bytecode.md), but bytecode is meant to be [interpreted](interpreter.md) or used as an intermediate representation in [compilers](compiler.md) while assembly represents actual native code run by hardware. In ancient times when there were no higher level languages (like [C](c.md) or [Fortran](fortran.md)) assembly was used to write computer programs -- nowadays most programmers no longer write in assembly (majority of zoomer "[coders](coding.md)" probably never even touch anything close to it) because it's hard (takes a long time) and not [portable](portability.md), however programs written in assemCbly are known to be extremely fast as the programmer has absolute control over every single instruction.
Assembly (also ASM) is, for any given hardware computing platform ([ISA](isa.md), basically a [CPU](cpu.md) architecture), the lowest level [programming language](programming_language.md) that expresses typically a linear, unstructured sequence of CPU instructions -- it maps (mostly) 1:1 to [machine code](machine_code.md) (the actual [binary](binary.md) CPU instructions) and basically only differs from the actual machine code by utilizing a more human readable form (it gives human friendly nicknames, or mnemonics, to different combinations of 1s and 0s). Assembly is converted by [assembler](assembler.md) into the the machine code. Assembly is similar to [bytecode](bytecode.md), but bytecode is meant to be [interpreted](interpreter.md) or used as an intermediate representation in [compilers](compiler.md) while assembly represents actual native code run by hardware. In ancient times when there were no higher level languages (like [C](c.md) or [Fortran](fortran.md)) assembly was used to write computer programs -- nowadays most programmers no longer write in assembly (majority of zoomer "[coders](coding.md)" probably never even touch anything close to it) because it's hard (takes a long time) and not [portable](portability.md), however programs written in assembly are known to be extremely fast as the programmer has absolute control over every single instruction (of course that is not to say you can't fuck up and write a slow program in assembly).
**Assembly is NOT a single language**, it differs for every architecture, i.e. every model of CPU has potentially different architecture, understands a different machine code and hence has a different assembly (though there are some standardized families of assembly like x86 that work on wide range of CPUs); therefore **assembly is not [portable](portability.md)** (i.e. the program won't generally work on a different type of CPU or under a different [OS](os.md))! And even the same kind of assembly language may have several different [syntax](syntax.md) formats which may differ in comment style, order of writing arguments and even instruction abbreviations (e.g. x86 can be written in [Intel](intel.md) and [AT&T](at_and_t.md) syntax). For the reason of non-portability (and also for the fact that "assembly is hard") you shouldn't write your programs directly in assembly but rather in a bit higher level language such as [C](c.md) (which can be compiled to any CPU's assembly). However you should know at least the very basics of programming in assembly as a good programmer will come in contact with it sometimes, for example during hardcore [optimization](optimization.md) (many languages offer an option to embed inline assembly in specific places), debugging, reverse engineering, when writing a C compiler for a completely new platform or even when designing one's own new platform. **You should write at least one program in assembly** -- it gives you a great insight into how a computer actually works and you'll get a better idea of how your high level programs translate to machine code (which may help you write better [optimized](optimization.md) code) and WHY your high level language looks the way it does.

@ -1,6 +1,6 @@
# Brain Software
Brain [software](software.md) is kind of a [fun](fun.md) idea of software that runs on the human brain as opposed to a [computer](computer.md). This removes the [dependency](dependency.md) on computers and highly increases freedom. Of course, this also comes with a huge drop of computational power :) However, aside from being a fun idea to explore, this kind of software and "architectures" may become interesting from the perspective of [freedom](free_software.md) and [primitivism](primitivism.md) (especially when the technological [collapse](collapse.md) seems like a real danger).
Brain [software](software.md), also brainware, is kind of a [fun](fun.md) idea of software that runs on the human brain as opposed to a [computer](computer.md). This removes the [dependency](dependency.md) on computers and highly increases freedom. Of course, this also comes with a huge drop of computational power :) However, aside from being a fun idea to explore, this kind of software and "architectures" may become interesting from the perspective of [freedom](free_software.md) and [primitivism](primitivism.md) (especially when the technological [collapse](collapse.md) seems like a real danger).
Primitive tools helping the brain compute, such as pen and paper or printed out mathematical tables, may be allowed.

@ -86,7 +86,7 @@ Capitalist brainwashing is pretty sophisticated -- unlike with centralized oppre
- *"Capitalism is freedom."* -- This is of course a complete twist of the word freedom: capitalism promotes freedom of market which goes against the freedom of people. I.e. the freedom enabled by capitalism is the freedom to abuse others; the freedom to restrict freedoms of others, which is of almost the polar opposite of genuine freedom.
- *"In capitalism everyone can make it if he only works hard."* -- This is firstly of course not even logically possible, it's just as claiming that everyone can win the Olympic games; to reach the top in an extremely competitive system not only do you have to work hard, you also have to be born with the right talent, in the right place, to the right family, and be immensely lucky to be in right places in right times and make correct guess decisions in situations in which it is impossible to know the correct decision. Even if you work 24/7 without sleep, there will be thousands of others who do the same, your success is a pure bet on lottery. **Capitalist fairy tales make heavy use of the [survivorship bias](survivorship_bias.md)** -- you will see movies only about the successful people who are asked how they achieved success and who answer along the lines "I just worked hard". Indeed they did, but this doesn't imply that anyone working hard will succeed, this is the same as taking an advice from a lottery winner; if you ask a lottery winner how he won the lottery, he will simply say "I bet all I had on a random number". Following such advice is of course just about the worse decision you can make. If everyone can make it, why doesn't everyone do it, why don't we have a wold consisting exclusively of billionaires?
- *"Capitalism just works, capitalism is natural, capitalism means progress etc."* -- **Capitalism doesn't work, it's just hard to get rid of.** If it "works and is natural", then it works and is natural natural in the same way as for example cancer or wars. This doesn't mean we should support it or see it as something positive. Most of other similar lies are discussed in sections above.
- Fairy tales about about the rich capitalist altruist: you will hear stories about famous capitalists that paint them as nice guys who give to poor for free, who do manual work despite not having to etc. This is just part of cult of personality propaganda and applying cheap populist tricks to deceive masses. A rich guy giving $100 to a poor kid on camera is an extreme powerful marketing that costs $100, which for a billionaire is of course a laughable cost. The fact is that every billionaire is the best player of the most dirty game humanity has invented and researching any such guy reveals, basically in 100% of cases, that he was in fact the worst imaginable psychopath -- Edison killed animals with electric current as part of marketing, the owner of McDonald's stole the idea and know-how from McDonald brothers ALONG WITH their own name, similar thing happened with KFC, Steve Jobs was infamous for his psychological pressure on workers equating torture, the working condition's in Ford's factories were basically the same as those for black African slaves, etcetc.
- Fairy tales about about the rich capitalist altruist: you will hear stories about famous capitalists that paint them as nice guys who give to poor for free, who do manual work despite not having to etc. This is just part of cult of personality propaganda and applying cheap populist tricks to deceive masses. A rich guy giving $100 to a poor kid on camera is an extreme powerful marketing that costs $100, which for a billionaire is of course a laughable cost. The fact is that every billionaire is the best player of the most dirty game humanity has invented and researching any such guy reveals, basically in 100% of cases, that he was in fact the worst imaginable psychopath -- Edison killed animals with electric current as part of marketing, the owner of McDonald's stole the idea and know-how from McDonald brothers ALONG WITH their own name, similar thing happened with KFC, Steve Jobs was infamous for his psychological pressure on workers equating torture, the working condition's in Ford's factories were basically the same as those for black African slaves, etcetc. **Trying to find a rich man that's good is like trying to find a shark who's a vegetarian.**
- *"Capitalism isn't perfect but it's the best system we know."*: complete [bullshit](bullshit.md), capitalism is probably the worst system that there ever was. See this whole article.
- *"Successful capitalists are the most intelligent people."*: on the contrary, mostly the stupidest people become successful -- success in capitalism depends mostly on luck and lack of moral obstacles, i.e. doing whatever it takes to succeed such as stabbing friends in the back, public lying, exploitation of workers etc. High intelligence is actually a disadvantage in this manner as it makes one see all the negative consequences of his behavior, a smart man sees that by engaging in capitalism he is not just hurting and even killing other people, but even e.g. working towards destruction of art, culture, living environment and possibly life itself. Being a successful businessman in capitalism is like steering a plane full of people, including oneself, towards ground -- only an idiot can do it.
- TODO: moar

@ -2,6 +2,8 @@
Capitalist software is [software](software.md) that late stage [capitalism](capitalism.md) produces and is practically 100% [shitty](shit.md) [modern](modern.md) [bloat](bloat.md) and [malware](malware.md) hostile to its users, made with the sole goal of benefiting its creator (often a [corporation](corporation.md)). Capitalist software is not just [proprietary](proprietary.md) corporate software, but a lot of times "[open source](open_source.md)", [indie](indie.md) software and even [free software](free_software.md) that's just infected by the toxic capitalist environment -- this infection may come deep even into the basic design principles, even such things as [UI](ui.md) design, priorities and development practices and subtle software behavior which have simply all been shaped by the capitalist pressure on abusing the user.
{ Seriously I don't have enough brain to understand how anyone can accept this shit. ~drummyfish }
Capitalist software largely mimics in technology what capitalist economy is doing in society -- for example it employs huge waste of resources (computing resources such as RAM and CPU cycles as an equivalent to natural resources) in favor of rapid growth (accumulation of "[features](feature.md)"), it creates hugely complex, interdependent and fragile ever growing networks (tons of library of hardware [dependencies](dependency.md) as an equivalent of import/export dependencies of countries) and employs consumerism (e.g. in form of mandatory frequent [updates](update_culture.md)). These effects of course bring all the negative implications along and lead to highly inefficient, fragile, bloated, unethical software.
Basically everyone will agree that corporate software such as [Windows](windows.md) is to a high degree abusive to its users, be it by its spying, unjustified hardware demands, forced non customizability, price etc. A mistake a lot of people make is to think that sticking a free [license](license.md) to similar software will simply make it magically friendly to the user and that therefore most [FOSS](foss.md) programs are ethical and respect its users. This is sadly not the case, a license if only the first necessary step towards [freedom](freedom.md), but not a sufficient one -- other important steps have to follow.

@ -8,18 +8,18 @@ Some see math not as a science but rather a discipline that develops formal tool
On the other hand, one does not have to be a math [PhD](phd.md) in order to be a good programmer in most fields. Sure, knowledge and overview of advanced mathematics is needed to excel, to be able to spot and sense elegant solutions, but beyond these essentials that anyone can learn with a bit of will it's really more about just not being afraid of math, accepting and embracing the fact that it permeates what we do and studying it when the study of a new topic is needed.
**The power of math is limited.** In 1932 [Kurt Godel](godel.md) mathematically proved, with his [incompleteness theorems](incompleteness.md), that (basically) there are completely logical truths which however math itself can never prove, and that math itself cannot prove its own consistency (which killed so called Hilbert's program which seeked to do exactly that). This is related to the limited power of [computers](computer.md) due to [undecidability](undecidability.md) (there are problems a computer can never decide).
**The power of math is limited.** In 1932 [Kurt Godel](godel.md) mathematically proved, with his [incompleteness theorems](incompleteness.md), that (basically) there are truths which math itself can never prove, and that math itself cannot prove its own consistency (which killed so called Hilbert's program which sought to do exactly that). This is related to the limited power of [computers](computer.md) due to [undecidability](undecidability.md) (there are problems a computer can never decide), proven by [Alan Turing](turing.md).
## Overview
Following are some areas and topics which a programmer should be familiar with:
Following are some math areas and topics which a programmer should be familiar with:
- **basics** (high-school level math): arithmetic, algebra, expressions, [functions](function.md), [equations](equation.md), geometry, [trigonometry](trigonometry.md)/goniometry, systems of linear equations, quadratic equations, [complex numbers](complex_number.md), [logarithms](lofarithm.md), analythical geometry (many problems are equivalent to relationships of shapes in N dimensional spaces), [polynomials](polynomial.md) (used in many areas, e.g. error correction codes in networking), ...
- **basics** (high-school level math): arithmetic, algebra, expressions, [functions](function.md), [equations](equation.md), geometry, [trigonometry](trigonometry.md)/goniometry, systems of linear equations, quadratic equations, [complex numbers](complex_number.md), [logarithms](lofarithm.md), [analytic geometry](analytic_geometry.md) (many problems are equivalent to relationships of shapes in N dimensional spaces), [polynomials](polynomial.md) (used in many areas, e.g. error correction codes in networking), ...
- **advanced notation**: ability to understand the notation that's often used in papers etc. (the big sigma for sum, calculus notation etc.)
- **formal [logic](logic.md)**: computers are based on [Boolean](boolean.md) logic, knowing basic formulas and theorems here is crucial (e.g. the completeness of [NAND](nand.md)), formal logic is also just generally used in formal texts, one should know about predicate vs propositional logic etc.
- **formal [logic](logic.md)**: computers are based on [Boolean](boolean.md) logic, knowing basic formulas and theorems here is crucial (e.g. the completeness of [NAND](nand.md) or [De Morgan's laws](de_morgan.md)), formal logic is also just generally used in formal texts, one should know about predicate vs propositional logic etc.
- **[proofs](proof.md)**: core of high level mathematics, one should know the basic proof techniques (direct, [contradiction](contradiction.md), [induction](induction.md), ...).
- **[linear algebra](linear_algebra.md)**: aka "vectors and matrices", essential in almost every field ([graphics](graphics.md), [machine learning](machine_learning.md), ...).
- **[calculus](calculus.md) and differential equations**: just essential for advanced math and many fields (graphics, machine learning, electricity, physics, any optimization, ...).
- **[calculus](calculus.md) and differential equations**: just essential for advanced math and many fields (graphics, machine learning, [electronics](electronics.md), physics, any optimization, ...).
- **theoretical [computer science](compsci.md)**: [computational complexity](computational_complexity.md) (very important), [computability](computability.md), [formal languages](formal_language.md), computational models ([automata](automaton.md), [Turing machines](turing_machine.md), ...), ...
- **[graph theory](graph.md)**: generally useful tools, especially important e.g. in networks or indexing structures in [databases](database.md).
- **[number](number.md) and [set](set.md) theory**: sets of numbers ([natural](natural_number.md), [rational](rational_number.md), [real](real_number.md), [complex](complex_number.md), ...), [prime numbers](prime.md) (important e.g. for [cryptography](cryptography.md), [quantum computing](quantum.md), ...), ...

@ -1,18 +1,18 @@
# Procedural Generation
Procedural generation (procgen) refers to creation of data, such as art in [games](game.md) or test data for software, by using [algorithms](algorithm.md) and mathematical formulas rather than creating this data manually or measuring it in the real world. This can be used for example for automatic generation of [textures](texture.md), texts, music, game levels or 3D models but also to practically anything else, e.g. test [databases](database.md) or even computer programs. Procedural art still cannot reach qualities and creativity of a skilled human artist, but it can be a good filler, substitute, an addition to or a basis for manually created art. Procedural generation has many advantages such as saving space (instead of large data we only store small code of the algorithm that generates it), saving time (once we have an algorithm we can generate a lot data extremely quickly), increasing resolution practically to infinity or extending data to more dimensions (e.g. [3D textures](3d_texture.md)). Procedural generation can also be used as a helper and guidance, e.g. an artist may use a procedurally generated game level as a starting point and fine tune it manually, or vice versa, procedural algorithm may create a level from manually created building blocks.
Procedural generation (procgen) refers to creation of data, such as [art](art.md) assets in [games](game.md) or test data for data processing software, by using [algorithms](algorithm.md) and mathematical formulas rather than creating the data manually or measuring it in the real world (e.g. by taking photographs). This can be used for example for automatic generation of [textures](texture.md), texts, [music](music.md), game levels or 3D models but also practically anything else, e.g. test [databases](database.md), animations or even computer programs. Procedural art currently doesn't reach qualities and creativity of a skilled human artist, but it can be [good enough](good_enough.md) or even necessary (e.g. for creating extremely large worlds), it may be preferred e.g. for its extreme save of storage memory, it can help add detail to human work, be a good filler, a substitute, an addition to or a basis for manually created art. Procedural generation has many advantages such as saving space (instead of large data we only store small code of the algorithm that generates it), saving time (once we have an algorithm we can generate a lot data extremely quickly), increasing resolution practically to infinity or extending data to more dimensions (e.g. [3D textures](3d_texture.md)). Procedural generation can also be used as a helper and guidance, e.g. an artist may use a procedurally generated game level as a starting point and fine tune it manually, or vice versa, procedural algorithm may create a level by algorithmically assembling manually created building blocks.
As neural [AI](ai.md) approaches human level of creativity, we may see it actually replacing many artists in near future, however it is debatable whether AI generated content should be called procedural generation as AI models are quite different from the traditional hand-made algorithms. From now on we'll only be considering the traditional approach.
As neural [AI](ai.md) approaches human level of creativity, we may see computers actually replacing many artists in near future, however it is debatable whether AI generated content should be called procedural generation as AI models are quite different from the traditional hand-made algorithms -- AI art is still seen as a separate approach than procedural generation. For this we'll only be considering the traditional approach from now on.
[Minecraft](minecraft.md) (or [Minetest](minetest.md)) is a popular example of a game in which the world is generated procedurally, which allows it to have near-infinite worlds. [Roguelikes](roguelike.md) also heavily utilize procgen. However this is nothing new, an old game Daggerfall was known for its extremely vast procedurally generated world.
[Minecraft](minecraft.md) (or [Minetest](minetest.md)) is a popular example of a game in which the world is generated procedurally, which allows it to have near-infinite worlds -- size of such a world is in practice limited only by ranges of [data types](data_type.md) rather than available storage memory. [Roguelikes](roguelike.md) also heavily utilize procgen. However this is nothing new, an old game Daggerfall was known for its extremely vast procedurally generated world. Some amount of procedural generation can be seen probably in most mainstream games, e.g. clouds, vegetation or NPCs are often made procedurally.
For its extreme save of space procedural generation is extremely popular in [demoscene](demo.md) where programmers try to create as small programs as possible. German programmers made a full fledged 3D shooter called [.kkrieger](kkrieger.md) that fits into just 96 kB! It was thanks to heavy use of procedural generation for the whole game content. [Bytebeat](bytebeat.md) is a simple method of generating procedural "8bit" music, it is used e.g. in [Anarch](anarch.md). Procedural generation is generally popular in indie game dev thanks to offering a way of generating huge amounts of content quickly, without having to pay artists.
For its extreme save of space procedural generation is extremely popular in [demoscene](demo.md) where programmers try to create as small programs as possible. German programmers made a full fledged 3D shooter called [.kkrieger](kkrieger.md) that fits into just 96 kB! It was thanks to heavy use of procedural generation for the whole game content. [Bytebeat](bytebeat.md) is a simple method of generating procedural "8bit" music, it is used e.g. in [Anarch](anarch.md). Procedural generation is generally popular in indie game dev thanks to offering a way of generating huge amounts of content quickly and without having to pay artists.
We may see procgen as being similar to [compression](compression.md) algorithms: we have large data and are looking for an algorithm that's much smaller while being able to reproduce the data (but here we normally go the other way around, we start with the algorithm and see what data it produces rather than searching for an algorithm that produces given data). [John Carmack](john_carmack.md) himself called procgen "basically a shitty compression".
Using [fractals](fractal.md) is a popular technique in procgen because they basically perfectly fit the definition of it: a fractal is defined by a simple equation or a set of a few rules that yield an infinitely complex shape. Nature is also full of fractals such as clouds, mountain or trees, so fractals look organic.
A good example to think of is generating procedural [textures](texture.md). This is generally done by first generating a basis image or multiple images, e.g. with [noise](noise.md) functions such as [Perlin noise](perlin_noise.md) (it gives us a grayscale image that looks a bit like clouds). We then further process this base image(s) and combine the results in various ways, for example we may use different transformations, modulations, shaders, blending, adding color using [color ramps](color_ramp.md) etc. The whole texture is therefore described by a [graph](graph.md) in which nodes represent the operations we apply; this can literally be done visually in software like [Blender](blender.md) (see its [shader](shader.md) editor). The nice things are that we can now for example generalize the texture to 3 dimensions, i.e. not only have a flat image, but have a whole volume of a texture that can extremely easily be mapped to 3D objects simply by intersecting it with their surfaces which will yield a completely smooth texturing without any seams (this is quite often used along with [raytracing](raytracing.md)). Or we can animate a 2D texture by doing a moving cross section of 3D texture. We can also write the algorithm so that the generates texture has no seams if repeated side-by-side (by using modular "wrap-around" coordinates). We can also generate the texture at any arbitrary resolution as we have a continuous mathematical description of it; we may perform an infinite zoom into it if we want. As if that's not enough, we can also generate almost infinitely many slightly different versions of this texture by simply changing the [seed](seed.md) of [pseudorandom](pseudorandom.md) generators.
A good example to think of is generating procedural [textures](texture.md). This is generally done by first generating a basis image or multiple images, e.g. with [noise](noise.md) functions such as [Perlin noise](perlin_noise.md) (it gives us a grayscale image that looks a bit like clouds). We then further process this base image(s) and combine the results in various ways, for example we may use different transformations, [modulations](modulation.md), blending, adding color using [color ramps](color_ramp.md) etc. The whole texture is therefore described by a [graph](graph.md) in which nodes represent the operations we apply; this can literally be done visually in software like [Blender](blender.md) (see its [shader](shader.md) editor). The nice thing is that we can now for example generalize the texture to 3 dimensions, i.e. not only have a flat image, but have a whole volume of a texture that can extremely easily be mapped to 3D objects simply by intersecting it with their surfaces which will yield a completely smooth texturing without any seams; this is quite often used along with [raytracing](raytracing.md) -- we can texture an object by simply taking the coordinates of the ray hit as the 3D texture coordinates, it's that simple. Or we can animate a 2D texture by doing a moving cross section of 3D texture. We can also write the algorithm so that the generated texture has no seams if repeated side-by-side (by using modular "wrap-around" coordinates). We can also generate the texture at any arbitrary resolution as we have a continuous mathematical description of it; we may perform an infinite zoom into it if we want. As if that's not enough, we can also generate almost infinitely many slightly different versions of this texture by simply changing the [seed](seed.md) of [pseudorandom](pseudorandom.md) generator we use.
We use procedural generation mainly in two ways:

Loading…
Cancel
Save