This commit is contained in:
Miloslav Ciz 2021-11-20 12:49:21 -06:00
parent a5a9021fa6
commit 966c393636
5 changed files with 33 additions and 14 deletions

View file

@ -7,7 +7,7 @@ Using approximations however doesn't have to imply decrease in precision of the
Example of approximations:
- **Distances**: instead of expensive **Euclidean** distance (`sqrt(dx^2 + dy^2)`) we may use **Chebyshev** distance (`dx + dy`) or **Taxicab** distance (`max(dx,dy)`).
- **Engineering approximations**: e.g. **sin(x) = x** for "small" values of *x* or **pi = 3** (integer instead of float).
- **Engineering approximations** ("guesstimations"): e.g. **sin(x) = x** for "small" values of *x* or **pi = 3** (integer instead of float).
- **Physics engines**: complex triangle meshes are approximated with simple analytical shapes such as **spheres**, **cuboids** and **capsules** or at least **convex hulls** which are much easier and faster to deal with. They also approximate **relativistic** physics with **Newtonian**.
- **Real time graphics engines**, on the other hand, normally approximate all shapes with triangle meshes.
- **[Ray tracing](ray_tracing.md)** neglects indirect lighting. Computer graphics in general is about approximating the solution of the rendering equation.

29
c.md
View file

@ -4,30 +4,39 @@ C is a low-level, statically typed imperative compiled language, the go-to langu
C is usually not considered an easy language to learn because of its low level nature: it requires good understanding of how a computer actually works and doesn't prevent the programmer from shooting himself in the foot. Programmer is given full control (and therefore responsibility). There are things considered "tricky" which one must be aware of, such as undefined behavior of certain operators and raw pointers. This is what can discourage a lot of modern "coding monkeys" from choosing C, but it's also what inevitably allows such great performance -- undefined behavior allows the compiler to choose the most efficient implementation.
# History and Context
## History and Context
# Standards
## Standards
C is not a single language, there have been a few standards over the years since its inception in 1970s. The notable standards and versions are:
- K&R C: C as described by its inventors in the book *The C Programming Language*, before official standardization. This is kind of too ancient nowadays.
- C89/C90 (ANSI/ISO C): First fully standardized version, usable even today.
- C95: A minor update of the previous standard, adds wide character support.
- C99: Updated standard from the year 1999 striking a great balance between "modern" and "good old". This is a good version to use in LRS programs, but will be a little less supported than C89.
- C11: Updated standard from the year 2011. This one is too bloated and isn't worth using.
- C17/C18: Yet another update, yet more bloated and not worth using.
- **K&R C**: C as described by its inventors in the book *The C Programming Language*, before official standardization. This is kind of too ancient nowadays.
- **C89/C90 (ANSI/ISO C)**: First fully standardized version, usable even today.
- **C95**: A minor update of the previous standard, adds wide character support.
- **C99**: Updated standard from the year 1999 striking a great balance between "modern" and "good old". This is a good version to use in LRS programs, but will be a little less supported than C89.
- **C11**: Updated standard from the year 2011. This one is too [bloated](bloat.md) and isn't worth using.
- **C17/C18**: Yet another update, yet more bloated and not worth using.
LRS should use C99 or C89 as the newer versions are considered [bloat](bloat.md) and don't have such great support in compilers, making them less portable and therefore less free.
The standards of C99 and older are considered pretty [future-proof](future_proof.md) and using them will help your program be future-proof as well. This is to a high degree due to C having been established and tested better than any other language; it is one of the oldest languages and a majority of the most essential software is written in C, C compiler is one of the very first things a new hardware platform needs to implement, so C compilers will always be around, at least for historical reasons. C has also been very well designed in a relatively minimal fashion, before the advent of modern feature-creep and and bullshit such as [OOP](oop.md) which cripples almost all "modern" languages.
# Compilers
## Compilers
- gcc
- clang
- tcc
- scc
# Basics
## Standard Library
So the standard library (libc) is a subject of live debate because while its interface and behavior are given by the C standard, its implementation is a matter of each compiler; since the standard library is so commonly used, we should take great care in assuring it's extremely well written. As you probably guessed, the popular implementations ([glibc](glibc.md) et al) are [bloat](bloat.md). Better alternatives thankfully exist, such as:
- [musl](musl.md)
- [uclibc](uclibc.md)
- [not using](dependency.md) the standard library :)
## Basics
A simple program in C looks like e.g. like this:

View file

@ -1,3 +1,6 @@
# Coding
Coding means low quality attempt at [programming](programming.md), usually practiced by [soydevs](soydev.md) and barely qualified coding monkeys.
Coding nowadays means low quality attempt at [programming](programming.md), usually practiced by [soydevs](soydev.md) and barely qualified coding monkeys.
Traditionally it means encoding and decoding of information as in e.g. video coding -- this is the only non-gay meaning of the word

View file

@ -2,6 +2,8 @@
KISS (Keep It Simple, Stupid!) is a design philosophy that favors simplicity, solutions that are as as simple as possible to achieve given task, and no more. This comes from the fact that higher [complexity](complexity.md) comes with increasing negative effects such as cost of development, cost of [maintenance](maintenance.md), greater probability of bugs and security vulnerabilities. More about this in [minimalism](minimalism.md) article.
Apparently the term originated in the US Army plane engineering: the planes needed to be repairable by *stupid* soldiers with limited tools under field conditions.
Compared to [suckless](suckless.md), [unix philosophy](unix_philosophy.md) and [LRS](lrs.md), KISS is a more general term, it doesn't imply any specifics but rather the general overall idea of simplicity being an advantage ([less is more](less_is_more.md)).
[KISS Linux](kiss_linux.md) is an example of software developed under this philosophy.
[KISS Linux](kiss_linux.md) is an example of software developed under this philosophy and adapting the term itself.

View file

@ -1,3 +1,8 @@
# Science
*Not to be confused with [soyence](soyence.md)*.
*Not to be confused with [soyence](soyence.md)*.
Science means inference and organization of knowledge, in more strict sense this process has to be kept rational by obeying some specific rules. Sciences include [mathematics](math.md) (so called formal science), [physics](physics.md), biology and [computer science](computer_science.md). Science is not to be confused with:
- [Pseudoscience](pseudoscience.md) such as gender studies.
- [Soyence](soyence.md).