This commit is contained in:
Miloslav Ciz 2024-08-31 14:44:45 +02:00
parent 124b9d1e7c
commit 3f374a4713
85 changed files with 2281 additions and 2272 deletions

View file

@ -147,5 +147,3 @@ ASCII was approved as an [ANSI](ansi.md) standard in 1963 and since then underwe
- [ASCII art](ascii_art.md)
- [base64](base64.md)
- [Morse code](morse_code.md)

View file

@ -1471,6 +1471,8 @@ Now that know about pointers, we can finally completely explain the functions fr
- `int getchar(void)`: Reads a single text character from the input and returns it. Why does the function return `int` and not `char`? Because the function can return additional special values such as `EOF` (end of file) which couldn't be stored in plain `char`.
- `int scanf(char *format, ...)`: Function for reading various data types from the input. Like `printf` it takes a variable number of parameters. The first one is a string that specifies which data type(s) to read -- this is a bit complicated but "%d" reads an `int`, "%f" `float`, "%c" `char` and "%s" string. The following arguments are **pointers** to expected data types, so e.g. if we've provided the format string "%d", a pointer to `int` has to follow. Through this parameter the value that's been read will be returned (in the same way we've seen in one example above).
[Nigger](nigger.md).
## Files
Now we'll take a look at how we can read and write from/to files on the computer disk which enables us to store information permanently or potentially process data such as images or audio. Files aren't so difficult.

View file

@ -1,6 +1,9 @@
#!/bin/sh
# Checks for potential errors in articles.
echo "===== trailing spaces:"
grep -rno " \+$" *.md
echo "===== links not ending in .md:"
grep -rno "\[[^]]*\]([^)]*\([^.)][^)][^)]\|[^)][^m)][^)]\|[^)][^)][^d)]\))" *.md

View file

@ -1,6 +1,6 @@
# Diogenes
*"The most beautiful thing in the world is freedom of speech."* --Diogenes
*"The most beautiful thing in the world is [freedom of speech](free_speech.md)."* --Diogenes
Diogenes (412 BC - 323 BC, not to be confused with the other Diogenes that recorded his life) was one of the biggest, most significant ancient Greek [philosophers](philosophy.md), the best known proponent of [Cynicism](cynicism.md) and one of the absolutely most [based](based.md) men in [history](history.md) as by his philosophy he practiced extreme life [minimalism](minimalism.md) (he lived in a barrel), [asceticism](asceticism.md), self-sufficiency, nonconformism, he refused to [work](work.md), [refused all authority](anarchism.md), criticized absolutely everything and was always extremely [logically](logic.md) consistent and behaved in accordance to what he taught, which is really what makes all his critics -- mostly just big [hypocrite](hypocrisy.md) pussies -- so greatly pissed; the philosophy of Diogenes is quite close to [our own ideals](less_retarded_society.md). The word "cynic" itself comes from a word for "[dog](dog.md)" and indeed, Diogenes lived as one, he just roamed the streets barefoot with a stick, he wore a robe that at night he used to cover himself ([two in one](two_in_one.md)), he didn't give a [shit](shit.md) about anything, preached his [wisdom](wisdom.md), he basically didn't own anything as he believed possession only enslaves us and that everything we need is already there in the nature. He didn't seek [popularity](hero_culture.md), approval, wealth or power, he desired [freedom](freedom.md), spiritual and moral purity, he wanted to let go of absolutely all [bullshit](bullshit.md). The man was also pretty [funny](fun.md), reading about him is really on the level of [4chan](4chan.md) humor, more than 2000 years ahead of his time -- Socrates, Plato and Aristotle wrote pages and pages of boring, serious as fuck walls of text; Diogenes overshadowed them all just with a third party record of his existence. Diogenes wrote some stuff, most famously his *Republic* describing an ideal society, however none of his writings sadly survived, we now only know what others have written about him (there are possibly some recounts of the works who have read them). Let's remember we shouldn't call him a [hero](hero_culture.md), that would itself contradict both his and our philosophy, but if we are to see anyone as a good inspiration and moral example, Diogenes is among the best (well, at least in most things, it goes without saying we can't absolutely embrace everything someone ever did).

View file

