C-lang - Cr;Lf;
In: computer, programming, language.

C

C is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs.
A successor to the programming language B, C was originally developed at Bell Labs by Ritchie between 1972 and 1973 to construct utilities running on Unix.
It was applied to re-implementing the kernel of the Unix operating system. During the 1980s, C gradually gained popularity. It has become one of the most widely used programming languages, with C compilers available for practically all modern computer architectures and operating systems.
https://wikipedia.org/wiki/C_(programming_language)

Compilers

The GNU C Library (glibc) manual:
https://sourceware.org/glibc/manual/html_mono/libc.html
GCC libC source code:
https://sourceware.org/git/?p=glibc.git;a=tree

GCC official manual:
https://gcc.gnu.org/onlinedocs/gcc
GCC source code:
https://gcc.gnu.org/git/?p=gcc.git;a=tree

Clang documentation:
https://clang.llvm.org/docs/UsersManual.html
Clang libC source code:
https://github.com/llvm/llvm-project/tree/main/libc

Build-once run-anywhere C library:
https://github.com/jart/cosmopolitan

chibiCC: a Small C Compiler:
https://github.com/rui314/chibicc
https://github.com/jart/cosmopolitan/tree/master/third_party/chibicc

8cc is a compiler for the C programming language.
It's intended to support all C11 language features while keeping the code as small and simple as possible.
No longer an active project, the successor is chibiCC.
https://github.com/rui314/8cc

Cproc is a C11 compiler using QBE as a backend:
Some C23 features and GNU C extensions are also implemented
https://sr.ht/~mcf/cproc

The CompCert C verified compiler.
Formally verified, using machine-assisted mathematical proofs, to be exempt from miscompilation issues.
https://compcert.org/compcert-C.html
https://compcert.org/motivations.html
https://compcert.org/man/index.html

nwcc is a simple C compiler for Unix systems targeting a variety of architectures.
Works with Linux/Mac OS X/FreeBSD/OpenBSD/NetBSD/Solaris on 80x86, Linux/Mac OS X/FreeBSD/OpenBSD on AMD64, Solaris/Linux on SPARC, AIX/Linux on PowerPC, and IRIX on MIPS hardware.
https://nwcc.sourceforge.net

A C compiler written in Zig:
https://github.com/Vexu/arocc
https://aro.vexu.eu

Tiny C compiler reference documentation:
TCC mainly supports the i386 target on Linux and Windows
https://bellard.org/tcc
https://bellard.org/tcc/tcc-doc.html

c4: C implemented in four functions, an exercise in minimalism.
https://github.com/rswier/c4

Smaller C is a simple and small single-pass C compiler, currently supporting most of the C language common between C89/ANSI C
and C99 (minus some C89 and plus some C99 features).
https://github.com/alexfru/SmallerC

Pelles C is a complete development kit for Desktop Windows.
It contains among other things an optimizing C compiler, a macro assembler, a linker, a resource compiler, a message compiler, a code signing utility, a make utility and an install builder.
Support for 32-bit Windows (X86) and 64-bit Windows (X64).
http://smorgasbordet.com/pellesc

Digital Mars C++ compiler, Windows only.
Win32, Win16, DOS16 and DOS32.
https://digitalmars.com/download/freecompiler.html

Using C/C++ in Visual Studio Code:
https://code.visualstudio.com/docs/languages/cpp


Learning

C language reference:
https://en.cppreference.com/w/c

C language reference (as implemented in Microsoft C):
https://learn.microsoft.com/en-us/cpp/c-language/c-language-reference
https://learn.microsoft.com/en-us/cpp/c-language/ansi-conformance – ANSI conformance
https://learn.microsoft.com/en-us/cpp/cpp/fundamental-types-cpp – C++ builtin types

C language cheatsheet:
https://onecompiler.com/cheatsheets/c

Hyperpolyglot C vs Go
https://hyperpolyglot.org/c

W3 schools learn C:

