master
Miloslav Ciz 3 months ago
parent 91a4ce4727
commit 810a5262e4

@ -1,6 +1,6 @@
# Corporation
Corporation is basically a huge company that doesn't have a single owner but is rather managed by many shareholders. Corporations are one of the most powerful, dangerous and unethical entities that ever came into existence -- their power is growing, sometimes even beyond the power of states and their sole goal is to make as much profit as possible without any sense of morality. Existence of corporations is enabled by [capitalism](capitalism.md). Examples of corporations are [Micro$oft](microsoft.md), [Apple](apple.md), [Amazon](amazon.md), [Walmart](walmart.md), [Te$la](tesla.md), [McDonald$](mcdonalds.md), [Facebook](facebook.md) etc.
Corporation is basically a huge company that doesn't have a single owner but is rather managed by many shareholders. Corporations are one of the most powerful, dangerous and unethical entities that ever came into existence -- their power is growing, sometimes even beyond the power of states and their sole goal is to make as much profit as possible without any sense of morality. Existence of corporations is enabled by [capitalism](capitalism.md). Examples of corporations are [Micro$oft](microsoft.md), [Apple](apple.md), [Amazon](amazon.md), [Walmart](walmart.md), [Te$la](tesla.md), [McDonald$](mcdonalds.md), [Facebook](facebook.md) etc. Every [startup](startup.md) is an aspiring corporation, so never support any startup.
The most basic fact to know about corporations is that **100% of everything a corporation ever does is done 100% solely for maximizing its own benefit for any cost, with no other reason, with 0 morality and without any consideration of consequences**. If a corporation could make 1 cent by raping 1000000000 children and get away with it, it would do so immediately without any hesitation and any regret. This is very important to keep in mind. Now try to not get depressed at realization that corporations are those to whom we gave power and who are in almost absolute control of the world.

@ -70,7 +70,7 @@ Furthermore there many are other useful tools such as:
- **dynamic program analyzer**: A tool that will watch your program running and check for things like [memory leaks](memory_leak.md), access of unallocated memory, suspicious behavior, unsafe behavior, call of obsolete functions and many others. The most famous such tool is probably **[valgrind](valgrind.md)**, it's a good habit to just use valgrind from time to time to check our program.
- **[profiler](profiling.md)**: A kind of dynamic analyzer that focuses on statistical measuring of resource usage of your program, typically execution times of different functions, memory consumption or network usage. Basically it will watch your program run and then draw you graphs of which parts of your programs consume most resources. This usually helps [optimization](optimization.md) but can also serve to find bugs (you can spot where your memory starts leaking etc.). Some basic profiling can be done even without profiler, just inside your own program, but it can get tricky. One famous profiler is e.g. [gprof](gprof.md).
- **static source code analyzer**: Static analyzers look at the source code (or potentially even compiled binary) and try to find bugs/inefficiencies in it without running it, just by reasoning. Static analyzers often tell you about [undefined behavior](undefined_behavior.md), potential overflows, unused code, unreachable branches, unsatisfiable conditions, confusing formatting and so on. This complement the dynamic analysis. Some tools to do this are e.g. [cppcheck](cppcheck.md) and [splint](splint.md), though thanks to compilers performing a lot of static analysis themselves these seem not as widely used as dynamic analyzers nowadays.
- **[hex editor](hex_editor.md)**: Tool allowing you to mess with binary files, useful for any program that works with binary files.
- **[hex editor](hex_editor.md)**: Tool allowing you to mess with binary files, useful for any program that works with binary files. A simple hex viewer is e.g. `hexdump`.
- **[emulators](emulator.md), [virtual machines](vm.md), ...**: Running your program on different platform often reveals bugs -- while your program may [work perfectly fine](works_on_my_machine.md) on your computer, it may start crashing on another because that computer may have different integer size, [endianness](byte_sex.md), amount of RAM, timings, file system etcetc. Emulators and VMs allow you to test exactly this AND furthermore often allow easy inspection of the emulated machine's memory and so on.
- ...