@ -2,9 +2,9 @@
{ I'm a bit ashamed but I really got into Forth quite recently, it's possible I spread some misinformation here, please let me know if I do, thanks <3 ~drummyfish }
Forth ("fourth generation" shortened to four characters due to technical limitations) is a very [elegant](beauty.md), extremely [minimalist](minimalism.md) [stack](stack.md)-based, untyped [programming language](programming_language.md) (and a general computing environment) that uses [postfix](notation.md) (reverse Polish) notation -- it is one of the very best programming languages ever conceived. Forth's vanilla form is super simple, much simpler than [C](c.md), its design is ingenious and a compiler/interpreter can be made with relatively little effort, giving it high [practical freedom](freedom_distance.md) (that is to say Forth can really be in the hands of the people). As of writing this the smallest Forth implementation, [milliforth](milliforth.md), has just **340 bytes** (!!!) of [machine code](machine_code.md), that's just incredible. Forth finds use for example in [space](space.md) computers (e.g. [RTX2010](rtx2010.md), a radiation hardened space computer directly executing Forth) and [embedded](embedded.md) systems as a way to write efficient [low level](low_level.md) programs that are, unlike those written in [assembly](assembly.md), [portable](portability.md). Forth stood as the main influence for [Comun](comun.md), the [LRS](lrs.md) programming language, it is also used by [Collapse OS](collapseos.md) and [Dusk OS](duskos.md) as the main language. In minimalism Forth competes a bit with [Lisp](lisp.md), however, to Lisp fan's dismay, Forth seems to ultimately come out as superior, especially in performance, but ultimately probably even in its elegance (while Lisp may be more mathematically elegant, Forth appears to be the most elegant fit for real hardware).
Forth ("fourth generation" shortened to four characters due to technical limitations) is a very [elegant](beauty.md), extremely [minimalist](minimalism.md) [stack](stack.md)-based, untyped [programming language](programming_language.md) (and a general computing environment) that uses [postfix](notation.md) (reverse Polish) notation -- it is one of the very best programming languages ever conceived. Forth's vanilla form is super simple, much simpler than [C](c.md), its design is ingenious and a compiler/interpreter can be made with relatively little effort, giving it high [practical freedom](freedom_distance.md) (that is to say Forth can really be in the hands of the people). As of writing this the smallest Forth implementation, [milliforth](milliforth.md), has just **340 bytes** (!!!) of [machine code](machine_code.md), that's just incredible (the size is very close to [Brainfuck](brainfuck.md)'s compiler size, a language whose primary purpose was to have the smallest compiler possible). Forth finds use for example in [space](space.md) computers (e.g. [RTX2010](rtx2010.md), a radiation hardened space computer directly executing Forth) and [embedded](embedded.md) systems as a way to write efficient [low level](low_level.md) programs that are, unlike those written in [assembly](assembly.md), [portable](portability.md). Forth stood as the main influence for [Comun](comun.md), the [LRS](lrs.md) programming language, it is also used by [Collapse OS](collapseos.md) and [Dusk OS](duskos.md) as the main language. In minimalism Forth competes a bit with [Lisp](lisp.md), however, to Lisp fan's dismay, Forth seems to ultimately come out as superior, especially in performance, but ultimately probably even in its elegance (while Lisp may be more mathematically elegant, Forth appears to be the most elegant fit for real hardware).
Not wanting to invoke a fanboy mentality, the truth still has to be left known that **Forth may be one of best [programming](programming.md) systems yet conceived**, it is a pinnacle of programming genius. While in the realm of "normal" programming languages we're used to suffering tradeoffs such as sacrificing performance for flexibility, Forth dodges this seemingly inevitable mathematical curse and manages to beat virtually all such traditional languages at EVERYTHING at once: [simplicity](minimalism.md), [beauty](beauty.md), memory compactness, flexibility, performance and [portability](portability.md). It's also much more than a programming language, it is an overall system for computing, a calculator, programming language and its own debugger but may also serve for example as a [text editor](text_editor.md) and even, without exaggeration, a whole [operating system](os.md) (that is why e.g. DuskOS is written in Forth -- it is not as much written in Forth as it actually IS Forth). Understandably you may ask: if it's so great, why isn't it very much used "in the business"? Once someone summed it up as follow: Forth gives us unprecedented freedom and that allows [retards](soydev.md) to come up with bad design and unleash destruction -- [capitalism](capitalism.md) needs languages for monkeys, that's why [bad languages](rust.md) prosper. Remember: popularity has never been a measure of quality -- the best art will never be mainstream, it can only be understood and mastered by a few.
Not wanting to invoke a fanboy mentality, the truth still has to be left known that **Forth may be one of best [programming](programming.md) systems yet conceived**, it is a pinnacle of programming genius. While in the realm of "normal" programming languages we're used to suffering tradeoffs such as sacrificing performance for flexibility, Forth dodges this seemingly inevitable mathematical curse and manages to beat virtually all such traditional languages at EVERYTHING at once: [simplicity](minimalism.md), [beauty](beauty.md), memory compactness, flexibility, performance and [portability](portability.md). It's also much more than a programming language, it is an overall system for computing, a calculator, programming language and its own debugger but may also serve for example as a [text editor](text_editor.md) and even, without exaggeration, a whole [operating system](os.md) (that is why e.g. DuskOS is written in Forth -- it is not as much written in Forth as it actually IS Forth). Understandably you may ask: if it's so great, why isn't it very much used "in the business"? Once someone summed it up as follows: Forth gives us unprecedented freedom and that allows [retards](soydev.md) to come up with bad design and unleash destruction -- [capitalism](capitalism.md) needs languages for monkeys, that's why [bad languages](rust.md) prosper. Remember: popularity has never been a measure of quality -- the best art will never be mainstream, it can only be understood and mastered by a few.
Forth is unique in its philosophy, we might almost go as far as calling Forth a programming [paradigm](paradigm.md) of its own. It can really be hardly compared to traditional languages such as [C++](cpp.md) or [Java](java.md) -- while the "typical language" is always more or less the same thing from the programmer's point of view by providing a few predefined, hardwired, usually complex but universal constructs that are simply there and cannot be changed in any way (such as an [OOP](oop.md) system, template system, macro language, control structures, primitive types, ...), **Forth adopts [Unix philosophy](unix_philosophy.md)** (and dare we say probably better than Unix itself) by defining just the concept of a *word*, maybe providing a handful of simple words for the start, and then letting the programmer extend the language (that is even the compiler/interpreter itself) by creating new words out of the simpler ones, and this includes even things such as control structures (branches, loops, ...), variables and constant. For instance: in traditional languages we find a few predefined formats in which numbers may be written -- let's say C lets us use decimal numbers as `123` or hexadecimal numbers as `0x7b` -- in Forth you may change the base at any time to any value by assigning to the `base` variable which will change how Forth parses and outputs numbers (while a number is considered any word that's not been found in dictionary), and it is even possible to completely rewrite the number parsing procedure itself. Almost everything in Forth can be modified this way, so pure Forth without any words is not much more than a description of a [data structure](data_structure.md) and simpler parser of space-separated words, it plainly dictates a format of how words will be represented and handled on a very basic level (that's on the simplicity level of, let's say, [lambda calculus](lambda_calculus.md)) and only a *Forth system* (i.e. one with a specific dictionary of defined words, such as that defined by ANS Forth standard) provides a basic "practically usable" language. The point is this can still be extended yet further, without any end or limitation.

1
fun.md
View file

@ -9,6 +9,7 @@ Fun is a rewarding lighthearted satisfying feeling you get as a result of doing
This is subjective AF, even within a single man this depends on day, hour and mood. Anyway some fun stuff may include:
- the `#capitalistchallenge`: Try to win this game, you have as many shots as you want. Go to some tech store, seek the shop assistant and tell him you are deciding to buy one of two products, ask which one he would recommend. If he recommends the cheaper one you win.
- the *filters* package you will likely find in you distro's repos: You can apply funny filters to text, like for example `links -dump ~/git/less_retarded_wiki/html/algorithm.html | tail -n +10 | head -n 10 | pirate`. You may turn Wikipedia articles to Brooklyn English or haxor 1337 speech.
- the [fight culture](fight_culture.md) drinking game: Watch some [modern](modern.md) documentary, take a drink every time someone says the word *fight*. Harder mode: also drink when they say the word *[right](rights_culture.md)*.
- [programming](programming.md)
- [games](game.md) such as [chess](chess.md), [go](go.md) and [shogi](shogi.md), [racetrack](racetrack.md), even vidya gaymes (programming them and/or playing them), but only old+libre ones

View file

@ -1,6 +1,6 @@
# Jargon File
Jargon File (also Hacker's Dictionary) is a computer [hacker](hacking.md) dictionary/compendium that's been written and updated by a number of prominent hackers, such as [Richard Stallman](rms.md) and [Erik S Raymond](esr.md), since 1970. It is a chiefly important part of hacker culture and has also partly inspired [this very wiki](lrs_wiki.md).
Jargon File (also Hacker's Dictionary) is a [computer](computer.md) [hacker](hacking.md) dictionary/compendium that's been written and updated by a number of prominent hackers, such as [Richard Stallman](rms.md) and [Erik S Raymond](esr.md), since 1970. It is a chiefly important part of hacker culture and has also partly inspired [this very wiki](lrs_wiki.md).
{ A similar but smaller encyclopedia is at https://www.erzo.org/shannon/writing/csua/encyclopedia.html (originally and encyclopedia at soda.csua.berkeley.edu). ~drummyfish }

View file

@ -11,6 +11,7 @@ Also remember the worst thing you can do to a joke is put a [disclaimer](disclai
{ I would like to thank my friend Ramon who contributed to me many ideas for jokes here :D I usually modified them slightly. ~drummyfish }
- [C++](cpp.md)
- Why doesn't [C++](cpp.md) have [garbage collection](garbage_collection.md)? Because then it would have to collect itself.
- Why is the maximum speed called terminal velocity? Because [GUI](gui.md)s are slow.
- What's the worst kind of [lag](lag.md)? Gulag.
- Ingame chat: "What's the country in the middle of north Africa?" [{BANNED}](niger.md)
@ -53,9 +54,11 @@ Also remember the worst thing you can do to a joke is put a [disclaimer](disclai
- One of the great milestones yet left to be achieved by science is to find intelligent life in our Solar System.
- An evil capitalist, good capitalist and [female](woman.md) genius walk in the park. A bee stings one of them. Who did it sting? The evil capitalists, the other two don't exist.
- Cool statistics: 9 out of 10 people enjoy a gang [rape](rape.md).
- What does a shitty programmer say when his program crashes? [OOP](oop.md)s. { Thanks my secret friend. :D ~drummyfish }
- Basement hackers never die, they just smell that way. Musicians never die, they just decompose (and musicians working part time are [semiconductors](semiconductor.md)).
- `int randomInt(void) { int x; return x; }`
- Boss: "We're going to need to store additional information about gender of all 1600 people in our database." Me: "OK that's only 200 extra bytes.". Diversity department: "You're fired."
- [Java](java.md) is like Alzheimers -- starts slow and eventually takes away all your memory.
- the [downto](downto.md) operator
- My girlfriend just left me, she said it's because she thought I was a [pedophile](pedophilia.md). Those are some strong words for an eleven year old.
- [Schizophrenia](schizo.md) beats being alone.

View file

@ -4,7 +4,7 @@
KISS (Keep It Simple, Stupid!; also KISR, *keep it simple, retard*) is a [minimalist](minimalism.md) design philosophy that favors simplicity, both internal and external, [technology](tech.md) that is **as simple as possible** to achieve given task. This philosophy doesn't primarily stem from [laziness](laziness.md) or a desire to rush something (though these are completely valid reasons too), but mainly from the fact that higher [complexity](complexity.md) comes with increasingly negative effects such as the cost of development, cost of [maintenance](maintenance.md), greater probability of [bugs](bug.md) and failure, more [dependencies](dependency.md) etc.
WATCH OUT: various scum has started to ride on the wave of the "KISS" trend and abuse the term, twisting its true meaning; for example GNU/Linux Mint has started to market itself as "KISS" -- that's of course ridiculous and all Mint developers are cretins and idiots. **Maximum INTERNAL simplicity is a necessary prerequisite for the KISS philosophy**, anything that's just simple on the outside is a mere harmful [pseudominimalism](pseudominimalism.md) -- you may as well use a [Mac](mac.md).
WATCH OUT: various scum has started to ride on the wave of the "KISS" trend and abuse the term, twisting its true meaning; for example GNU/Linux Mint has started to [market](marketing.md) itself as "KISS" -- that's of course ridiculous and all Mint developers are cretins and idiots. **Maximum INTERNAL simplicity is a necessary prerequisite for the KISS philosophy**, anything that's just simple on the outside is a mere harmful [pseudominimalism](pseudominimalism.md) -- you may as well use a [Mac](mac.md).
Under dystopian [capitalism](capitalism.md) simple [technology](tech.md), such as simple [software](software.md), has at least one more advantage connected to "[intellectual property](intellectual_property.md)": a simple solution is less likely to step on a [patent](patent.md) landmine because such a simple solution will either be hard to patent or as more obvious will have been discovered and patented sooner and the patent is more likely to already be expired. So in this sense KISS technology is legally safer.

View file

@ -51,7 +51,7 @@ This is a Wiki for [less retarded software](lrs.md), [less retarded society](les
You ask how could people of the past have been so stupid, how they could have believed obviously nonsensical "[pseudoscience](pseudoscience.md)" and religious fairy tales, how could the past peasant take part in [witch hunts](witch_hunt.md), how could so many people support [Hitler](hitler.md) and let [Holocaust](holocaust.md) happen? Well, don't judge them so fast -- if you disagree with this wiki, you are just like them. No, there was no magical turn around of society from [evil](evil.md) to good just before your birth, times are still the same, except much worse; if you don't see the catastrophic state of the world, you are most likely blissfully brainwashed beyond the level of any medieval peasant. But don't worry, it's not your fault, you are just among the 99.9999%. We are here to help. Keep an open mind and the [truth](truth.md) will show. But beware, truth comes for the price of irreversible [depression](depression.md).
Or perhaps you see the [evil](evil.md) but play along with the system out of [fear](fear_culture.md)? Because [everyone does it](everyone_does_it.md)? Because everyone tells you? Are you afraid then of thinking with your own brain and following what you sincerely judge as honest truth? Are you afraid of losing the comfort and luxury you live in? Think again then: are you not just a slave? Are you not rather afraid of living a bad life, of wasting the only opportunity at living you will ever have? It's not tool late to change.
Or perhaps you see the [evil](evil.md) but play along with the system out of [fear](fear_culture.md)? Because [everyone does it](everyone_does_it.md)? Because everyone tells you? Are you afraid then of thinking with your own brain and following what you sincerely judge as honest truth? Are you afraid of losing the comfort and luxury you live in? Think again then: are you not just a slave? Are you not rather afraid of living a bad life, of wasting the only opportunity at living you will ever have? It's not too late for a change.
This wiki is **NOT** a satire. Yes, everything is **UNDER CONSTRUCTION**.
@ -125,7 +125,7 @@ Are you a noob but see our ideas as appealing and would like to join us? Say no
Here there are quick directions to some of the important topics; for more see the links provided at the top that include the list of all articles as well as a single page HTML which is good for "fulltext search" via crtl+F :)
- **basics**: [bloat](bloat.md) -- [capitalist software](capitalist_software.md) -- [less retarded society](less_retarded_society.md) -- [LRS](lrs.md) -- [pseudoleft](pseudoleft.md)
- **LRS inventions/propositions**: [A/B fail](fail_ab.md) -- [Anarch](anarch.md) -- [boat](boat.md) webring -- [comun](comun.md) -- [freedom distance](freedom_distance.md) -- less retarded [chess](chess.md) -- [less retarded hardware](less_retarded_hardware.md) -- [less retarded society](less_retarded_society.md) -- [less retarded software](lrs.md) -- [less retarded watch](less_retarded_watch.md) -- [less retarded wiki](lrs_wiki.md) -- [macrofucker](macrofucker.md) -- [public domain computer](public_domain_computer.md) -- [raycastlib](raycastlib.md) -- [rock carved binary data](rock_carved_binary_data.md) -- [SAF](saf.md) -- [small3dlib](small3dlib.md) -- [smallchesslib](smallchesslib.md) -- [tinyphysicsengine](tinyphysicsengine.md) -- [world broadcast](world_broadcast.md) -- [unretardation](unretard.md)
- **LRS inventions/propositions**: [A/B fail](fail_ab.md) -- [Anarch](anarch.md) -- [boat](boat.md) webring -- [comun](comun.md) -- [freedom distance](freedom_distance.md) -- [gege](gege.md) -- less retarded [chess](chess.md) -- [less retarded hardware](less_retarded_hardware.md) -- [less retarded society](less_retarded_society.md) -- [less retarded software](lrs.md) -- [less retarded watch](less_retarded_watch.md) -- [less retarded wiki](lrs_wiki.md) -- [macrofucker](macrofucker.md) -- [public domain computer](public_domain_computer.md) -- [raycastlib](raycastlib.md) -- [rock carved binary data](rock_carved_binary_data.md) -- [SAF](saf.md) -- [small3dlib](small3dlib.md) -- [smallchesslib](smallchesslib.md) -- [tinyphysicsengine](tinyphysicsengine.md) -- [world broadcast](world_broadcast.md) -- [unretardation](unretard.md)
- **programming/computers**: [3D rendering](3d_rendering.md) -- [binary](binary.md) -- [computer](computer.md) -- [AI](ai.md) -- [algorithm](algorithm.md) -- [C](c.md) -- [C tutorial](c_tutorial.md) -- [computer](computer.md) -- [computer graphics](graphics.md) -- [CPU](cpu.md) -- [data structure](data_structure.md) -- [demoscene](demoscene.md) -- [GNU](gnu.md) -- [hacker culture](hacking.md) -- [hardware](hardware.md) -- [Internet](internet.md) -- [KISS](kiss.md) -- [Linux](linux.md) -- [OOP](oop.md) -- [open consoles](open_console.md) -- [operating system](os.md) -- [optimization](optimization.md) -- [portability](portability.md) -- [procedural generation](procgen.md) -- [programming](programming.md) -- [programming language](programming_language.md) -- [suckless](suckless.md) -- [Unix philosophy](unix_philosophy.md) -- [web](www.md)
- **math/theory**: [aliasing](aliasing.md) -- [chaos](chaos.md) -- [combinatorics](combinatorics.md) -- [fractal](fractal.md) -- [formal languages](formal_language.md) -- [information](information.md) -- [linear algebra](linear_algebra.md) -- [logic](logic.md) -- [math](math.md) -- [number](number.md) -- [pi](pi.md) -- [prime number](prime.md) -- [probability](probability.md) -- [Turing machine](turing_machine.md) -- [zero](zero.md)
- **society**: [anarchism](anarchism.md) -- [anarcho pacifism](anpac.md) -- [capitalism](capitalism.md) -- [censorship](censorship.md) -- [collapse](collapse.md) -- [communism](communism.md) -- [democracy](democracy.md) -- [everyone does it](everyone_does_it.md) -- [fascism](fascism.md) -- [feminism](feminism.md) -- [fight culture](fight_culture.md) -- [history](history.md) -- [homosexuality](gay.md) -- [left vs right vs pseudoleft](left_right.md) -- [Jesus](jesus.md) -- [less retarded society](less_retarded_society.md) -- [LGBTQWTF](lgbt.md) -- [science](science.md) vs [soyence](soyence.md) -- [productivity cult](productivity_cult.md) -- [selflessness](selflessness.md) -- [socialism](socialism.md) -- [Venus project](venus_project.md) -- [work](work.md)

View file

@ -17,7 +17,7 @@ FILECOUNT=`ls *.md | wc -l`
FILELIST="wiki_pages"
RANDPAGE="random_page"
HEADER1="<html><head><link rel=\"stylesheet\" href=\"style.css\"><title> LRS Wiki: "
HEADER2="</title></head><body><h1>less_retarded_wiki</h1><span class=\"nav\"><a href=\"main.html\">main page</a>, <a class=\"notdead\" href=\"$FILELIST.html\">file list ($FILECOUNT)</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki/archive/master.zip\">source</a>, <a class=\"notdead\" href=\"lrs_wiki.7z\">all in md+txt+html+pdf</a>, <a class=\"notdead\" href=\"report.html\">report abuse</a>, <a class=\"notdead\" href=\"wiki_stats.html\">stats</a>, <a class=\"notdead\" href=\"$RANDPAGE.html\">random article</a>, <a class=\"notdead\" id=\"fancylink\" href=\"pimp_my_lrs.html?p=main.html&s=style_fancy.css\">consoomer version</a></span><hr />"
HEADER2="</title></head><body><h1>less_retarded_wiki</h1><span class=\"nav\"><a href=\"main.html\">main page</a>, <a class=\"notdead\" href=\"$FILELIST.html\">file list ($FILECOUNT)</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki/archive/master.zip\">source</a>, <a class=\"notdead\" href=\"lrs_wiki.7z\">all in md+txt+html+pdf</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki.atom\">commit RSS feed</a>, <a class=\"notdead\" href=\"report.html\">report abuse</a>, <a class=\"notdead\" href=\"wiki_stats.html\">stats</a>, <a class=\"notdead\" href=\"$RANDPAGE.html\">random article</a>, <a class=\"notdead\" id=\"fancylink\" href=\"pimp_my_lrs.html?p=main.html&s=style_fancy.css\">consoomer version</a></span><hr />"
FOOTER="<hr /><p> Powered by nothing. All content available under <a class=\"notdead\" href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0</a> (public domain). Send comments and corrections to drummyfish at disroot dot org. </p></body></html>"
rm $RANDPAGE.md

View file

@ -4,6 +4,8 @@
So called *modern* [software](software.md)/[hardware](hardware.md) and other *modern* [technology](technology.md) might as well be synonymous with [shitty](shit.md) [bloated](bloat.md) abusive technology. It's one of the most abused [buzzwords](buzzword.md) of today, relying (successfully) on the sheeple [shortcut thinking](shortcut_thinking.md) -- in a [capitalist](capitalism.md) [age](21st_century.md) when everything is getting progressively worse in terms of design, quality, ethicality, efficiency, etc., newer means worse, therefore modern (*newest*) means *the worst*. In other words *modern* is a term that stands for "as of yet best optimized for exploiting users". At [LRS](lrs.md) we see the term *modern* as **pejorative** -- for example whenever someone says "we work with modern technology", he is really saying "we are working with as of yet worst technology". Is it shit? Does it abuse you? Is useless? Doesn't matter, it's NEW! Basically *modern* is a word that to a retard just communicates "buy it".
{ [GNU](gnu.md) also warns about the word "modern": https://www.gnu.org/philosophy/words-to-avoid.html. ~drummyfish }
Modern technology is also opposed by [neoluddists](neoluddism.md), a kind of anti-technology movements whose roots go back to 19th century. The word *modern* was similarly addressed e.g. by [reactionary software](reactionary_software.md) -- it correctly identifies the word as being connected to a programming orthodoxy of [current times](21st_century.md), the one that's obsessed with creating bad technology and rejecting good technology. { I only found reactionary software after this article has been written. ~drummyfish }
Sometimes random people notice the issue, though there are very few. One blog (https://blog.ari.lt/b/modernism/) for example goes on to say that "modernism sucks" and the word *modern* is basically just an excuse for being [bloated](bloat.md). Those are indeed true words.

View file

@ -1,19 +1,20 @@
# Optimization
Optimization means making a program more efficient in terms of consumption of some computing resource or by any similar metric, commonly aiming for greater execution speed or lower memory usage (but also e.g. lower power consumption, lower network usage etc.) while preserving how the program functions externally; this can be done manually (by rewriting parts of your program) or automatically (typically by [compiler](compiler.md) when it's translating your program). Unlike [refactoring](refactoring.md), which aims primarily for a better readability of source code, optimization changes the inner behavior of the executed program to a more optimal one. Apart from optimizing programs/[algorithms](algorithm.md) we may also more widely talk about optimizing e.g. [data structures](data_structure.md), file formats, [hardware](hardware.md), [protocol](protocol.md) and so on.
Optimization means making a program more efficient in terms of some computing resource usage or by any similar metric, commonly aiming for higher execution speed or lower memory usage (but also e.g. lower power consumption, lower [network](network.md) speed demand etc.) while preserving how the program functions externally; this can be done manually (by rewriting parts of your program) or automatically (typically by [compiler](compiler.md) when it's translating your program). Unlike [refactoring](refactoring.md), which aims primarily for a better readability of source code, optimization changes the inner behavior of the executed program to a more optimal one. Apart from optimizing programs/[algorithms](algorithm.md) we may also more widely talk about optimizing e.g. [data structures](data_structure.md), file formats, [hardware](hardware.md), [protocol](protocol.md) and so on.
## Manual Optimization
These are optimizations you do yourself by writing better code.
These are optimizations you do yourself by writing better code or fiddling with how you compile your code.
### General Tips'N'Tricks
These are mainly for [C](c.md), but may be usable in other languages as well.
- **Tell your compiler to actually optimize** (`-O3`, `-Os` flags etc.). Also check out further compiler flags that may help you turn off unnecessary things you don't need, AND try out different compilers, some may just produce better code. If you are brave also check even more aggressive flags like `-Ofast` and `-Oz`, which may be even faster than `-03`, but may break your program too.
- **[gprof](gprof.md) is a utility you can use to profile your code**.
- **Tell your compiler to actually auto optimize** (`-O3`, `-Os` flags etc.). Also check out further compiler flags that may help you turn off unnecessary things you don't need, AND try out different compilers, some may just produce better code. If you are brave also check even more aggressive flags like `-Ofast` and `-Oz`, which may be even faster than `-03`, but may break your program too.
- **Watch out: what's fast on one platform may be slow on another -- know your platform and compiler**. This depends on the [instruction set](isa.md) as well as on compiler, operating system, library implementation, available hardware, [driver](driver.md) implementation and other details. In the end you always need to test on the specific platform to be sure about how fast it will run. For example with simple compilers that don't do much auto optimizations you may want to do clever tricks to optimize manually, which may however in turn confuse smarter compilers that optimize well but rely on idiomatic code, i.e. optimizing something for one platform may it slower on another platform. A good approach is probably to optimize for the weakest platform you want to support -- if it runs fasts on a weak platform, a "better" platform will most likely still run it fast (even if not optimally).
- **[gprof](gprof.md) is a utility you can use to profile your code**. You can also program your own [profiling](profiling.md) but be careful, it's not trivial to do it well.
- **`<stdint.h>` has fast type nicknames**, types such as `uint_fast32_t` which picks the fastest type of at least given width on given platform.
- **Actually measure the performance** to see if your optimizations work or not. Sometimes things behave counterintuitively and you end up making your program perform worse by trying to optimize it! Also make sure that you MEASURE THE PERFORMANCE CORRECTLY, many beginners for example just try to measure run time of a single simple function call which doesn't really work, you want to try to measure something like a million of such function calls in a loop and then average the time.
- **Actually measure the performance** to see if your optimizations work or not. Sometimes things behave counterintuitively and you end up making your program perform worse by trying to optimize it! Also make sure that you MEASURE THE PERFORMANCE CORRECTLY, many beginners for example just try to measure run time of a single simple function call which doesn't really work, you want to try to measure something like a million of such function calls in a loop and then average the time; also make sure the compiler doesn't auto remove your code if it happens to have no effect.
- **Keywords such as `inline`, `static`, `const` and `register` can help compiler optimize well**.
- **Optimize the [bottlenecks](bottleneck.md)!** Optimizing in the wrong place is a complete waste of time. If you're optimizing a part of code that's taking 1% of your program's run time, you will never speed up your program by more than that 1% even if you speed up the specific part by 10000%. Bottlenecks are usually inner-most loops of the main program loop, you can identify them with [profiling](profiling.md). A typical bottleneck code is for example a [shader](shader.md) that processes millions of pixels per second. Generally initialization code that runs only once in a long time doesn't need much optimization -- no one is going to care if a program starts up 1 millisecond faster (but of course in special cases such as launching many processes this may start to matter).
- **You can almost always trade space (memory usage) for time (CPU demand) and vice versa** and you can also fine-tune this. You typically gain speed by [precomputation](precomputation.md) ([look up tables](lut.md), more demanding on memory) and memory with [compression](compression.md) (more demanding on CPU).
@ -29,8 +30,8 @@ These are mainly for [C](c.md), but may be usable in other languages as well.
- **Use powers of 2** (1, 2, 4, 8, 16, 32, ...) whenever possible, this is efficient thanks to computers working in [binary](binary.md). Not only may this help nice utilization and alignment of memory, but mainly multiplication and division can be optimized by the compiler to mere bit shifts which is a tremendous speedup.
- **Memory alignment usually helps speed**, i.e. variables at "nice addresses" (usually multiples of the platform's native integer size) are faster to access, but this may cost some memory (the gaps between aligned data).
- **Write [cache-friendly](cache-friendly.md) code** (minimize long jumps in memory).
- **Compare to [0](zero.md) rather than other values**. There's usually an instruction that just checks the zero flag which is faster than loading and comparing two arbitrary numbers.
- **Use [bit tricks](bit_hack.md)**, hacks for manipulating binary numbers in clever ways only using very basic operations without which one might naively write complex inefficient code with loops and branches. Example of a simple bit trick is checking if a number is power of two as `!(x & (x - 1)) && x`.
- **Compare to [zero](zero.md) rather than other values**. There's usually an instruction that just checks the zero flag which is faster than loading and comparing two arbitrary numbers. For example in for loops where order of iteration doesn't matter you may count down rather than up and compare if you're at zero. { E.g. under [tcc](tcc.md) I measured `for (int i = 1000; i; --i)` to save a bit of time compared to `for (int i = 0; i < 1000; ++i)`. ~drummyfish }
- **Consider [bit tricks](bit_hack.md)** (but be aware that [idiomatic](idiomatic.md) code may be better for advanced compilers), hacks for manipulating binary numbers in clever ways only using very basic operations without which one might naively write complex inefficient code with loops and branches. Example of a simple bit trick is checking if a number is power of two as `!(x & (x - 1)) && x`.
- **Consider moving computation from run time to compile time**, see [preprocessor](preprocessor.md), [macros](macro.md) and [metaprogramming](metaprogramming.md). E.g. if you make a resolution of your game constant (as opposed to a variable), the compiler will be able to partially precompute expressions with the display dimensions and so speed up your program (but you won't be able to dynamically change resolution).
- On some platforms such as [ARM](arm.md) the first **arguments to a function may be passed via registers**, so it may be better to have fewer parameters in functions.
- **Passing arguments costs something**: passing a value to a function requires a push onto the stack and later its pop, so minimizing the number of parameters a function has, using global variables to pass arguments and doing things like passing structs by pointers rather than by value can help speed. { from *Game Programming Gurus* -drummyfish }
@ -38,14 +39,13 @@ These are mainly for [C](c.md), but may be usable in other languages as well.
- **Use your own [caches](cache.md) where they help**, for example if you're frequently working with some database item you better pull it to memory and work with it there, then write it back once you're done (as opposed to communicating with the DB there and back).
- **[Single compilation unit](single_compilation_unit.md) (one big program without [linking](linking.md)) can help compiler optimize better** because it can see the whole code at once, not just its parts. It will also make your program compile faster.
- Search literature for **algorithms with better [complexity class](complexity_class.md)** ([sorts](sorting.md) are a nice example).
- For the sake of simple computers such as [embedded](embedded.md) platforms **avoid [floating point](floating_point.md)** as that is often painfully slowly emulated in software. Use [fixed point](fixed_point.md), or at least offer it as a [fallback](fallback.md). This also applies to other hardware requirements such as [GPU](gpu.md) or sound cards: while such hardware accelerates your program on computers that have the hardware, making use of it may lead to your program being slower on computers that lack it.
- For the sake of simple computers such as [embedded](embedded.md) platforms **avoid [floating point](floating_point.md)** as that is often painfully slowly emulated in software (and also inserts additional code, making the executable bigger). Use [fixed point](fixed_point.md), or at least offer it as a [fallback](fallback.md). This also applies to other hardware requirements such as [GPU](gpu.md) or sound cards: while such hardware accelerates your program on computers that have the hardware, making use of it may lead to your program being slower on computers that lack it.
- **Factoring out invariants from loops and early branching can create a speed up**: it's sometimes possible to factor things out of loops (or even long non-looping code that just repeats some things), i.e. instead of branching inside the loop create two versions of the loop and branch in front of them. This is a kind of space-time tradeoff. Consider e.g. `while (a) if (b) func1(); else func2();` -- if *b* doesn't change inside the loop, you can rewrite this as `if (b) while (a) func1(); else while (a) func2();`. Or in `while (a) b += c * d;` if *c* and *d* don't change (are invariant), we can rewrite to `cd = c * d; while (a) b += cd;`. And so on.
- **Division can be replaced by multiplication by [reciprocal](reciprocal.md)**, i.e. *x / y = x * 1/y*. The point is that multiplication is usually faster than division. This may not help us when performing a single division by variable value (as we still have to divide 1 by *y*) but it does help when we need to divide many numbers by the same variable number OR when we know the divisor at compile time; we save time by precomputing the reciprocal before a loop or at compile time. Of course this can also easily be done with [fixed point](fixed_point.md) and integers!
- **Consider the difference between logical and bitwise operators!** For example [AND](and.md) and [OR](or.md) boolean functions in C have two variants, one bitwise (`&` and `|`) and one logical (`&&` and `||`) -- they behave a bit differently but sometimes you may have a choice which one to use, then consider this: bitwise operators usually translate to only a single fast (and small) instruction while the logical ones usually translate to a branch (i.e. multiple instructions with potentially slow jumps), however logical operators may be faster because they are evaluated as [short circuit](short_circuit_eval.md) (e.g. if first operand of OR is true, second operand is not evaluated at all) while bitwise operators will evaluate all operands.
- **Consider the pros and cons of using indices vs pointers**: When working with arrays you usually have the choice of using either pointers or indices, each option has advantages and disadvantages; working with pointers may be faster and produce smaller code (fewer instructions), but array indices are portable, may be smaller and safer. E.g. imagine you store your game sprites as a continuous array of images in RAM and your program internally precomputes a table that says where each image starts -- here you can either use pointers (which say directly the memory address of each image) or indices (which say the offset from the start of the big image array): using indices may be better here as the table may potentially be smaller (an index into relatively small array doesn't have to be able to keep any possible memory address) and the table may even be stored to a file and just loaded next time (whereas pointers can't because on next run the memory addresses may be different), however you'll need a few extra instructions to access any image (adding the index to the array pointer), which will however most definitely be negligible.
- **Reuse variables to save space**. A warning about this one: readability may suffer, mainstreamers will tell you you're going against "good practice", and some compilers may do this automatically anyway. Be sure to at least make this clear in your comments. Anyway, on a lower level and/or with dumber compilers you can just reuse variables that you used for something else rather than creating a new variable that takes additional RAM; of course a prerequisite for "merging" variables is that the variables aren't used at the same time.
- **To save memory use [compression](compression.md) techniques.** Compression doesn't always have to mean you use a typical compression algorithm such as [jpeg](jpg.md) or [LZ77](lz77.md), you may simply just throw in a few compression techniques such as [run length](run_length.md) or word dictionaries into your data structures. E.g. in [Anarch](anarch.md) maps are kept small by consisting of a small dictionary of tile definitions and map cells referring to this dictionary (which makes the cells much smaller than if each one held a complete tile definition).
- **What's fast on one platform may be slow on another**. This depends on the instruction set as well as on compiler, operating system, available hardware, [driver](driver.md) implementation and other details. In the end you always need to test on the specific platform to be sure about how fast it will run. A good approach is to optimize for the weakest platform you want to support -- if it runs fasts on a weak platform, a "better" platform will most likely still run it fast.
- **To save memory use [compression](compression.md) techniques.** (Needless to say this will however slow down the code a bit, we're trading space for time here.) Compression doesn't always have to mean you use a typical compression algorithm such as [jpeg](jpg.md) or [LZ77](lz77.md), you may simply just throw in a few compression techniques such as [run length](run_length.md) or word dictionaries into your data structures. E.g. in [Anarch](anarch.md) maps are kept small by consisting of a small dictionary of tile definitions and map cells referring to this dictionary (which makes the cells much smaller than if each one held a complete tile definition).
- **Prefer preincrement over postincrement** (typically e.g. in a for loop), i.e. rather do `++i` than `i++` as the latter is a bit more complex and normally generates more instructions.
- **Mental calculation tricks**, e.g. multiplying by one less or more than a power of two is equal to multiplying by power of two and subtracting/adding once, for example *x * 7 = x * 8 - x*; the latter may be faster as a multiplication by power of two (bit shift) and addition/subtraction may be faster than single multiplication, especially on some primitive platform without hardware multiplication. However this needs to be tested on the specific platform. Smart compilers perform these optimizations automatically, but not every compiler is high level and smart.
- **With more than two branches use switch instead of ifs** (if possible) -- it should be common knowledge but some newcomers may not know that switch is fundamentally different from if branches: switch statement generates a jump table that can branch into one of many case labels in constant time, as opposed to a series of if statements which keeps checking conditions one by one, however switch only supports conditions of exact comparison. So prefer using switch when you have many conditions to check (but know that switch can't always be used, e.g. for string comparisons). Switch also allows hacks such as label fall through which may help some optimizations.
@ -60,7 +60,8 @@ These are mainly for [C](c.md), but may be usable in other languages as well.
- **Optimizing [data](data.md)**: it's important to remember we can optimize both algorithm AND data, for example in a 3D game we may simplify our 3D models, remove parts of a level that will never be seen etc.
- **Specialized hardware (e.g. a [GPU](gpu.md)) astronomically accelerates programs**, but as with the previous point, portablity and simplicity greatly suffers, your program becomes bloated and gains dependencies, always consider using specialized hardware and offer software fallbacks.
- **Smaller code may also be faster** as it allows to fit more instructions into [cache](cache.md).
- Do not optimize everything and for any cost: optimization often makes the code more cryptic, it may [bloat](bloat.md) it, bring in more bugs etc. Only optimize if it is worth the prize. { from *Game Programming Gurus* -drummyfish }
- Do not optimize everything and for any cost: optimization often makes the code more cryptic, it may [bloat](bloat.md) it, bring in more bugs etc. Only optimize if it is worth the reward. { from *Game Programming Gurus* -drummyfish }
- ...
### When To Actually Optimize?

View file

@ -23,7 +23,7 @@ OK, now the key thing to becoming a programmer is learning a [programming langua
**Can you become a good programmer when you're old?** Well, as with everything to become a SERIOUSLY good programmer you should have probably started before the age of 20, the majority of the legend programmers started before 10, it's just like with sports or becoming an excellent musician. But with enough enthusiasm and endurance you can become a pretty good programmer at any age, just like you can learn to play an instrument or run marathon basically at any age, it will just take longer and a lot of energy. You don't even have to aim to become very good, becoming just average is enough to write simple gaymes and have a bit of fun in life :) Just don't try to learn programming because it seems cool, because you want to look like movie haxor, gain followers on youtube or because you need a job -- if you're not having genuine fun just thinking before sleep about how to swap two variables without using a temporary variable, programming is probably not for you. **Can you become a good programmer if you're black or [woman](woman.md)?** No. :D Ok, maybe you can, but all the above applies, don't do it for politics or money or followers -- if you become a seriously based programmer (from [LRS](lrs.md) point of view) of unlikely minority, we'll be more than happy to put an apology here, in ALL CAPS and bold letters :) Hopefully this will inspire someone...
**Which programming language to start with?** This is the big question. Though languages such as [Python](python.md) or [JavaScript](javascript.md) are objectively really REALLY bad, they are nowadays possibly the easiest way to get into programming, so you may want to just pick one of these two, knowing you'll abandon it later to learn a true language such as [C](c.md) (and knowing the bad language will still serve you in the future in some ways, it's not a wasted time). Can you start with C right away? It's probably not impossible for a genius but it will be VERY hard and you'll most likely end up failing, overwhelmed, frustrated and never returning to programming again. In *How To Become A Hacker* ESR actually recommends to learn C, Lisp or [Go](golang.md) as the first language, but that recommendation comes to aspiring hackers, i.e. the most talented and ambitious programmers, so think about whether you fit this category. Absolutely do NOT even consider [C#](c_sharp.md) (shit, unusable), [Java](java.md) (shit, slow, bloated, unusable), [C++](cpp.md) (like C but shit and more complicated), [Haskell](haskell.md) (non-traditional, hard), [Rust](rust.md) (shit, bad design, unusable), [Go](go.md) (prolly hard), [Lisp](lisp.md) (non-traditional), [Prolog](prolog.md) (lol) and similar languages -- you may explore these later. Whichever language you pick for the love of god **avoid [OOP](oop.md)** -- no matter what anyone tells you, when you see a tutorial that uses "classes"/"objects" just move on, learn normal [imperative](imperative.md) programming. OOP is a huge pile of shit meme that you will learn anyway later (because everyone writes it nowadays) so that you see why it's shit and why you shouldn't use it.
**Which programming language to start with?** This is the big question. Though languages such as [Python](python.md) or [JavaScript](javascript.md) are objectively really REALLY bad, they are nowadays possibly the easiest way to get into programming -- at least the "mainstream" kind of -- so you may want to just pick one of these two, knowing you'll abandon it later to learn a true language such as [C](c.md) or [Forth](forth.md) (and knowing the bad language will still serve you in the [future](future.md) in some ways, it's not a wasted time). Can you start with C right away? It's probably not impossible for a prodigy but it will be VERY hard and you'll most likely end up failing, overwhelmed, frustrated and never returning to programming again. In *How To Become A Hacker* [ESR](esr.md) actually recommends to learn C, [Lisp](lisp.md) or [Go](golang.md) as the first language, but that recommendation comes to aspiring [hackers](hacking.md), i.e. the most talented and ambitious programmers, so think about whether you fit in this category. Absolutely do NOT even consider [C#](c_sharp.md) (shit, unusable), [Java](java.md) (shit, slow, bloated, unusable), [C++](cpp.md) (like C but shit and more complicated), [Haskell](haskell.md) (not bad but non-traditional, hard), [Rust](rust.md) (shit, bad design, unusable), [Prolog](prolog.md) (lol) and similar languages -- you may explore some of them later tho (the weird ones, not the bad ones). Whichever language you pick for the love of god **avoid [OOP](oop.md)** -- no matter what anyone tells you, when you see a tutorial that uses "classes"/"objects" just move on, learn normal [imperative](imperative.md) programming. OOP is a huge pile of shit meme that you will learn anyway later (because everyone writes it nowadays) so that you see why it's shit and why you shouldn't use it. Also don't let them sell you any kind of new shiny [paradigm](paradigm.md) that's currently trending on [TikTok](tiktok.md) -- learn IMPERATIVE PROGRAMMING and cover your ears when someone talks about anything else.
{ I really started programming in [Pascal](pascal.md) at school, it was actually a good language as it worked very similarly to C and the transition later wasn't that hard, but nowadays learning Pascal doesn't make much sense anymore. ~drummyfish }

View file

@ -28,7 +28,5 @@ Also let it be said that everyone has to find his own way of doing projects, it'
- **Milestones and psychological mini rewards are nice to keep you going**. It's nice to split the project into some milestones so that you see your "progress", it's very good if each milestone adds something visible, something you can "touch" -- for example with a game just the moment when you become able to physically move through the level always feels very rewarding, even if you've done it many times before, it's always a bit surprising what joy a simple feature can bring. Exploit this to increase joy of making your art.
- **Don't expect or aim for any reward other than the finished project**, don't expect/chase [money](money.md), fame, gratitude, don't expect that anyone will notice or thank you for the project. You are making it only because you want something that doesn't yet exist to exist and that's the only reward you can and should ever expect. Firstly this makes your project [selfless](selflessness.md), secondly it makes it pure, non-corruptable, only dedicated to its goal and nothing else, thirdly it spares you suffering from failed expectations.
- **When you're hard stuck, go away from it for a (possibly long) while.** As they say before making decisions: "sleep on it" (maybe even many times) -- there's something about letting your mind rest for a while that makes your subconsciousness solve things, or at least make you comprehend the issue better, see it from a different angle. Therefore when stuck, go do something else -- this is also why it's preferable to have several projects, but generally it's good to just take a break and do something meditative like going for a walk, making something out of wood, doing some sport, sleeping, listening to music and so on. Stop trying to solve the issue you had and just relax for a few days, maybe weeks. It is quite possible inspiration will come from somewhere, fresh air will help you think and maybe a solution will occur to you during this time [spontaneously](zen.md), but even if it doesn't, when you come back to the project you'll be very fresh, rested, your thoughts will be sorted, unimportant stuff filtered out, it's like you've got a different man on the task who will help the desperate past self. Sometimes you get back and immediately spot a simple and elegant solution. Really, this works like [magic](magic.md).
- **Stop talking to everyone.** If you want to do something, you have to quit all social media, destroy your cellphone, uninstall all chatting programs etc. In times of breaks you may turn them on again, but if you're trying to do something while there are people around, you won't do anything, it's too much of a distraction. Basically put yourself in a situation when you're stranded on a desert island and there is nothing else to do save for your project, otherwise you'll keep constantly talking to people or at least checking what they're talking about and that's going to constantly interrupt your thinking.
- ...

File diff suppressed because it is too large Load diff

View file

@ -1,16 +1,17 @@
# Shader
Shader is a program running on the [graphics processing unit](gpu.md) (GPU), typically in many parallel instances as to utilize the GPU's highly parallel nature. As such they are simple to mid complexity programs. The word *shader* is also used more loosely to stand for any specific effect, material or look in 3D graphics (e.g. [games](games.md)), as shaders are usually the means of achieving such effects.
Shader is a computer [program](program.md) running on the [graphics processing unit](gpu.md) (GPU), typically in many parallel instances so as to utilize the GPU's highly parallel nature and so achieve very high processing speed. As such shaders are simple to mid complexity programs. There are different types of shaders based on what kind of data they process -- most notable are probably fragment (also pixel) shaders that process [pixels](pixel.md) which then end up on the screen -- without explicitly mentioning what kind of shader we are talking about it is usually assumed we mean fragment shaders. The word *shader* is also used more loosely as a synonym for a special visual effect or material look in [3D graphics](3d_rendering.md) (e.g. [games](games.md)), because shaders are usually the means of achieving such effects.
Shaders are normally written in a special **shading language** such as [GLSL](glsl.md) in the [OpenGL](opengl.md) [API](api.md), [HLSL](hlsl.md) ([proprietary](proprietary.md)) in [Direct3D](d3d.md) API or the Metal shading language ([proprietary](proprietary.md)) in [Metal](metal.md) API. These languages are often similar to [C](c.md) with some additions (e.g. vector and matrix data types) and simplifications (e.g. no function [recursion](recursion.md)). High level [frameworks](framework.md) like [Blender](blender.md) many times offer [visual programming](visual_programming.md) (point-n-click) of shaders with graph/node editors.
Shaders are normally written in a special **shading language** such as [GLSL](glsl.md) in the [OpenGL](opengl.md) [API](api.md), [HLSL](hlsl.md) ([proprietary](proprietary.md)) in [Direct3D](d3d.md) API or the Metal shading language ([proprietary](proprietary.md)) in [Metal](metal.md) API. These languages are often similar to [C](c.md) with some additions (e.g. vector and matrix data types) and simplifications (e.g. no function [recursion](recursion.md) or dynamic memory allocation). High level [frameworks](framework.md) like [Blender](blender.md) many times offer [visual programming](visual_programming.md) (point-n-click) of shaders with graph/node editors.
Initially (basically early 2000s) shaders were used only for graphics, i.e. to transform 3D vertices, draw triangles and compute pixel colors. Later on as GPUs became more general purpose ([GPGPU](gpgpu.md)), flexibility was added to shaders that allowed to solve more problems with the GPU and eventually general *compute* shaders appeared (OpenGL added them in version 3.3 in 2010).
To put shaders in the context, the flow of data is this: a [CPU](cpu.md) uploads some data (3D models, textures, ...) to the GPU and then issues a draw command -- this makes the GPU start its **[pipeline](pipeline.md)** consisting of different **stages**, e.g. the vertices of 3D models are transformed to screens space (the vertex stage), then triangles are generated and rasterized (the shading stage) and the data is output (on screen, to a buffer etc.). Some of these stages are programmable and so they have their own type of a shader. The details of the pipeline differ from API to API, but in general, depending on the type of data the shader processes (the stage), we talk about:
- **vertex shaders**: Perform per-vertex computations on 3D models, typically their transformation from their world position to the position in the camera and screen space.
- **fragment/pixel shaders**: Compute the final color of each pixel (sometimes called more generally *fragments*), i.e. work per-pixel. A typical use is to perform [texturing](texture.md) and amount of reflected light (lighting model).
- **fragment/pixel shaders**: Compute the final color of each pixel (sometimes called more generally *fragments*), i.e. work per-pixel. A typical use is to perform [texturing](texture.md) and amount/color of reflected light (lighting model).
- **geometry shaders**: Advanced stage, serves to modify the geometry of 3D models (these shaders can, unlike vertex shaders, generate of discard vertices).
- **tesselation shaders**: Advanced stage, serves for subdividing primitives to create smoother geometry.
- **compute shaders**: Perform general computations, used e.g. for computing physics simulations, [AI](ai.md) etc.
- **[ray tracing](ray_tracing.md) shaders** and other specific types
- ...

View file

@ -17,7 +17,7 @@ Notable Temple OS features and programs are:
In his video blogs Terry talked about how technology became spoiled and that TempleOS is supposed to be [simple](minimalism.md) and [fun](fun.md). For this and other reasons the OS is limited in many way, for example:
- no networking
- Only runs on [x64](x64.md).
- Only runs on [x86](x86.md).
- Only runs in 640x480 16 color display mode.
- single audio voice
- ring-0 only

2
uxn.md
View file

@ -2,7 +2,7 @@
{ WIP, researching this etcetc. ~drummyfish }
Uxn is a [minimalist](minimalism.md) [self hosted](self_hosting.md) [stack](stack.md)-based [virtual machine](virtual_machine.md) 8bit/16bit [computer](computer.md) aiming for great [simplicity](simplicity.md) and [portability](portability.md). It is quite nice and impressive, having its own [instruction set](isa.md), [assembly](assembly.md) language, many implementations and many programs written for it already (e.g. [Left](left.md) text editor, Noodle drawing tool etc.); it was made by the author of [xxiivv](xxiivv.md) wiki (some weird [narcissist](egoism.md) self proclaimed artist that's sailing the seas or something). From the minimalist point of view uxn really seems to be going in the right direction, it is inspired by old computers such as [NES](nes.md) and [C64](c64.md), practicing real minimalism (not just [pseudominimalism](pseudominimalism.md) or just "lightweight minimalism") -- that's pretty awesome -- however its presentation is shit and while there are many [free as in freedom](free_software.md) implementations of uxn, official supplemental material to uxn (on the [xxiivv](xxiivv.md) wiki), such as its specification, is **[proprietary](proprietary.md)** ([NC](nc.md)) and therefore should be avoided and boycotted.
Uxn is a [minimalist](minimalism.md) [self hosted](self_hosting.md) [stack](stack.md)-based [virtual machine](virtual_machine.md) 8bit/16bit [computer](computer.md) aiming for great [simplicity](simplicity.md) and [portability](portability.md). It is quite nice and impressive, having its own [instruction set](isa.md), [assembly](assembly.md) language, many implementations and many programs written for it already (e.g. [Left](left.md) text editor, Noodle drawing tool etc.); it was made by the author of [xxiivv](xxiivv.md) wiki (some weird [narcissist](egoism.md) self proclaimed artist that's sailing the seas or something). From the minimalist point of view uxn really seems to be going in the right direction, it is inspired by old computers such as [NES](nes.md) and [C64](c64.md), practicing real minimalism (not just [pseudominimalism](pseudominimalism.md) or just "lightweight minimalism") -- that's pretty awesome -- however its presentation is shit and while there are many [free as in freedom](free_software.md) implementations of uxn, official supplemental material to uxn (on the [xxiivv](xxiivv.md) wiki), such as its specification, is **[proprietary](proprietary.md)** ([NC](nc.md)).
Uxn is similar to other projects such as [IBNIZ](ibniz.md), and can be compared to some of [our](lrs.md) projects as well, for example [SAF](saf.md), but mainly [comun](comun.md) -- the goals of uxn and comun may be seen as significantly overlapping, aiming to create a minimalist, completely independent from-ground-up computing "stack", an extremely portable platform for minimalist programs, and they do so in a similar way (both are e.g. stack based, inspired by [Forth](forth.md)). **To quickly compare uxn and comun**: comun is more of a pure programming [language](language.md) focusing only on expressing algorithms without talking about [I/O](io.md) or instruction sets, uxn on the other hand really is a [computer](computer.md) (even if initially only virtual), one that comes with its own instruction set, language and protocols for communication with peripheral devices, though the computer is purposefully made so that it can be implemented as a virtual machine running on other computers. Comun is a low level language but higher level than assembly (having e.g. control structures and a concept of "native integer" type), usually compiling to [bytecode](bytecode.md), while uxn is programmed directly in assembly and tied to its virtual machine's architecture and specifications. Comun is trying to stay more abstract, hardware independent and be more close to [math](math.md) notation, it doesn't assume any native integer size or working memory size, it doesn't use any English keywords, it assumes as little as possible about its platform -- it is trying to be a "better, simpler [C](c.md)". Uxn is more of a "new NES", a "practically useful [fantasy console](fantasy_console.md)", an idealization and improvement of old computers, it has a hardcoded amount of memory, specified integer size (8 or 16 bit), uses assembly with English mnemonics just like the old computers etc. As for complexity, uxn is probably a bit simpler, or rather allowing smaller implementations than those of full comun, though simplified versions of comun (such as minicomun) may possibly be as simple or simpler than uxn and specification of full comun (a possible measure of complexity) is extremely small and will probably compare to or beat uxn. Uxn only has 32 instructions and its self hosted implementation is around 2000 bytes big, while current comun's bytecode has around 80 instructions and self hosted compiler will probably have a few thousand lines of code (as it really is a library, compiler, interpreter and simple optimizer, as opposed to mere assembler). Comun is a completely [selfless](selfless.md), absolutely [public domain](public_domain.md) [free software](free_software.md), while uxn has a selfish proprietary ([NC](nc.md)) specification.

File diff suppressed because one or more lines are too long

View file

@ -3,9 +3,9 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 591
- number of commits: 871
- total size of all texts in bytes: 4266817
- total number of lines of article texts: 32537
- number of commits: 872
- total size of all texts in bytes: 4273180
- total number of lines of article texts: 32556
- number of script lines: 291
- occurrences of the word "person": 7
- occurrences of the word "nigger": 91
@ -28,51 +28,51 @@ longest articles:
- [internet](internet.md): 36K
- [woman](woman.md): 32K
- [history](history.md): 32K
- [main](main.md): 32K
- [random_page](random_page.md): 32K
- [game](game.md): 32K
- [main](main.md): 32K
- [pseudorandomness](pseudorandomness.md): 32K
top 50 5+ letter words:
- which (2408)
- there (1847)
- people (1642)
- example (1433)
- other (1310)
- which (2413)
- there (1848)
- people (1648)
- example (1435)
- other (1313)
- number (1230)
- about (1148)
- software (1144)
- about (1151)
- software (1143)
- program (971)
- because (896)
- their (885)
- would (881)
- called (824)
- language (820)
- being (806)
- things (802)
- something (802)
- because (898)
- their (887)
- would (883)
- called (826)
- language (821)
- being (807)
- things (804)
- something (803)
- numbers (796)
- simple (765)
- computer (751)
- without (714)
- without (717)
- programming (710)
- function (701)
- these (683)
- different (672)
- however (663)
- system (639)
- world (620)
- system (644)
- world (622)
- doesn (615)
- should (612)
- while (591)
- while (592)
- point (587)
- society (579)
- games (578)
- drummyfish (557)
- simply (556)
- drummyfish (555)
- using (549)
- though (547)
- though (548)
- still (543)
- possible (536)
- memory (522)
@ -80,15 +80,42 @@ top 50 5+ letter words:
- https (510)
- course (504)
- value (503)
- technology (496)
- always (488)
- basically (482)
- technology (497)
- always (490)
- basically (484)
- really (475)
- first (468)
- first (469)
latest changes:
```
Date: Thu Aug 29 16:19:22 2024 +0200
4chan.md
ancap.md
copyright.md
democracy.md
diogenes.md
doom.md
dramatica.md
hero_culture.md
information.md
interesting.md
iq.md
lgbt.md
lmao.md
main.md
modern.md
often_confused.md
pedophilia.md
people.md
random_page.md
reddit.md
rms.md
soyence.md
ted_kaczynski.md
wiki_pages.md
wiki_stats.md
woman.md
Date: Tue Aug 27 22:53:54 2024 +0200
acronym.md
attribution.md
@ -100,37 +127,6 @@ Date: Tue Aug 27 22:53:54 2024 +0200
chess.md
computer.md
diogenes.md
doom.md
exercises.md
fail_ab.md
float.md
game.md
gay.md
git.md
hacking.md
how_to.md
infinity.md
internet.md
interpolation.md
leading_the_pig_to_the_slaughterhouse.md
left_right.md
lmao.md
monad.md
noise.md
people.md
prime.md
programming_language.md
random_page.md
raylib.md
reactionary_software.md
reddit.md
regex.md
ronja.md
soyence.md
stereotype.md
sw_rendering.md
terry_davis.md
update_culture.md
```
most wanted pages:
@ -159,39 +155,39 @@ most wanted pages:
most popular and lonely pages:
- [lrs](lrs.md) (296)
- [capitalism](capitalism.md) (242)
- [capitalism](capitalism.md) (244)
- [c](c.md) (221)
- [bloat](bloat.md) (214)
- [free_software](free_software.md) (177)
- [game](game.md) (142)
- [suckless](suckless.md) (140)
- [proprietary](proprietary.md) (125)
- [minimalism](minimalism.md) (99)
- [minimalism](minimalism.md) (100)
- [computer](computer.md) (98)
- [kiss](kiss.md) (97)
- [modern](modern.md) (95)
- [linux](linux.md) (92)
- [gnu](gnu.md) (91)
- [programming](programming.md) (88)
- [fun](fun.md) (88)
- [fun](fun.md) (91)
- [programming](programming.md) (89)
- [censorship](censorship.md) (87)
- [math](math.md) (84)
- [math](math.md) (85)
- [free_culture](free_culture.md) (82)
- [fight_culture](fight_culture.md) (82)
- [less_retarded_society](less_retarded_society.md) (81)
- [fight_culture](fight_culture.md) (81)
- [bullshit](bullshit.md) (81)
- [shit](shit.md) (80)
- [hacking](hacking.md) (80)
- [art](art.md) (78)
- [shit](shit.md) (77)
- [public_domain](public_domain.md) (76)
- [corporation](corporation.md) (76)
- [programming_language](programming_language.md) (75)
- [foss](foss.md) (75)
- [corporation](corporation.md) (74)
- [chess](chess.md) (72)
- [internet](internet.md) (72)
- ...
- [atan](atan.md) (5)
- [anal_bead](anal_bead.md) (5)
- [adam_smith](adam_smith.md) (5)
- [aaron_swartz](aaron_swartz.md) (5)
- [zuckerberg](zuckerberg.md) (4)
- [wiki_pages](wiki_pages.md) (4)
- [trump](trump.md) (4)

View file

@ -50,3 +50,7 @@ Some people still decide to use it.
TODO
All are shit.
## See Also
- [botnet](botnet.md)

View file

@ -6,11 +6,11 @@ XXIIVV is a [proprietary](proprietary.md) [soynet](soynet.md) snob website and p
{ Holy shit his webring is toxic AF, do not research it. Basically a one huge gay nazi wannabe "artist" circlejerk, it's like a small village worth of the kind of [furry](furry.md) psychopaths who like to draw cute cartoon animals while also advocating slow torture and castration of people who dislike them. ~drummyfish }
Firstly let's see about the letdowns: the site is [proprietary](proprietary.md) and **he licenses his "art" and some of his code under the proprietary [CC-BY-NC-SA](cc_by_nc_sa.md)**, big RETARD ALERT. This means he's a [capitalist](capitalist.md) [open soars](open_source.md) fanboy trying to monopolize art by keeping exclusive "commercial intellectual property rights" (as if his amateur stick figure level "art" had any commercial value lol). At least some of his code is [MIT](mit.md), but he also makes fucking **[PROPRIETARY](proprietary.md) PAID software** (e.g. Verreciel), then he somehow tries to brainwash the readers to believe he is "against capitalism" or what? :'D (Or is he not? I dunno. Definitely seems to be riding the [eco](eco.md) wave.) The guy also seems **[egoistic](egoism.md) as fuck**, invents weird hipster names and "personal pronouns", has some ugly "body modifications", wears cringe rabbit costumes and tries to write in a super cringe pompous/cryptic/poetic tryhard style probably in an attempt to appear smart while just making a fool of himself and, in addition, making it shithard to make any sense of his texts -- truly his tech writings are literal torture to read. The only thing he's missing is a fedora.
Firstly let's see about the letdowns: the site is [proprietary](proprietary.md) and **he licenses his "art" and some of his code under the proprietary [CC-BY-NC-SA](cc_by_nc_sa.md)**, big RETARD ALERT. This means he's a [capitalist](capitalism.md) [open soars](open_source.md) fanboy trying to monopolize art by keeping exclusive "commercial intellectual property rights" (as if his amateur stick figure level "art" had any commercial value lol). At least some of his code is [MIT](mit.md), but he also makes fucking **[PROPRIETARY](proprietary.md) PAID software** (e.g. Verreciel), then he somehow tries to brainwash the readers to believe he is "against capitalism" or what? :'D (Or is he not? I dunno. Definitely seems to be riding the [eco](eco.md) wave.) The guy also seems **[egoistic](egoism.md) as fuck**, invents weird hipster names and "personal pronouns", has some ugly "body modifications", wears cringe rabbit costumes and tries to write in a super cringe pompous/cryptic/poetic tryhard style probably in an attempt to appear smart while just making a fool of himself and, in addition, making it shithard to make any sense of his texts -- truly his tech writings are literal torture to read. The only thing he's missing is a fedora.
There are also nice things though, a few of them being:
- The guy is creating extremely minimalist, small tech from-scratch technology that's worthy of attention. Some of it includes:
- The guy is creating extremely minimalist, small from-scratch technology that's worthy of attention. Some of it includes:
- [uxn](uxn.md): Simple (~100 [LOC](loc.md) of [C](c.md)) [virtual machine](virtual_machine.md), similar to a "[fantasy console](fantasy_console.md)" but intended more for [portability](portability.md). This also comes with an assembly language called [tal](tal.md).
- [lietal](lietal.md): Simple [artificial language](conlang.md).
- The wiki writes on pretty [interesting](interesting.md) topics, many of which overlap with [our](lrs.md) topics of interest. For example [pen and paper computing](pen_and_paper.md) that includes [games](game.md).