C programming language tutorial:
https://geeksforgeeks.org/c-programming-language
https://tutorialspoint.com/cprogramming

C standard library:
https://tutorialspoint.com/c_standard_library

comp.lang.c Frequently Asked Questions:
https://c-faq.com/index.html

Tiny C Projects, book & useful links:
https://c-for-dummies.com/tinyc
https://livebook.manning.com/book/tiny-c-projects
https://c-for-dummies.com/online – Courses

What's the difference between malloc and calloc?
https://stackoverflow.com/questions/1538420/difference-between-malloc-and-calloc
calloc() gives you a zero-initialized buffer, while malloc() leaves the memory uninitialized
calloc = malloc + memset, pretty much
Use malloc() if you are going to set everything that you use in the allocated space
Use calloc() if you're going to leave parts of the data uninitialized - and it would be beneficial to have the unset parts zeroed
In operating systems with optimistic memory allocation, like Linux, the pointer returned by malloc isn't backed by real memory until the program actually touches it
calloc does indeed touch the memory (it writes zeroes on it) and thus you'll be sure the OS is backing the allocation with actual RAM (or swap)
calloc is slower than malloc (not only does it have to zero it, the OS must also find a suitable memory area by possibly swapping out other processes)


Libraries

Common mathematical functions (in math.h & stdlib.h)
https://en.cppreference.com/w/c/numeric/math

Type-generic math (in tgmath.h)
https://en.cppreference.com/w/c/numeric/tgmath

File input/output (in stdio.h and wchar.h)
https://en.cppreference.com/w/c/io

Date and time utilities
https://en.cppreference.com/w/c/chrono

Pseudo-random number generation (in stdlib.h)
https://en.cppreference.com/w/c/numeric/random

Ultralightweight JSON parser in ANSI C (C89):
https://github.com/DaveGamble/cJSON

Ultra fast JSON decoder and encoder written in C with Python bindings:
https://github.com/ultrajson/ultrajson/tree/main/lib

A byte-oriented AES-256 implementation in C:
https://github.com/ilvn/aes256
https://github.com/limpkin/mooltipass/blob/master/source\_code/src/AES

SHA-256 secure hash algorithm:
https://github.com/ilvn/SHA256

Binary-to-text encoding that is safe to pass through modern text processors
Alternative To: Base16 Base32 Base64 Ascii85
Implementations: Safe16 Safe32 Safe64 Safe80 Safe85
https://github.com/kstenerud/safe-encoding

Single-file public domain libraries for C/C++:
https://github.com/nothings/stb

Minimal cross-platform standalone C headers:
https://github.com/floooh/sokol

Small library for working with Unicode in C
https://github.com/holepunchto/libutf

Extended library for C language (c99, x86-64, linux, windows)
https://github.com/number571/extclib

Simple file dialog
A small C library for opening a file dialog on Windows and Linux
https://github.com/csprite/sfd

Parse streaming lines in C
https://github.com/holepunchto/libparseline

Cross-platform implementation of CRC32 with hardware acceleration
https://github.com/holepunchto/libcrc

B-tree implementation in C
https://github.com/tidwall/btree.c

BlurHash is a very compact representation of a placeholder for an image:
https://github.com/woltapp/blurhash
https://blurha.sh

Darknet is an open source neural network framework written in C and CUDA.
It is fast, easy to install, and supports CPU and GPU computation.
https://github.com/pjreddie/darknet

Genann is a minimal, well-tested library for training and using feedforward artificial neural networks (ANN) in C.
Its primary focus is on being simple, fast, reliable, and hackable.
It achieves this by providing only the necessary functions and little extra.
Genann is self-contained in two files: genann.c and genann.h.
https://github.com/codeplea/genann

Tinn (Tiny Neural Network) is a 200 line dependency free neural network library written in C99.
Tinn is great for embedded systems. Train a model on your powerful desktop and load it onto a microcontroller and use the analog to digital converter to predict real time events.
https://github.com/glouw/tinn

×