So unglaubglich das klingt, kaum eine Programmiersprache hat sich so ausdauernd gehalten wie die Sprache C aus dem Jahr 1972.
Ein grossteil des Erfolges von C ist sicherlich das “keep it simple” Prinzip, umso “einfacher” eine Sprache umso einfacher lässt sich diese auf andere CPU Architekturen portieren = compiler gibt es quasi für so gut wie jede bekannte und unbekannte CPU Architectur.
Man kann behaupten C war und ist immer noch das “Englisch” welches die meisten CPUs “verstehen”.
Der GNU Linux Kernel und viele Treiber und andere Programme sind auch im Jahr 2025 (53 Jahre später) in C geschrieben, auch wenn RUST lang (= “memory-safe-C++”) langsam “rein drückt”.
Dass nach 50 Jahren immer noch Raum für Verbesserung vorhanden ist, ist (C23) erstaunlich, aber umso wichtiger, dass man dran geblieben ist und die Sprache über 5x Jahrzehnte hinweg immer weiter verbessert hat.
Der PDP-11 (1970) war der erste Computer auf welchem man C programme programmieren und compilieren und ausführen konnte.
Was C nicht umbedingt einfach(er) macht: 1970 war RAM sehr teuer und so zählte jedes Byte welches man sparen konnte und (seltsamerweise) auch wenn man 50 Jahre später das 1000x fache an CPU und RAM Ressourcen zur Verfügung hat, so ist ein Computer welcher mit der Ausführung eines einzelnen Programmes den kompletten RAM belegt (Java braucht SEHR viel RAM), nach wie vor ärgerlich X-D
D.h. auch die schnellste ARM SmartPhone Hardware mit 12GB (!) RAM kann die Performance einbrechen, wenn man zu viele Android(Java)Apps offen hat.
Leider: mit mehr Funktionen und Optionen wächst auch die Komplexität: Ist diese noch handhabbar?
D.h. [+] Software Qualität aber auch [+] Cyber Sicherheit (speziell bei Programmen die direkt aus dem inet erreichbar sind) und [+] Ressourcen Effizienz nach wie vor wichtig (ok imho [+] usability wozu imho auch gute Dokumentation mit Beispielen gehört auch wichtig :D)
Es wäre SUPER gewesen, hätte der (Mathe)Lehrer damals seinen Schülern C beigebracht, statt PASCAL (who cares about PASCAL?) X-D
Liebe Schulen, Schulleiter und Co: Java oder Python oder C oder RUST, aber kein PASCAL!!! X-D
es gibt auch schon die 5. Auflage
Interessant wie sich die Hintergrundfarbe des Titels mit jeder neuen Ausgabe ändert: 4. grün 5. rot 6. ?
Das hier ist (scheinbar) die 5. Ausgabe aus dem Jahr 2023 ISBN: 3836295040
Natürlich immer die neuste Ausgabe holen wenn mölglich: gut preislich natürlich schon ordentlich heftig aber gutes Wissen = was willste machen? 😀
c lang: latest version?
C23: https://en.wikipedia.org/wiki/C23_(C_standard_revision)
The following compilers implement an experimental compiler flag to support this standard:
c lang: what version ships with Debian13?
gcc –version
gcc (Debian 14.2.0-19) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
so even in Debian13 it’s not the VERY latest version of gcc 😀
https://gcc.gnu.org/gcc-15/changes.html
C23: how to compile c yourself?
was unable to find straight forward git repo so: (all italic data was generated by a biological AI aka a human)
question: where to get latest C23 src code? how to compile it?
To get the latest C23 (C programming language, also known as C11, C14, C17, and C18) source code, you typically want to look for the latest version of a C compiler that supports the C23 standard. As of my last update, the C23 standard was still being finalized, but you can check the following compilers for support:
- GCC (GNU Compiler Collection):
- You can download the latest version of GCC from the GCC website.
- # specifically: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git
- git clone git://gcc.gnu.org/git/gcc.git # currenlty (2.5Gbytes!)
- To compile GCC from source, follow these steps:
- Download the source code tarball from the website.
- Extract the tarball:
tar -xvf gcc-x.y.z.tar.gz
- Install dependencies (you may need to install additional packages depending on your system).
- Create a build directory:
mkdir build && cd build
- Run the configuration script:
../configure --enable-languages=c,c++
- Compile:
make
- Install:
sudo make install
- You can download the latest version of GCC from the GCC website.
- Clang/LLVM:
- You can download the latest version of Clang from the LLVM website.
- # https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm
git clone https://github.com/llvm/llvm-project.git # currently 4.3GBytes
- To compile Clang from source, follow similar steps as for GCC:
- Download the source code.
- Extract the tarball.
- Create a build directory and navigate into it.
- Run the configuration script:
cmake -G "Unix Makefiles" ../llvm
- Compile:
make
- Install:
sudo make install
- You can download the latest version of Clang from the LLVM website.
- MSVC (Microsoft Visual C++):
- If you are on Windows, you can use Visual Studio, which includes MSVC. You can download it from the Visual Studio website.
Compiling C Code
Once you have a compiler installed that supports C23, you can compile your C code using the command line. For example:
bash
gcc -std=c23 -o my_program my_program.c
or for Clang:
bash
clang -std=c23 -o my_program my_program.c
Make sure to replace my_program.c
with the name of your C source file.
Note
Always check the documentation of the specific compiler you are using for the most accurate and up-to-date instructions, especially regarding support for the C23 standard, as it may vary between compiler versions.
what CPUs do support C?
please list all CPU architectures for which C23 programs can be compiled?
- x86 (Intel and AMD)
- x86-64 (Intel and AMD)
- ARM (various implementations, such as ARMv6, ARMv7, and ARMv8)
- AArch64 (ARM 64-bit)
- MIPS
- MIPS64
- PowerPC
- PowerPC64
- SPARC
- SPARC64
- RISC-V (32-bit and 64-bit)
- AVR
- MSP430
- Thumb (ARM Thumb instruction set)
- s390x (IBM z/Architecture)
- ppc64le (PowerPC 64-bit little-endian)
- IA-64 (Itanium)
- PA-RISC
- Alpha
- VAX
- 8051
- PIC
- MicroBlaze
- Nios II
- Blackfin
- SH-2
- SH-4
- M32R
- V850
- H8
- Renesas RL78
- Renesas RH850
- various others, including some proprietary and specialized architectures.
Note that this list is not exhaustive, as new architectures are being developed and compilers are being ported to them. Additionally, some compilers may support multiple architectures, either through cross-compilation or by generating code for multiple targets.
It’s worth noting that the C23 standard itself does not specify any particular CPU architecture, but rather provides a set of rules and guidelines for writing C code that can be compiled on a wide range of platforms. The actual compilation of C23 code is typically done using a compiler such as GCC, Clang, or another vendor-specific compiler, which may support a specific set of CPU architectures.
in comparison: for what CPU architectures RUST lang compiler exist?
- x86 (Intel and AMD)
- x86-64 (Intel and AMD)
- ARM (various implementations, such as ARMv6, ARMv7, and ARMv8)
- AArch64 (ARM 64-bit)
- MIPS
- MIPS64
- PowerPC
- PowerPC64
- SPARC
- SPARC64
- RISC-V (32-bit and 64-bit)
- AVR
- MSP430
- Thumb (ARM Thumb instruction set)
- wasm32 (WebAssembly 32-bit)
- wasm64 (WebAssembly 64-bit)
- s390x (IBM z/Architecture)
- ppc64le (PowerPC 64-bit little-endian)
Note that this list may not be exhaustive, as the Rust compiler is actively being developed and new targets are being added. Additionally, some targets may be considered experimental or unstable. The Rust compiler also supports cross-compilation, allowing you to compile Rust code for a different target architecture than the one you’re running on.
wow okay that is actually also a lot
tons of links:
- https://hackaday.com/2022/09/13/c23-programming-for-everyone/
- https://simplifycpp.org/?id=a0583
- https://releases.llvm.org/
- https://clang.llvm.org/get_started.html
- ISO/IEC 9899:2024 Information technology — Programming languages — C Published (Edition 5, 2024) (221 CHF ! = 236EUR imho very expensive X-D)
- https://en.cppreference.com/w/c/23
- https://en.cppreference.com/w/c/language/history
- https://en.cppreference.com/w/c
tools: debuggers:
online c compiler editor:
- https://thradams.com/cake/playground.html
- https://www.onlinegdb.com/online_c_compiler
- https://www.mycompiler.io
question: was it possible to use C lang on PDP-8 ?
While the PDP-8, introduced by Digital Equipment Corporation (DEC) in 1965, was a popular and influential minicomputer, it did not have a native C compiler. The PDP-8 was primarily designed for assembly language programming and higher-level languages like FORTRAN and LISP, which were more suited to its architecture and limited resources.
question: can u give actual numbers: to compile a simple helloworld in this lang u would need 123 KBytes of RAM
Estimated RAM Requirements for Compiling “Hello, World!” in Various Languages
- FORTRAN (FORTRAN I):
- Approx. 8-16 KB of RAM for early implementations.
- LISP (LISP 1.5):
- Approx. 16-32 KB of RAM for early interpreters.
- BASIC (Tiny BASIC):
- Approx. 1-2 KB of RAM for Tiny BASIC implementations.
- C (K&R C for PDP-11):
- Approx. 16-32 KB of RAM for the original C compiler.
- Pascal (UCSD Pascal):
- Approx. 16-32 KB of RAM for early implementations.
- Assembly Language:
- Approx. 1-4 KB of RAM for simple assembly programs, depending on the assembler.
- Forth:
- Approx. 2-8 KB of RAM for minimal Forth implementations.
- COBOL (Early Implementations):
- Approx. 32-64 KB of RAM for early COBOL compilers.
- Ada (Early Implementations):
- Approx. 32-64 KB of RAM for early Ada compilers.
- Modula-2:
- Approx. 16-32 KB of RAM for early implementations.
Summary
These estimates are based on historical context and the capabilities of early compilers. Modern compilers for these languages may require significantly more RAM due to additional features, optimizations, and support for modern programming paradigms. For example, modern C compilers like GCC or Clang can require several megabytes of RAM to compile even simple programs, depending on the environment and options used.
If you need precise numbers for specific compilers or environments, benchmarking would be necessary, as actual memory usage can vary widely based on many factors.
liked this article?
- only together we can create a truly free world
- plz support dwaves to keep it up & running!
- (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
- really really hate advertisement
- contribute: whenever a solution was found, blog about it for others to find!
- talk about, recommend & link to this blog and articles
- thanks to all who contribute!