@ -8,6 +8,7 @@ WORK IN PROGRESS
| ------------------------------------------ | -------------------------------------- |
| [anime](anime.md) | tranime |
| [Apple](apple.md) user | iToddler |
| [Asperger](autism.md) | assburger |
| average citizen | normie, normalfag, bloatoddler, NPC |
| [Blender](blender.md) | Blunder |
| [censorship](censorship.md) | censorshit |

@ -23,21 +23,22 @@ printf "# Wiki Files\n\nThis is an autogenerated page listing all pages.\n\n" >
firstFile=true
for f in *.md; do
fname=$(echo "$f" | sed "s/\.md//g")
if [ "$firstFile" = true ] ; then
firstFile=false
else
printf " -- " >> $FILELIST.md
fi
printf "**[$fname]($f)** ($(cat $f | wc -l))" >> $FILELIST.md
f2="html/${fname}.html"
fname=$(echo "$f" | sed "s/\.md//g")
if [ "$firstFile" = true ] ; then
firstFile=false
else
printf " -- " >> $FILELIST.md
fi
printf "**[$fname]($f)** ($(cat $f | wc -l))" >> $FILELIST.md
done
echo $HEADER > $f2
cmark-gfm -e table $f | sed "s/\.md\"/.html\"/g" >> $f2
echo $FOOTER >> $f2
for f in *.md; do
fname=$(echo "$f" | sed "s/\.md//g")
f2="html/${fname}.html"
echo $HEADER > $f2
cmark-gfm -e table $f | sed "s/\.md\"/.html\"/g" >> $f2
echo $FOOTER >> $f2
done
# this uses a C program to mark dead links, you can optionally remove this
@ -46,8 +47,8 @@ cd html
cp ../mark_dead_links .
for f in *.html; do
cat $f | ./mark_dead_links > tmp
mv tmp $f
cat $f | ./mark_dead_links > tmp
mv tmp $f
done
rm mark_dead_links

@ -1,8 +1,12 @@
# 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. 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.
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.
## General Tips'N'Tricks
## Manual Optimization
These are optimizations you do yourself by writing better code.
### General Tips'N'Tricks
These are mainly for [C](c.md), but may be usable in other languages as well.
@ -57,7 +61,7 @@ These are mainly for [C](c.md), but may be usable in other languages as well.
- **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 }
## When To Actually Optimize?
### When To Actually Optimize?
Nubs often ask this and this can also be a very nontrivial question. Generally fine, sophisticated optimization should come as one of the last steps in development, when you actually have a working thing. These are optimizations requiring significant energy/time to implement -- you don't want to spend resources on this at the stage when they may well be dropped in the end, or they won't matter because they'll be outside the bottleneck. However there are two "exceptions".
@ -65,6 +69,10 @@ The highest-level optimization is done as part of the initial design of the prog
Another kind of optimization done during development is just automatically writing good code, i.e. being familiar with specific patterns and using them without much thought. For example if you're computing some value inside a loop and this value doesn't change between iterations, you just automatically put computation of that value **before** the loop. Without this you'd simply end up with a shitty code that would have to be rewritten line by line at the end. Yes, compilers can often do this simple kind of optimization for you, but you don't want to rely on it.
## Automatic Optimization
TODO
## See Also
- [refactoring](refactoring.md)

