master
Miloslav Ciz 5 months ago
parent b35242f273
commit 078a02731b

@ -46,6 +46,7 @@ The standards of C99 and older are considered pretty [future-proof](future_proof
- [clang](clang.md): Another big bloated compiler, kind of competes with gcc, is similarly good at optimization etc. Uses [LLVM](llvm.md) intermediate representation.
- [tcc](tcc.md): Tiny C compiler, [suckless](suckless.md), orders of magnitude smaller (currently around 25 KLOC) and simpler than gcc and clang, cannot optimize nearly as well as the big compilers so the generated executables can be a bit slower and bigger, however besides its internal simplicity there are many advantages, mainly e.g. fast compilation (claims to be 9 times faster than gcc) and small tcc executable (about 100 kB). Seems to only support x86.
- [scc](scc.md): Another small/suckless C compiler, currently about 30 KLOC.
- [DuskCC](duskcc.md): [Dusk OS](duskos.md) C compiler written in [Forth](forth.md), focused on extreme simplicity, probably won't adhere to standards completely.
- [8c](8c.md), [8cc](8cc.md)
- ...

@ -0,0 +1,29 @@
# Dusk OS
Dusk OS is a work in progress non-[Unix](unix.md) extremely [minimalist](minimalism.md) 32 bit [free as in freedom](free_software.md) [operating system](operating_system.md) whose primary purpose is to be helpful during societal [collapse](collapse.md) but which will still likely be very useful even before it happens. It is made mainly by [Virgil Dupras](dupras.md), the developer of [Collapse OS](collapseos.md), as a bit "bigger" version of Collapse OS, one that's intended for the first stage of societal collapse and will be more "powerful" and comfortable to use for the price of increased complexity (while Collapse OS is simpler and meant for the use during later stages). But don't be fooled, Dusk OS is still light year ahead in simplicity than the most minimal [GNU](gnu.md)/[Linux](linux.md) distro you can imagine; by this extremely minimalist design Dusk OS is very close to the ideals of our [LRS](lrs.md), it is written in [Forth](forth.md) but also additionally (unlike Collapse OS) includes a so called "Almost [C](c.md)" compiler allowing [ports](port.md) of already existing programs, e.g. Unix [command line](cli.md) utilities. It is also available under [CC0](cc0.md) [public domain](public_domain.md) just as official LRS projects, that's simply unreal.
The project has a private mailing list. Apparently there is talk about the system being useful even before the collapse and so it's even considering things like [networking](network.md) support etc. -- as [capitalism](capitalism.md) unleashes hell on [Earth](earth.md), any simple computer capable of working on its own and allowing the user complete control will be tremendously useful, even if it's just a programmable calculator. Once [GNU](gnu.md)/[Linux](linux.md) and [BSD](bsd.md)s sink completely (very soon), this may be where we find the safe haven.
The only bad thing about the project at the moment seems to be the presence of some [pseudoleftists](pseudoleft.md) around the project, threatening political takeover etcetc. At the moment there's thankfully no [code of censorship](coc.md) :-) If the project gets more popular it will be forced. Hopefully [forks](fork.md) will come if anything goes wrong.
{ I'm not 100% sure about everything that will follow as I'm still studying this project, please forgive mistakes, double check claims. ~drummyfish }
It really does look amazing and achieves some greatly awesome things, for example it's (as far as it seems) completely [self-hosted](self-hosting.md) from the ground up, containing no binary blobs (at least for the bootstrap it seems, driver state unchecked), being able to completely bootstrap itself from some 1000 lines of assembly, however it still keeps [portability](portability.md) by using a kind of simple abstract [assembly](assembly.md) called [HAL](hal.md), so it's not tied to any CPU architecture like most other simple OSes. The "user mode" system can also be compiled as a normal program on current operating systems, allowing to make so called Dusk packages, i.e. automatically export any Dusk OS program as a basically native program for current computers. You don't even need any virtual machine or emulator to try out the OS, you just download it, type `make` and run it as a normal program. The whole system is also very fast. There's some black [magic](magic.md) going on. Also the project documentation is very nice. It also seems they don't care about [security](security.md) and [safety](safety.md) at all, WHICH IS EXTREMELY GOOD, there is no place for such [bullshit](bullshit.md) in a truly minimalist project.
Let's sum up some of the interesting features of the system:
- "aggressive" simplicity, simplicity is above speed (but speed is still great and high among priorities)
- written in [Forth](forth.md), offering simplified [C](c.md) compiler as its main feature
- [portable](portability.md), using simple abstract [assembly](assembly.md) to run on different architectures
- no [concurrency](concurrency.md), linear computation only, this will probably imply no [multitasking](multitasking.md)
- no [virtual memory](virtual_memory.md)
- preferring static memory allocation
- making use of global states/variables (going against mainstream capitalist "best practices")
- 32 bit system, maximum 4 GB of memory
- no user friendliness, [hacker](hacking.md) "operator" assumed instead of a layman user
- no "security", "safety", "privacy", user accounts etc.
- graphics: primarily no [GUI](gui.md), simple graphics capabilities will be present, direct access to screen pixels (through so called "grid" interface)
- some nice text [shell](shell.md) will be made
- sound: ???
- networking: being considered
- NOT a Unix-like but will naturally be aligned with many of its concepts as per simplicity

@ -1,6 +1,6 @@
# Fixed Point
Fixed point arithmetic is a simple and often [good enough](good_enough.md) method of computer representation of [fractional](rational_number.md) numbers (i.e. numbers with higher precision than [integers](integer.md), e.g. 4.03), as opposed to [floating point](float.md) which is a more complicated way of doing this which in most cases we consider a worse, [bloated](bloat.md) alternative. Probably in 99% cases when you think you need floating point, fixed point will do just fine.
Fixed point arithmetic is a simple and often [good enough](good_enough.md) method of computer representation of [fractional](rational_number.md) numbers (i.e. numbers with higher precision than [integers](integer.md), e.g. 4.03), as opposed to [floating point](float.md) which is a more complicated way of doing this which in most cases we consider a worse, [bloated](bloat.md) alternative. Probably in 99% cases when you think you need floating point, fixed point will do just fine. Fixed point arithmetic is not to be confused with fixed point of a function in mathematics, a completely unrelated term.
Fixed point has at least these advantages over floating point:

@ -1,6 +1,6 @@
# Forth
Forth ("fourth generation" shortened to four characters due to technical limitations) is a very good [minimalist](minimalism.md) [stack](stack.md)-based untyped [programming language](programming_language.md) that uses [postfix](notation.md) (reverse Polish) notation. Its vanilla form is yet much simpler than [C](c.md), it's very [elegant](elegant.md) and its compiler/interpreter can be made very easily, giving it high practical freedom (i.e. not being practically controlled by any central organization); it is used e.g. in space technology 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) (fun fact: there even exist computers directly running Forth in hardware). Forth was the main influence for [Comun](comun.md), the [LRS](lrs.md) programming language. In its minimalism Forth competes a bit with [Lisp](lisp.md).
Forth ("fourth generation" shortened to four characters due to technical limitations) is a very good [minimalist](minimalism.md) [stack](stack.md)-based untyped [programming language](programming_language.md) that uses [postfix](notation.md) (reverse Polish) notation. Its vanilla form is yet much simpler than [C](c.md), it's very [elegant](elegant.md) and its compiler/interpreter can be made very easily, giving it high practical freedom (i.e. not being practically controlled by any central organization); it is used e.g. in space technology 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) (fun fact: there even exist computers directly running Forth in hardware). Forth was 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 its minimalism Forth competes a bit with [Lisp](lisp.md).
{ It's kinda like usable [brainfuck](brainfuck.md). Also there used to be a nice Forth wiki at wiki.forthfreak.net, now it has to be accessed via archive as it's dead. ~drummyfish }

@ -33,11 +33,12 @@ Here is a list of people notable in technology or in other ways related to [LRS]
- **[Óscar Toledo G.](toledo.md)**: programmer of tiny programs and [games](game.md) (e.g. the smallest [chess](chess.md) program), sadly [proprietary](proprietary.md) [winfag](windows.md)
- **[Richard Stallman](rmd.md)**: inventor of [free software](free_software.md) and [copyleft](copyleft.md), founder of [GNU](gnu.md) and [FSF](fsf.md), hacker, also created [emacs](emacs.md)
- **[Rob Pike](rob_pike.md)**: oldschool hacker involved in [Unix](unix.md)
- **[Roy Schestowitz](roy_schestowitz)**: PhD journalist, running [Techrights](techrights.md), revealing corruption in technology.
- **[Roy Schestowitz](roy_schestowitz)**: PhD journalist, running [Techrights](techrights.md), revealing corruption in technology
- **[Steve Jobs](steve_jobs.md)**: founder and CEO of [Apple](apple.md), huge retard and dickhead
- **[Ted Kaczynski](ted_kaczynski.md)**: AKA the Unabomber, mathematician, primitivist and murderer who pointed out the dangers of modern technology
- **[Terry Davis](terry_davis.md)**: deceased schizophrenic genius, creator of [Temple OS](temple_os.md), became a tech [meme](meme.md)
- **[Tom Murphy VII (Tom7)](tom7.md)**: researcher, famous [SIGBOVIK](sigbovik.md) contributor and YouTuber
- **[Uriel](uriel.md)**: deceased member of the [suckless](suckless.md) community, philosophical advisor
- **[Virgil Dupras](dupras.md)**: creator of [Collapse OS](collapseos.md) and [Dusk OS](duskos.md)
- **[viznut](viznut.md)** (Ville-Matias Heikkilä): creator or [countercomplex](countercomplex.md), minimalist programmer, inventor of [bytebeat](bytebeat.md), hacker, [collapse](collapse.md) "[prepper](prepping.md)"
- ...

@ -1,6 +1,8 @@
# Quine
Quine is a nonempty [program](program.md) which prints its own source code. It takes no input, just prints out the source code when run (without [cheating](cheating.md) such as reading the source code file). Quine is basically a self-replicating program, just as [in real world](irl.md) we may construct robots capable of creating copies of themselves (afterall we humans are such robots). The name *quine* refers to the philosopher Willard Quine and his paradox that shows a structure similar to self-replicating programs. Quine is one of the standard/[fun](fun.md)/[interesting](interesting.md) programs such as [hello world](hello_world.md), [99 bottles of beer](99_bottles.md) or [fizzbuzz](fizzbuzz.md).
Quine is a nonempty [program](program.md) which prints its own source code. It takes no input, just prints out the [source code](source_code.md) when run (without [cheating](cheating.md) such as reading the source code file). Quine is basically a [self-replicating](self_replication.md) program, just as [in real world](irl.md) we may construct robots capable of creating copies of themselves (afterall we humans are such robots). The name *quine* refers to the philosopher Willard Quine and his paradox that shows a structure similar to self-replicating programs. Quine is one of the standard/[fun](fun.md)/[interesting](interesting.md) programs such as [hello world](hello_world.md), [99 bottles of beer](99_bottles.md) or [fizzbuzz](fizzbuzz.md).
From [mathematical](math.md) point of view quine is a fixed point of a [function](function.md) (not to be confused with [fixed_point arithmetic](fixed_point.md)) represented by the [programming language](programming_language.md). I.e. if we see the programming language as a function f(x), where *x* is source code and the function's output is the program's output, quine is such *x* that *f(x) = x*.
Quine can be written in any [Turing complete](turing_completeness.md) [language](programming_language.md) (according to [Wikipedia](wikipedia.md)), the challenge is in the [self reference](self_reference.md) -- normally we cannot just single-line print a string literal containing the source because that string literal would have to contain itself, making it [infinite](infinity.md) in length. The idea commonly used to solve this problem is following:

@ -1,6 +1,6 @@
# Square Root
Square root (sometimes shortened to *sqrt*) of number *a* is such a number *b* that *b^2 = a*, for example 3 is a square root of 9 because 3^2 = 9. Finding square root is one of the most basic and important operations in [math](math.md) and [programming](programming.md), e.g. for computing [distances](distance.md), solving [quadratic equations](quadratic_equation.md) etc. Square root is a special case of finding Nth [root](root.md) of a number for N = 2. Square root of a number doesn't have to be a whole number; in fact if the square isn't a whole number, it is always an [irrational number](irrational_number.md) (i.e. it can't be expressed as a fraction of two integers, for example square root of [two](two.md) is approximately 1.414...); and it doesn't even have to be a real number (e.g. square root of -1 is [i](i.md)). Strictly speaking there may exist multiple square roots of a number, for example both 5 and -5 are square roots of 25 -- the positive square root is called **principal square root**; principal square root of *x* is the same number we get when we raise *x* to 1/2, and this is what we are usually interested in -- from now on by *square root* we will implicitly mean *principal square root*. Programmers write *square root of x* as `sqrt(x)` (which should give the same result as raising to 1/2, i.e. `pow(x,0.5)`), mathematicians write it as:
Square root (sometimes shortened to *sqrt*) of [number](number.md) *a* is such a number *b* that *b^2 = a*, for example 3 is a square root of 9 because 3^2 = 9. Finding square root is one of the most basic and important operations in [math](math.md) and [programming](programming.md), e.g. for computing [distances](distance.md), solving [quadratic equations](quadratic_equation.md) etc. Square root is a special case of finding Nth [root](root.md) of a number for N = 2. Square root of a number doesn't have to be a whole number; in fact if the square isn't a whole number, it is always an [irrational number](irrational_number.md) (i.e. it can't be expressed as a fraction of two integers, for example square root of [two](two.md) is approximately 1.414...); and it doesn't even have to be a [real number](real_number.md) (e.g. square root of -1 is [i](i.md)). Strictly speaking there may exist multiple square roots of a number, for example both 5 and -5 are square roots of 25 -- the positive square root is called **principal square root**; principal square root of *x* is the same number we get when we raise *x* to 1/2, and this is what we are usually interested in -- from now on by *square root* we will implicitly mean *principal square root*. Programmers write *square root of x* as `sqrt(x)` (which should give the same result as raising to 1/2, i.e. `pow(x,0.5)`), mathematicians write it as:
```
_ 1/2
@ -13,9 +13,33 @@ TODO
TODO
Within desired precision square root can be relatively quickly computed iteratively by [binary search](binary_search.md). Of course if we need extreme speed, we may use a [look up table](lut.md) with precomputed values.
If we need extreme speed, we may use a [look up table](lut.md) with precomputed values.
TODO: C code for binary search
Within desired precision square root can be relatively quickly computed iteratively by [binary search](binary_search.md). Here is a simple [C](c.md) function computing integer square root this way:
```
unsigned int sqrt(unsigned int x)
{
unsigned int l = 0, r = x / 2, m;
while (1)
{
if (r - l <= 1)
break;
m = (l + r) / 2;
if (m * m > x)
r = m;
else
l = m;
}
return (r * r <= x ? r : l) + (x == 1);
}
```
TODO: Heron's method
The following is a **non-iterative [approximation](approximation.md)** of integer square root in [C](c.md) that has acceptable accuracy to about 1 million (maximum error from 1000 to 1000000 is about 7%): { Painstakingly made by me. ~drummyfish }

@ -2,8 +2,8 @@
This is an auto-generated article holding stats about this wiki.
- number of articles: 528
- total size of all texts in bytes: 2634904
- number of articles: 529
- total size of all texts in bytes: 2639445
longest articles:
@ -17,12 +17,30 @@ longest articles:
32K 3d_rendering.md
32K game.md
28K procgen.md
24K compression.md
28K compression.md
```
latest changes:
```
Date: Tue Dec 26 14:46:41 2023 +0100
assembly.md
cache.md
cc0.md
compression.md
copyfree.md
cos.md
drummyfish.md
english.md
iq.md
lrs.md
operating_system.md
portability.md
privacy.md
smol_internet.md
soyence.md
triangle.md
wiki_stats.md
Date: Mon Dec 25 12:37:02 2023 +0100
democracy.md
iq.md
@ -38,19 +56,5 @@ capitalism.md
esolang.md
freedom.md
hash.md
history.md
less_retarded_society.md
linux.md
main.md
markov_chain.md
neural_network.md
wiki_stats.md
Date: Fri Dec 22 00:43:13 2023 +0100
blender.md
bytecode.md
c.md
forth.md
wiki_stats.md
Date: Thu Dec 21 12:04:09 2023 +0100
```

Loading…
Cancel
Save