@ -39,7 +39,7 @@ Which prints:
We divide programming languages into different groups. Perhaps the most common divisions is to two groups:
- **compiled** languages: Meant to be transformed by a [compiler](compiler.md) to a [native](native.md) (directly executable) binary program, i.e. before running the program we have to run it through the process of compilation into runnable form. These languages are typically more efficient but usually more difficult to program in, less flexible and the compiled programs are non-portable (can't just be copy-pasted to another computer with different [architecture](isa.md) and expected to run; note that this doesn't mean compiled languages aren't [portable](portability.md), just that the compiled EXECUTABLE is not). These languages are usually [lower level](low-level), use static and strong [typing](typing.md) and more of manual [memory management](memory_management.md). Examples: [C](c.md), [C++](cpp.md), [go](go.md), [Haskell](haskell.md) or [Pascal](pascal.md).
- **interpreted** languages: Meant to be interpreted by an [interpreter](interpreter.md) "on-the-go", i.e. what we write we can also immediately run. To run such program you need the interpreter of the language installed on your computer and this interpreter reads the [source code](source_code.md) as it is written and performs what it dictates (well, this is actually simplified as the interpreter normally also internally does a kind of quick "lightweight" compilation, but anyway...). These languages are generally less efficient (slower, use more RAM) but also more flexible, easier to program in and [independent of platforms](platform_independent.md). These languages usually [higher-level](high_level.md), use weak and dynamic [typing](typing.md) and automatic [memory management](memory_management.md) ([garbage collection](garbage_collection.md), ...). Examples: [Python](python.md), [Perl](perl.md), [JavaScript](js.md) and [BASH](bash.md).
- **interpreted** languages: Meant to be interpreted by an [interpreter](interpreter.md) "on-the-go", i.e. what we write we can also immediately run; these languages are often used for [scripting](scripting.md). To run such program you need the interpreter of the language installed on your computer and this interpreter reads the [source code](source_code.md) as it is written and performs what it dictates (well, this is actually simplified as the interpreter normally also internally does a kind of quick "lightweight" compilation, but anyway...). These languages are generally less efficient (slower, use more RAM) but also more flexible, easier to program in and [independent of platforms](platform_independent.md). These languages usually [higher-level](high_level.md), use weak and dynamic [typing](typing.md) and automatic [memory management](memory_management.md) ([garbage collection](garbage_collection.md), ...). Examples: [Python](python.md), [Perl](perl.md), [JavaScript](js.md) and [BASH](bash.md).
Sometimes the distinction here may not be completely clear, for example Python is normally considered an interpreted language but it can also be compiled into [bytecode](bytecode.md) and even native code. [Java](java.md) is considered more of a compiled language but it doesn't compile to native code (it compiles to bytecode). [C](c.md) is traditionally a compiled language but there also exist C interpreters. [Comun](comun.md) is meant to be both compiled and interpreted etc.
@ -68,7 +68,7 @@ Now that we have a specification, i.e. the idea, someone has to realize it, i.e.
A new language comes to existence just as other things do -- when there is a reason for it. I.e. if someone feels there is no good language for whatever he's doing or if someone has a brilliant idea and want to write a PhD thesis or if someone smokes too much weed or if a corporation wants to control some software platform etc., a new language may be made. This often happen gradually (again, like with many things), i.e. someone just starts modifying an already existing language -- at first he just makes a few macros, then he starts making a more complex preprocessor, then he sees it's starting to become a new language so he gives it a name and makes it a new language -- such language may at first just be transpiled to another language (often [C](c.md)) and over time it gets its own full compiler. At first a new language is written in some other language, however most languages aim for **[self hosted](self_hosting.md) implementation**, i.e. being written in itself. This is natural and has many advantages -- a language written in itself proves its maturity, it becomes independent and as it itself improves, so does its own compiler. Self hosting a language is one of the greatest milestones in its life -- after this the original implementation in the other language often gets deletes as it would just be a burden to keep [maintaining](maintenance.md) it.
**So can a language be bloated?** Well, yes, if we consider that a very complicated language just cannot be implemented in a simple, non-bloated way -- we can say the language itself is inevitably bloated. It may contain features that will be rarely used, it may be inelegant etc. However many times when referring to language we just refer to its implementation(s). **How to tell if language is bloated?** One can get an idea from several things, e.g. list of features, [paradigm](paradigm.md), size of its implementations, size of the specification, year of creation (newer mostly means more bloat) and so on. However be careful, many of these are just clues, for example small specification may just mean it's vague. Even a small self hosted implementation doesn't have to mean the language is small -- imagine e.g. a language that just does what you write in plain English; such language will have just one line self hosted implementation: "Implement yourself." But to actually [bootstrap](boot.md) the language will be immensely difficult and will require a lot of bloat.
**So can a language be [bloated](bloat.md)?** Well, yes, if we consider that a very complicated language just cannot be implemented in a simple, non-bloated way -- we can say the language itself is inevitably bloated. It may contain features that will be rarely used, it may be inelegant etc. However many times when referring to language we just refer to its implementation(s). **How to tell if language is bloated?** One can get an idea from several things, e.g. list of features, [paradigm](paradigm.md), size of its implementations, size of the specification, year of creation (newer mostly means more bloat) and so on. However be careful, many of these are just clues, for example small specification may just mean it's vague. Even a small self hosted implementation doesn't have to mean the language is small -- imagine e.g. a language that just does what you write in plain English; such language will have just one line self hosted implementation: "Implement yourself." But to actually [bootstrap](boot.md) the language will be immensely difficult and will require a lot of bloat.
**Can you use multiple programming languages for one project?** Yes, though it may be a burden, so don't do it just because you can. Combining languages is possible in many ways, e.g. by embedding a [scripting](scripting.md) language into a compiled language, linking together object files produces by different languages, creating different programs that communicate over network etc.
@ -107,7 +107,7 @@ Here is a table of notable programming languages in chronological order (keep in
| [Go](go.md) | **kind of** | 2009 | | 130, proprietary? | "successor to C" but not well executed, bearable but rather avoid |
| [LIL](lil.md) | **yes** | 2010? | | | not known too much but nice, "everything's a string" |
| [uxntal](uxn.md) | **yes** but SJW | 2021 | 400 (official) | 2? (est.), proprietary | assembly lang. for a minimalist virtual machine, PROPRIETARY SPEC. |
| **[comun](comun.md)** | **yes** | 2022 | < 5K | 2, CC0 | "official" [LRS](lrs.md) language, WIP, similar to Forth |
| **[comun](comun.md)** | **yes** | 2022 | < 3K | 2, CC0 | "official" [LRS](lrs.md) language, WIP, similar to Forth |
## Interesting Languages
@ -122,4 +122,4 @@ There is a community around so called **[esoteric programming languages](esolang
- [esoteric programming language](esolang.md)
- [constructed language](conlang.md)
- [pseudocode](pseudocode.md)
- [compiler](compiler.md)
- [compiler](compiler.md)

File diff suppressed because one or more lines are too long

@ -3,8 +3,8 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 547
- number of commits: 679
- total size of all texts in bytes: 2858831
- number of commits: 680
- total size of all texts in bytes: 2873219
longest articles:
@ -24,6 +24,14 @@ longest articles:
latest changes:
```
Date: Mon Feb 5 13:10:19 2024 +0100
feminism.md
free_culture.md
programming_language.md
quine.md
usenet.md
wiki_pages.md
wiki_stats.md
Date: Sun Feb 4 21:08:42 2024 +0100
c.md
cpp.md
@ -47,16 +55,6 @@ progress.md
wiki_pages.md
wiki_stats.md
youtube.md
Date: Sat Feb 3 22:30:33 2024 +0100
bloat.md
cc0.md
cpu.md
debugging.md
free_hardware.md
jokes.md
open_console.md
privacy.md
programming_tips.md
```
most wanted pages:
@ -68,17 +66,17 @@ meme.md
data_type.md
buddhism.md
quake.md
lisp.md
irl.md
gpu.md
gpl.md
drm.md
cryptography.md
waiver.md
syntax.md
rpi.md
pointer.md
lisp.md
html.md
cryptography.md
trademark.md
sdl.md
pascal.md

Loading…
Cancel
Save